summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/backlight.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-02-17 21:39:44 (GMT)
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-16 19:47:54 (GMT)
commita19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch)
tree631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/video/backlight/backlight.c
parent57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff)
downloadlinux-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.tar.xz
backlight: Allow properties to be passed at registration
Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers/video/backlight/backlight.c')
-rw-r--r--drivers/video/backlight/backlight.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index b800cd4..68bb838 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -269,7 +269,8 @@ EXPORT_SYMBOL(backlight_force_update);
* ERR_PTR() or a pointer to the newly allocated device.
*/
struct backlight_device *backlight_device_register(const char *name,
- struct device *parent, void *devdata, const struct backlight_ops *ops)
+ struct device *parent, void *devdata, const struct backlight_ops *ops,
+ const struct backlight_properties *props)
{
struct backlight_device *new_bd;
int rc;
@@ -289,6 +290,11 @@ struct backlight_device *backlight_device_register(const char *name,
dev_set_name(&new_bd->dev, name);
dev_set_drvdata(&new_bd->dev, devdata);
+ /* Set default properties */
+ if (props)
+ memcpy(&new_bd->props, props,
+ sizeof(struct backlight_properties));
+
rc = device_register(&new_bd->dev);
if (rc) {
kfree(new_bd);