diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 18:58:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 18:58:07 -0500 |
commit | 4e46aa083853a84c770e00b03746bdeaf5c5aeff (patch) | |
tree | f93d3f88e038d176a4661639edbdb9a99d9f7402 /drivers/video | |
parent | 9209e4bd4b3b9ee3a104313b426380e8d1f59260 (diff) | |
parent | f7a297af49e5d9d2c577466307e8ef392750c9d9 (diff) |
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
backlight: mbp_nvidia_bl - add two more MacBookPro variants
backlight: Pass device through notify callback in the pwm driver
backlight: PTR_ERR return of wrong pointer in cr_backlight_probe()
backlight: Constify struct backlight_ops
backlight/thinkpad-acpi: issue backlight class events
Fix up trivial conflicts in thinkpad-acpi support (backlight support
already merged earlier).
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/adp5520_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/adx_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/atmel-pwm-bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/backlight.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/corgi_lcd.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/cr_bllcd.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/da903x_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/generic_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/hp680_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/jornada720_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/kb3886_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/locomolcd.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/mbp_nvidia_bl.c | 20 | ||||
-rw-r--r-- | drivers/video/backlight/omap1_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/progear_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 11 | ||||
-rw-r--r-- | drivers/video/backlight/tosa_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/wm831x_bl.c | 2 |
18 files changed, 43 insertions, 22 deletions
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index 4c10edecfb66..86d95c228adb 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c | |||
@@ -85,7 +85,7 @@ static int adp5520_bl_get_brightness(struct backlight_device *bl) | |||
85 | return error ? data->current_brightness : reg_val; | 85 | return error ? data->current_brightness : reg_val; |
86 | } | 86 | } |
87 | 87 | ||
88 | static struct backlight_ops adp5520_bl_ops = { | 88 | static const struct backlight_ops adp5520_bl_ops = { |
89 | .update_status = adp5520_bl_update_status, | 89 | .update_status = adp5520_bl_update_status, |
90 | .get_brightness = adp5520_bl_get_brightness, | 90 | .get_brightness = adp5520_bl_get_brightness, |
91 | }; | 91 | }; |
diff --git a/drivers/video/backlight/adx_bl.c b/drivers/video/backlight/adx_bl.c index 2c3bdfc620b7..d769b0bab21a 100644 --- a/drivers/video/backlight/adx_bl.c +++ b/drivers/video/backlight/adx_bl.c | |||
@@ -61,7 +61,7 @@ static int adx_backlight_check_fb(struct fb_info *fb) | |||
61 | return 1; | 61 | return 1; |
62 | } | 62 | } |
63 | 63 | ||
64 | static struct backlight_ops adx_backlight_ops = { | 64 | static const struct backlight_ops adx_backlight_ops = { |
65 | .options = 0, | 65 | .options = 0, |
66 | .update_status = adx_backlight_update_status, | 66 | .update_status = adx_backlight_update_status, |
67 | .get_brightness = adx_backlight_get_brightness, | 67 | .get_brightness = adx_backlight_get_brightness, |
diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c index 2cf7ba52f67c..f625ffc69ad3 100644 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c | |||
@@ -113,7 +113,7 @@ static int atmel_pwm_bl_init_pwm(struct atmel_pwm_bl *pwmbl) | |||
113 | return pwm_channel_enable(&pwmbl->pwmc); | 113 | return pwm_channel_enable(&pwmbl->pwmc); |
114 | } | 114 | } |
115 | 115 | ||
116 | static struct backlight_ops atmel_pwm_bl_ops = { | 116 | static const struct backlight_ops atmel_pwm_bl_ops = { |
117 | .get_brightness = atmel_pwm_bl_get_intensity, | 117 | .get_brightness = atmel_pwm_bl_get_intensity, |
118 | .update_status = atmel_pwm_bl_set_intensity, | 118 | .update_status = atmel_pwm_bl_set_intensity, |
119 | }; | 119 | }; |
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 6615ac7fa60a..18829cf68b1b 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -269,7 +269,7 @@ EXPORT_SYMBOL(backlight_force_update); | |||
269 | * ERR_PTR() or a pointer to the newly allocated device. | 269 | * ERR_PTR() or a pointer to the newly allocated device. |
270 | */ | 270 | */ |
271 | struct backlight_device *backlight_device_register(const char *name, | 271 | struct backlight_device *backlight_device_register(const char *name, |
272 | struct device *parent, void *devdata, struct backlight_ops *ops) | 272 | struct device *parent, void *devdata, const struct backlight_ops *ops) |
273 | { | 273 | { |
274 | struct backlight_device *new_bd; | 274 | struct backlight_device *new_bd; |
275 | int rc; | 275 | int rc; |
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index 96774949cd30..b4bcf8043797 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c | |||
@@ -451,7 +451,7 @@ void corgi_lcd_limit_intensity(int limit) | |||
451 | } | 451 | } |
452 | EXPORT_SYMBOL(corgi_lcd_limit_intensity); | 452 | EXPORT_SYMBOL(corgi_lcd_limit_intensity); |
453 | 453 | ||
454 | static struct backlight_ops corgi_bl_ops = { | 454 | static const struct backlight_ops corgi_bl_ops = { |
455 | .get_brightness = corgi_bl_get_intensity, | 455 | .get_brightness = corgi_bl_get_intensity, |
456 | .update_status = corgi_bl_update_status, | 456 | .update_status = corgi_bl_update_status, |
457 | }; | 457 | }; |
diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c index b9fe62b475c6..da86db4374a0 100644 --- a/drivers/video/backlight/cr_bllcd.c +++ b/drivers/video/backlight/cr_bllcd.c | |||
@@ -108,7 +108,7 @@ static int cr_backlight_get_intensity(struct backlight_device *bd) | |||
108 | return intensity; | 108 | return intensity; |
109 | } | 109 | } |
110 | 110 | ||
111 | static struct backlight_ops cr_backlight_ops = { | 111 | static const struct backlight_ops cr_backlight_ops = { |
112 | .get_brightness = cr_backlight_get_intensity, | 112 | .get_brightness = cr_backlight_get_intensity, |
113 | .update_status = cr_backlight_set_intensity, | 113 | .update_status = cr_backlight_set_intensity, |
114 | }; | 114 | }; |
@@ -201,7 +201,7 @@ static int cr_backlight_probe(struct platform_device *pdev) | |||
201 | if (IS_ERR(ldp)) { | 201 | if (IS_ERR(ldp)) { |
202 | backlight_device_unregister(bdp); | 202 | backlight_device_unregister(bdp); |
203 | pci_dev_put(lpc_dev); | 203 | pci_dev_put(lpc_dev); |
204 | return PTR_ERR(bdp); | 204 | return PTR_ERR(ldp); |
205 | } | 205 | } |
206 | 206 | ||
207 | pci_read_config_dword(lpc_dev, CRVML_REG_GPIOBAR, | 207 | pci_read_config_dword(lpc_dev, CRVML_REG_GPIOBAR, |
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index f2d76dae1eb3..74cdc640173d 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c | |||
@@ -95,7 +95,7 @@ static int da903x_backlight_get_brightness(struct backlight_device *bl) | |||
95 | return data->current_brightness; | 95 | return data->current_brightness; |
96 | } | 96 | } |
97 | 97 | ||
98 | static struct backlight_ops da903x_backlight_ops = { | 98 | static const struct backlight_ops da903x_backlight_ops = { |
99 | .update_status = da903x_backlight_update_status, | 99 | .update_status = da903x_backlight_update_status, |
100 | .get_brightness = da903x_backlight_get_brightness, | 100 | .get_brightness = da903x_backlight_get_brightness, |
101 | }; | 101 | }; |
diff --git a/drivers/video/backlight/generic_bl.c b/drivers/video/backlight/generic_bl.c index 6d27f62fdcd0..e6d348e63596 100644 --- a/drivers/video/backlight/generic_bl.c +++ b/drivers/video/backlight/generic_bl.c | |||
@@ -70,7 +70,7 @@ void corgibl_limit_intensity(int limit) | |||
70 | } | 70 | } |
71 | EXPORT_SYMBOL(corgibl_limit_intensity); | 71 | EXPORT_SYMBOL(corgibl_limit_intensity); |
72 | 72 | ||
73 | static struct backlight_ops genericbl_ops = { | 73 | static const struct backlight_ops genericbl_ops = { |
74 | .options = BL_CORE_SUSPENDRESUME, | 74 | .options = BL_CORE_SUSPENDRESUME, |
75 | .get_brightness = genericbl_get_intensity, | 75 | .get_brightness = genericbl_get_intensity, |
76 | .update_status = genericbl_send_intensity, | 76 | .update_status = genericbl_send_intensity, |
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c index 7fb4eefff80d..f7cc528d5be7 100644 --- a/drivers/video/backlight/hp680_bl.c +++ b/drivers/video/backlight/hp680_bl.c | |||
@@ -98,7 +98,7 @@ static int hp680bl_get_intensity(struct backlight_device *bd) | |||
98 | return current_intensity; | 98 | return current_intensity; |
99 | } | 99 | } |
100 | 100 | ||
101 | static struct backlight_ops hp680bl_ops = { | 101 | static const struct backlight_ops hp680bl_ops = { |
102 | .get_brightness = hp680bl_get_intensity, | 102 | .get_brightness = hp680bl_get_intensity, |
103 | .update_status = hp680bl_set_intensity, | 103 | .update_status = hp680bl_set_intensity, |
104 | }; | 104 | }; |
diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c index 7aed2565c1bd..db9071fc5665 100644 --- a/drivers/video/backlight/jornada720_bl.c +++ b/drivers/video/backlight/jornada720_bl.c | |||
@@ -93,7 +93,7 @@ out: | |||
93 | return ret; | 93 | return ret; |
94 | } | 94 | } |
95 | 95 | ||
96 | static struct backlight_ops jornada_bl_ops = { | 96 | static const struct backlight_ops jornada_bl_ops = { |
97 | .get_brightness = jornada_bl_get_brightness, | 97 | .get_brightness = jornada_bl_get_brightness, |
98 | .update_status = jornada_bl_update_status, | 98 | .update_status = jornada_bl_update_status, |
99 | .options = BL_CORE_SUSPENDRESUME, | 99 | .options = BL_CORE_SUSPENDRESUME, |
diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c index a38fda1742dd..939e7b830cf3 100644 --- a/drivers/video/backlight/kb3886_bl.c +++ b/drivers/video/backlight/kb3886_bl.c | |||
@@ -134,7 +134,7 @@ static int kb3886bl_get_intensity(struct backlight_device *bd) | |||
134 | return kb3886bl_intensity; | 134 | return kb3886bl_intensity; |
135 | } | 135 | } |
136 | 136 | ||
137 | static struct backlight_ops kb3886bl_ops = { | 137 | static const struct backlight_ops kb3886bl_ops = { |
138 | .get_brightness = kb3886bl_get_intensity, | 138 | .get_brightness = kb3886bl_get_intensity, |
139 | .update_status = kb3886bl_send_intensity, | 139 | .update_status = kb3886bl_send_intensity, |
140 | }; | 140 | }; |
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index 6b488b8a7eee..00a9591b0003 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c | |||
@@ -141,7 +141,7 @@ static int locomolcd_get_intensity(struct backlight_device *bd) | |||
141 | return current_intensity; | 141 | return current_intensity; |
142 | } | 142 | } |
143 | 143 | ||
144 | static struct backlight_ops locomobl_data = { | 144 | static const struct backlight_ops locomobl_data = { |
145 | .get_brightness = locomolcd_get_intensity, | 145 | .get_brightness = locomolcd_get_intensity, |
146 | .update_status = locomolcd_set_intensity, | 146 | .update_status = locomolcd_set_intensity, |
147 | }; | 147 | }; |
diff --git a/drivers/video/backlight/mbp_nvidia_bl.c b/drivers/video/backlight/mbp_nvidia_bl.c index 9edb8d7c295f..2e78b0784bdc 100644 --- a/drivers/video/backlight/mbp_nvidia_bl.c +++ b/drivers/video/backlight/mbp_nvidia_bl.c | |||
@@ -33,7 +33,7 @@ struct dmi_match_data { | |||
33 | unsigned long iostart; | 33 | unsigned long iostart; |
34 | unsigned long iolen; | 34 | unsigned long iolen; |
35 | /* Backlight operations structure. */ | 35 | /* Backlight operations structure. */ |
36 | struct backlight_ops backlight_ops; | 36 | const struct backlight_ops backlight_ops; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | /* Module parameters. */ | 39 | /* Module parameters. */ |
@@ -220,6 +220,24 @@ static const struct dmi_system_id __initdata mbp_device_table[] = { | |||
220 | }, | 220 | }, |
221 | { | 221 | { |
222 | .callback = mbp_dmi_match, | 222 | .callback = mbp_dmi_match, |
223 | .ident = "MacBookPro 5,3", | ||
224 | .matches = { | ||
225 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
226 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,3"), | ||
227 | }, | ||
228 | .driver_data = (void *)&nvidia_chipset_data, | ||
229 | }, | ||
230 | { | ||
231 | .callback = mbp_dmi_match, | ||
232 | .ident = "MacBookPro 5,4", | ||
233 | .matches = { | ||
234 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
235 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,4"), | ||
236 | }, | ||
237 | .driver_data = (void *)&nvidia_chipset_data, | ||
238 | }, | ||
239 | { | ||
240 | .callback = mbp_dmi_match, | ||
223 | .ident = "MacBookPro 5,5", | 241 | .ident = "MacBookPro 5,5", |
224 | .matches = { | 242 | .matches = { |
225 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | 243 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), |
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index 8693e5fcd2eb..409ca9643528 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c | |||
@@ -125,7 +125,7 @@ static int omapbl_get_intensity(struct backlight_device *dev) | |||
125 | return bl->current_intensity; | 125 | return bl->current_intensity; |
126 | } | 126 | } |
127 | 127 | ||
128 | static struct backlight_ops omapbl_ops = { | 128 | static const struct backlight_ops omapbl_ops = { |
129 | .get_brightness = omapbl_get_intensity, | 129 | .get_brightness = omapbl_get_intensity, |
130 | .update_status = omapbl_update_status, | 130 | .update_status = omapbl_update_status, |
131 | }; | 131 | }; |
diff --git a/drivers/video/backlight/progear_bl.c b/drivers/video/backlight/progear_bl.c index 9edaf24fd82d..075786e05034 100644 --- a/drivers/video/backlight/progear_bl.c +++ b/drivers/video/backlight/progear_bl.c | |||
@@ -54,7 +54,7 @@ static int progearbl_get_intensity(struct backlight_device *bd) | |||
54 | return intensity - HW_LEVEL_MIN; | 54 | return intensity - HW_LEVEL_MIN; |
55 | } | 55 | } |
56 | 56 | ||
57 | static struct backlight_ops progearbl_ops = { | 57 | static const struct backlight_ops progearbl_ops = { |
58 | .get_brightness = progearbl_get_intensity, | 58 | .get_brightness = progearbl_get_intensity, |
59 | .update_status = progearbl_set_intensity, | 59 | .update_status = progearbl_set_intensity, |
60 | }; | 60 | }; |
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 887166267443..9d2ec2a1cce8 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -22,8 +22,10 @@ | |||
22 | 22 | ||
23 | struct pwm_bl_data { | 23 | struct pwm_bl_data { |
24 | struct pwm_device *pwm; | 24 | struct pwm_device *pwm; |
25 | struct device *dev; | ||
25 | unsigned int period; | 26 | unsigned int period; |
26 | int (*notify)(int brightness); | 27 | int (*notify)(struct device *, |
28 | int brightness); | ||
27 | }; | 29 | }; |
28 | 30 | ||
29 | static int pwm_backlight_update_status(struct backlight_device *bl) | 31 | static int pwm_backlight_update_status(struct backlight_device *bl) |
@@ -39,7 +41,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl) | |||
39 | brightness = 0; | 41 | brightness = 0; |
40 | 42 | ||
41 | if (pb->notify) | 43 | if (pb->notify) |
42 | brightness = pb->notify(brightness); | 44 | brightness = pb->notify(pb->dev, brightness); |
43 | 45 | ||
44 | if (brightness == 0) { | 46 | if (brightness == 0) { |
45 | pwm_config(pb->pwm, 0, pb->period); | 47 | pwm_config(pb->pwm, 0, pb->period); |
@@ -56,7 +58,7 @@ static int pwm_backlight_get_brightness(struct backlight_device *bl) | |||
56 | return bl->props.brightness; | 58 | return bl->props.brightness; |
57 | } | 59 | } |
58 | 60 | ||
59 | static struct backlight_ops pwm_backlight_ops = { | 61 | static const struct backlight_ops pwm_backlight_ops = { |
60 | .update_status = pwm_backlight_update_status, | 62 | .update_status = pwm_backlight_update_status, |
61 | .get_brightness = pwm_backlight_get_brightness, | 63 | .get_brightness = pwm_backlight_get_brightness, |
62 | }; | 64 | }; |
@@ -88,6 +90,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) | |||
88 | 90 | ||
89 | pb->period = data->pwm_period_ns; | 91 | pb->period = data->pwm_period_ns; |
90 | pb->notify = data->notify; | 92 | pb->notify = data->notify; |
93 | pb->dev = &pdev->dev; | ||
91 | 94 | ||
92 | pb->pwm = pwm_request(data->pwm_id, "backlight"); | 95 | pb->pwm = pwm_request(data->pwm_id, "backlight"); |
93 | if (IS_ERR(pb->pwm)) { | 96 | if (IS_ERR(pb->pwm)) { |
@@ -146,7 +149,7 @@ static int pwm_backlight_suspend(struct platform_device *pdev, | |||
146 | struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); | 149 | struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); |
147 | 150 | ||
148 | if (pb->notify) | 151 | if (pb->notify) |
149 | pb->notify(0); | 152 | pb->notify(pb->dev, 0); |
150 | pwm_config(pb->pwm, 0, pb->period); | 153 | pwm_config(pb->pwm, 0, pb->period); |
151 | pwm_disable(pb->pwm); | 154 | pwm_disable(pb->pwm); |
152 | return 0; | 155 | return 0; |
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 43edbada12d1..e14ce4d469f5 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c | |||
@@ -72,7 +72,7 @@ static int tosa_bl_get_brightness(struct backlight_device *dev) | |||
72 | return props->brightness; | 72 | return props->brightness; |
73 | } | 73 | } |
74 | 74 | ||
75 | static struct backlight_ops bl_ops = { | 75 | static const struct backlight_ops bl_ops = { |
76 | .get_brightness = tosa_bl_get_brightness, | 76 | .get_brightness = tosa_bl_get_brightness, |
77 | .update_status = tosa_bl_update_status, | 77 | .update_status = tosa_bl_update_status, |
78 | }; | 78 | }; |
diff --git a/drivers/video/backlight/wm831x_bl.c b/drivers/video/backlight/wm831x_bl.c index 467bdb7efb23..e32add37a203 100644 --- a/drivers/video/backlight/wm831x_bl.c +++ b/drivers/video/backlight/wm831x_bl.c | |||
@@ -112,7 +112,7 @@ static int wm831x_backlight_get_brightness(struct backlight_device *bl) | |||
112 | return data->current_brightness; | 112 | return data->current_brightness; |
113 | } | 113 | } |
114 | 114 | ||
115 | static struct backlight_ops wm831x_backlight_ops = { | 115 | static const struct backlight_ops wm831x_backlight_ops = { |
116 | .options = BL_CORE_SUSPENDRESUME, | 116 | .options = BL_CORE_SUSPENDRESUME, |
117 | .update_status = wm831x_backlight_update_status, | 117 | .update_status = wm831x_backlight_update_status, |
118 | .get_brightness = wm831x_backlight_get_brightness, | 118 | .get_brightness = wm831x_backlight_get_brightness, |