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/macintosh | |
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/macintosh')
-rw-r--r-- | drivers/macintosh/via-pmu-backlight.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c index 4f3c4479c16a..1cec02f6c431 100644 --- a/drivers/macintosh/via-pmu-backlight.c +++ b/drivers/macintosh/via-pmu-backlight.c | |||
@@ -144,6 +144,7 @@ void pmu_backlight_set_sleep(int sleep) | |||
144 | 144 | ||
145 | void __init pmu_backlight_init() | 145 | void __init pmu_backlight_init() |
146 | { | 146 | { |
147 | struct backlight_properties props; | ||
147 | struct backlight_device *bd; | 148 | struct backlight_device *bd; |
148 | char name[10]; | 149 | char name[10]; |
149 | int level, autosave; | 150 | int level, autosave; |
@@ -161,13 +162,15 @@ void __init pmu_backlight_init() | |||
161 | 162 | ||
162 | snprintf(name, sizeof(name), "pmubl"); | 163 | snprintf(name, sizeof(name), "pmubl"); |
163 | 164 | ||
164 | bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data); | 165 | memset(&props, 0, sizeof(struct backlight_properties)); |
166 | props.max_brightness = FB_BACKLIGHT_LEVELS - 1; | ||
167 | bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data, | ||
168 | &props); | ||
165 | if (IS_ERR(bd)) { | 169 | if (IS_ERR(bd)) { |
166 | printk(KERN_ERR "PMU Backlight registration failed\n"); | 170 | printk(KERN_ERR "PMU Backlight registration failed\n"); |
167 | return; | 171 | return; |
168 | } | 172 | } |
169 | uses_pmu_bl = 1; | 173 | uses_pmu_bl = 1; |
170 | bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; | ||
171 | pmu_backlight_init_curve(0x7F, 0x46, 0x0E); | 174 | pmu_backlight_init_curve(0x7F, 0x46, 0x0E); |
172 | 175 | ||
173 | level = bd->props.max_brightness; | 176 | level = bd->props.max_brightness; |