diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-02-17 16:39:44 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 15:47:54 -0400 |
commit | a19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch) | |
tree | 631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/platform/x86/acer-wmi.c | |
parent | 57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff) |
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/platform/x86/acer-wmi.c')
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 226b3e93498c..cbca40aa4006 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -922,9 +922,13 @@ static struct backlight_ops acer_bl_ops = { | |||
922 | 922 | ||
923 | static int __devinit acer_backlight_init(struct device *dev) | 923 | static int __devinit acer_backlight_init(struct device *dev) |
924 | { | 924 | { |
925 | struct backlight_properties props; | ||
925 | struct backlight_device *bd; | 926 | struct backlight_device *bd; |
926 | 927 | ||
927 | bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops); | 928 | memset(&props, 0, sizeof(struct backlight_properties)); |
929 | props.max_brightness = max_brightness; | ||
930 | bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops, | ||
931 | &props); | ||
928 | if (IS_ERR(bd)) { | 932 | if (IS_ERR(bd)) { |
929 | printk(ACER_ERR "Could not register Acer backlight device\n"); | 933 | printk(ACER_ERR "Could not register Acer backlight device\n"); |
930 | acer_backlight_device = NULL; | 934 | acer_backlight_device = NULL; |
@@ -935,7 +939,6 @@ static int __devinit acer_backlight_init(struct device *dev) | |||
935 | 939 | ||
936 | bd->props.power = FB_BLANK_UNBLANK; | 940 | bd->props.power = FB_BLANK_UNBLANK; |
937 | bd->props.brightness = read_brightness(bd); | 941 | bd->props.brightness = read_brightness(bd); |
938 | bd->props.max_brightness = max_brightness; | ||
939 | backlight_update_status(bd); | 942 | backlight_update_status(bd); |
940 | return 0; | 943 | return 0; |
941 | } | 944 | } |