diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 20:23:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 20:23:16 -0400 |
commit | 7385d6fd88dd7981cdef8aa91e46570e5ba068c8 (patch) | |
tree | e9cd26c7e4f28b0ec5dc192e217a23ea4c3e4cd1 /drivers/video | |
parent | e0b8b78651350e8dcf9cc60a959ccbcfc5bc3061 (diff) | |
parent | 87464cdba2aeec196e75908fbbeaf4a26753637a (diff) |
Merge tag 'backlight-for-linus-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight changes from Lee Jones:
Changes to existing drivers:
- remove get brightness implementations in via-pmu-backlight
samsung-q10 aat2870_bl ams369fg06 bd6107 gpio_backlight ld9040
lp855x_bl lp8788_bl lv5207lp pandora_bl pwm_bl s6e63m0 tps65217_bl
aty128fb atyfb_base radeon_backlight s6e8ax0 nv_backlight
riva/fbdev
- improve error handling in jornada720_lcd
- make use of new 'get optional' GPIO command in pwm_bl
- fix sparse warning in ipaq_micro_bl
New drivers/supported devices:
- new driver for iPAQ"
* tag 'backlight-for-linus-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
backlight: ipaq_micro: Fix sparse non static symbol warning
backlight: Add driver for iPAQ micro backlight
backlight: pwm-backlight: Use devm_gpiod_get_optional()
backlight: jornada720: Minimise code duplication and handle errors better
backlight: Show brightness even if get_brightness is not implemented
backlight: Remove trivial get_brightness implementations
Diffstat (limited to 'drivers/video')
23 files changed, 116 insertions, 131 deletions
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 5d449059a556..cc153f55d9f9 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig | |||
@@ -207,6 +207,15 @@ config BACKLIGHT_GENERIC | |||
207 | known as the Corgi backlight driver. If you have a Sharp Zaurus | 207 | known as the Corgi backlight driver. If you have a Sharp Zaurus |
208 | SL-C7xx, SL-Cxx00 or SL-6000x say y. | 208 | SL-C7xx, SL-Cxx00 or SL-6000x say y. |
209 | 209 | ||
210 | config BACKLIGHT_IPAQ_MICRO | ||
211 | tristate "iPAQ microcontroller backlight driver" | ||
212 | depends on MFD_IPAQ_MICRO | ||
213 | default y | ||
214 | help | ||
215 | Say y to enable the backlight driver for Compaq iPAQ handheld | ||
216 | computers. Say yes if you have one of the h3100/h3600/h3700 | ||
217 | machines. | ||
218 | |||
210 | config BACKLIGHT_LM3533 | 219 | config BACKLIGHT_LM3533 |
211 | tristate "Backlight Driver for LM3533" | 220 | tristate "Backlight Driver for LM3533" |
212 | depends on BACKLIGHT_CLASS_DEVICE | 221 | depends on BACKLIGHT_CLASS_DEVICE |
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index bb820024f346..a9ea34a39cad 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile | |||
@@ -36,6 +36,7 @@ obj-$(CONFIG_BACKLIGHT_GENERIC) += generic_bl.o | |||
36 | obj-$(CONFIG_BACKLIGHT_GPIO) += gpio_backlight.o | 36 | obj-$(CONFIG_BACKLIGHT_GPIO) += gpio_backlight.o |
37 | obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o | 37 | obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o |
38 | obj-$(CONFIG_BACKLIGHT_HP700) += jornada720_bl.o | 38 | obj-$(CONFIG_BACKLIGHT_HP700) += jornada720_bl.o |
39 | obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO) += ipaq_micro_bl.o | ||
39 | obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_bl.o | 40 | obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_bl.o |
40 | obj-$(CONFIG_BACKLIGHT_LM3630A) += lm3630a_bl.o | 41 | obj-$(CONFIG_BACKLIGHT_LM3630A) += lm3630a_bl.o |
41 | obj-$(CONFIG_BACKLIGHT_LM3639) += lm3639_bl.o | 42 | obj-$(CONFIG_BACKLIGHT_LM3639) += lm3639_bl.o |
diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c index ec5350f2c28a..86234c31d79c 100644 --- a/drivers/video/backlight/aat2870_bl.c +++ b/drivers/video/backlight/aat2870_bl.c | |||
@@ -67,11 +67,6 @@ static inline int aat2870_bl_disable(struct aat2870_bl_driver_data *aat2870_bl) | |||
67 | return aat2870->write(aat2870, AAT2870_BL_CH_EN, 0x0); | 67 | return aat2870->write(aat2870, AAT2870_BL_CH_EN, 0x0); |
68 | } | 68 | } |
69 | 69 | ||
70 | static int aat2870_bl_get_brightness(struct backlight_device *bd) | ||
71 | { | ||
72 | return bd->props.brightness; | ||
73 | } | ||
74 | |||
75 | static int aat2870_bl_update_status(struct backlight_device *bd) | 70 | static int aat2870_bl_update_status(struct backlight_device *bd) |
76 | { | 71 | { |
77 | struct aat2870_bl_driver_data *aat2870_bl = bl_get_data(bd); | 72 | struct aat2870_bl_driver_data *aat2870_bl = bl_get_data(bd); |
@@ -120,7 +115,6 @@ static int aat2870_bl_check_fb(struct backlight_device *bd, struct fb_info *fi) | |||
120 | 115 | ||
121 | static const struct backlight_ops aat2870_bl_ops = { | 116 | static const struct backlight_ops aat2870_bl_ops = { |
122 | .options = BL_CORE_SUSPENDRESUME, | 117 | .options = BL_CORE_SUSPENDRESUME, |
123 | .get_brightness = aat2870_bl_get_brightness, | ||
124 | .update_status = aat2870_bl_update_status, | 118 | .update_status = aat2870_bl_update_status, |
125 | .check_fb = aat2870_bl_check_fb, | 119 | .check_fb = aat2870_bl_check_fb, |
126 | }; | 120 | }; |
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index d8952c4aa689..4726c8be626f 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c | |||
@@ -410,11 +410,6 @@ static int ams369fg06_set_power(struct lcd_device *ld, int power) | |||
410 | return ams369fg06_power(lcd, power); | 410 | return ams369fg06_power(lcd, power); |
411 | } | 411 | } |
412 | 412 | ||
413 | static int ams369fg06_get_brightness(struct backlight_device *bd) | ||
414 | { | ||
415 | return bd->props.brightness; | ||
416 | } | ||
417 | |||
418 | static int ams369fg06_set_brightness(struct backlight_device *bd) | 413 | static int ams369fg06_set_brightness(struct backlight_device *bd) |
419 | { | 414 | { |
420 | int ret = 0; | 415 | int ret = 0; |
@@ -443,7 +438,6 @@ static struct lcd_ops ams369fg06_lcd_ops = { | |||
443 | }; | 438 | }; |
444 | 439 | ||
445 | static const struct backlight_ops ams369fg06_backlight_ops = { | 440 | static const struct backlight_ops ams369fg06_backlight_ops = { |
446 | .get_brightness = ams369fg06_get_brightness, | ||
447 | .update_status = ams369fg06_set_brightness, | 441 | .update_status = ams369fg06_set_brightness, |
448 | }; | 442 | }; |
449 | 443 | ||
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 428089009cd5..bddc8b17a4d8 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -223,6 +223,8 @@ static ssize_t actual_brightness_show(struct device *dev, | |||
223 | mutex_lock(&bd->ops_lock); | 223 | mutex_lock(&bd->ops_lock); |
224 | if (bd->ops && bd->ops->get_brightness) | 224 | if (bd->ops && bd->ops->get_brightness) |
225 | rc = sprintf(buf, "%d\n", bd->ops->get_brightness(bd)); | 225 | rc = sprintf(buf, "%d\n", bd->ops->get_brightness(bd)); |
226 | else | ||
227 | rc = sprintf(buf, "%d\n", bd->props.brightness); | ||
226 | mutex_unlock(&bd->ops_lock); | 228 | mutex_unlock(&bd->ops_lock); |
227 | 229 | ||
228 | return rc; | 230 | return rc; |
diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index 16dd9bc625bd..fdb2f7e2c6b5 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c | |||
@@ -105,11 +105,6 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight) | |||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | static int bd6107_backlight_get_brightness(struct backlight_device *backlight) | ||
109 | { | ||
110 | return backlight->props.brightness; | ||
111 | } | ||
112 | |||
113 | static int bd6107_backlight_check_fb(struct backlight_device *backlight, | 108 | static int bd6107_backlight_check_fb(struct backlight_device *backlight, |
114 | struct fb_info *info) | 109 | struct fb_info *info) |
115 | { | 110 | { |
@@ -121,7 +116,6 @@ static int bd6107_backlight_check_fb(struct backlight_device *backlight, | |||
121 | static const struct backlight_ops bd6107_backlight_ops = { | 116 | static const struct backlight_ops bd6107_backlight_ops = { |
122 | .options = BL_CORE_SUSPENDRESUME, | 117 | .options = BL_CORE_SUSPENDRESUME, |
123 | .update_status = bd6107_backlight_update_status, | 118 | .update_status = bd6107_backlight_update_status, |
124 | .get_brightness = bd6107_backlight_get_brightness, | ||
125 | .check_fb = bd6107_backlight_check_fb, | 119 | .check_fb = bd6107_backlight_check_fb, |
126 | }; | 120 | }; |
127 | 121 | ||
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 1cea68848f1a..aaead04a2d54 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c | |||
@@ -44,11 +44,6 @@ static int gpio_backlight_update_status(struct backlight_device *bl) | |||
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | static int gpio_backlight_get_brightness(struct backlight_device *bl) | ||
48 | { | ||
49 | return bl->props.brightness; | ||
50 | } | ||
51 | |||
52 | static int gpio_backlight_check_fb(struct backlight_device *bl, | 47 | static int gpio_backlight_check_fb(struct backlight_device *bl, |
53 | struct fb_info *info) | 48 | struct fb_info *info) |
54 | { | 49 | { |
@@ -60,7 +55,6 @@ static int gpio_backlight_check_fb(struct backlight_device *bl, | |||
60 | static const struct backlight_ops gpio_backlight_ops = { | 55 | static const struct backlight_ops gpio_backlight_ops = { |
61 | .options = BL_CORE_SUSPENDRESUME, | 56 | .options = BL_CORE_SUSPENDRESUME, |
62 | .update_status = gpio_backlight_update_status, | 57 | .update_status = gpio_backlight_update_status, |
63 | .get_brightness = gpio_backlight_get_brightness, | ||
64 | .check_fb = gpio_backlight_check_fb, | 58 | .check_fb = gpio_backlight_check_fb, |
65 | }; | 59 | }; |
66 | 60 | ||
diff --git a/drivers/video/backlight/ipaq_micro_bl.c b/drivers/video/backlight/ipaq_micro_bl.c new file mode 100644 index 000000000000..347dc11d4ceb --- /dev/null +++ b/drivers/video/backlight/ipaq_micro_bl.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * iPAQ microcontroller backlight support | ||
7 | * Author : Linus Walleij <linus.walleij@linaro.org> | ||
8 | */ | ||
9 | |||
10 | #include <linux/backlight.h> | ||
11 | #include <linux/err.h> | ||
12 | #include <linux/fb.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/mfd/ipaq-micro.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | static int micro_bl_update_status(struct backlight_device *bd) | ||
19 | { | ||
20 | struct ipaq_micro *micro = dev_get_drvdata(&bd->dev); | ||
21 | int intensity = bd->props.brightness; | ||
22 | struct ipaq_micro_msg msg = { | ||
23 | .id = MSG_BACKLIGHT, | ||
24 | .tx_len = 3, | ||
25 | }; | ||
26 | |||
27 | if (bd->props.power != FB_BLANK_UNBLANK) | ||
28 | intensity = 0; | ||
29 | if (bd->props.state & (BL_CORE_FBBLANK | BL_CORE_SUSPENDED)) | ||
30 | intensity = 0; | ||
31 | |||
32 | /* | ||
33 | * Message format: | ||
34 | * Byte 0: backlight instance (usually 1) | ||
35 | * Byte 1: on/off | ||
36 | * Byte 2: intensity, 0-255 | ||
37 | */ | ||
38 | msg.tx_data[0] = 0x01; | ||
39 | msg.tx_data[1] = intensity > 0 ? 1 : 0; | ||
40 | msg.tx_data[2] = intensity; | ||
41 | return ipaq_micro_tx_msg_sync(micro, &msg); | ||
42 | } | ||
43 | |||
44 | static const struct backlight_ops micro_bl_ops = { | ||
45 | .options = BL_CORE_SUSPENDRESUME, | ||
46 | .update_status = micro_bl_update_status, | ||
47 | }; | ||
48 | |||
49 | static struct backlight_properties micro_bl_props = { | ||
50 | .type = BACKLIGHT_RAW, | ||
51 | .max_brightness = 255, | ||
52 | .power = FB_BLANK_UNBLANK, | ||
53 | .brightness = 64, | ||
54 | }; | ||
55 | |||
56 | static int micro_backlight_probe(struct platform_device *pdev) | ||
57 | { | ||
58 | struct backlight_device *bd; | ||
59 | struct ipaq_micro *micro = dev_get_drvdata(pdev->dev.parent); | ||
60 | |||
61 | bd = devm_backlight_device_register(&pdev->dev, "ipaq-micro-backlight", | ||
62 | &pdev->dev, micro, µ_bl_ops, | ||
63 | µ_bl_props); | ||
64 | if (IS_ERR(bd)) | ||
65 | return PTR_ERR(bd); | ||
66 | |||
67 | platform_set_drvdata(pdev, bd); | ||
68 | backlight_update_status(bd); | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static struct platform_driver micro_backlight_device_driver = { | ||
74 | .driver = { | ||
75 | .name = "ipaq-micro-backlight", | ||
76 | }, | ||
77 | .probe = micro_backlight_probe, | ||
78 | }; | ||
79 | module_platform_driver(micro_backlight_device_driver); | ||
80 | |||
81 | MODULE_LICENSE("GPL v2"); | ||
82 | MODULE_DESCRIPTION("driver for iPAQ Atmel micro backlight"); | ||
83 | MODULE_ALIAS("platform:ipaq-micro-backlight"); | ||
diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c index da3876c9b3ae..228bc319de19 100644 --- a/drivers/video/backlight/jornada720_lcd.c +++ b/drivers/video/backlight/jornada720_lcd.c | |||
@@ -43,37 +43,38 @@ static int jornada_lcd_get_contrast(struct lcd_device *ld) | |||
43 | 43 | ||
44 | jornada_ssp_start(); | 44 | jornada_ssp_start(); |
45 | 45 | ||
46 | if (jornada_ssp_byte(GETCONTRAST) != TXDUMMY) { | 46 | if (jornada_ssp_byte(GETCONTRAST) == TXDUMMY) { |
47 | dev_err(&ld->dev, "get contrast failed\n"); | ||
48 | jornada_ssp_end(); | ||
49 | return -ETIMEDOUT; | ||
50 | } else { | ||
51 | ret = jornada_ssp_byte(TXDUMMY); | 47 | ret = jornada_ssp_byte(TXDUMMY); |
52 | jornada_ssp_end(); | 48 | goto success; |
53 | return ret; | ||
54 | } | 49 | } |
50 | |||
51 | dev_err(&ld->dev, "failed to set contrast\n"); | ||
52 | ret = -ETIMEDOUT; | ||
53 | |||
54 | success: | ||
55 | jornada_ssp_end(); | ||
56 | return ret; | ||
55 | } | 57 | } |
56 | 58 | ||
57 | static int jornada_lcd_set_contrast(struct lcd_device *ld, int value) | 59 | static int jornada_lcd_set_contrast(struct lcd_device *ld, int value) |
58 | { | 60 | { |
59 | int ret; | 61 | int ret = 0; |
60 | 62 | ||
61 | jornada_ssp_start(); | 63 | jornada_ssp_start(); |
62 | 64 | ||
63 | /* start by sending our set contrast cmd to mcu */ | 65 | /* start by sending our set contrast cmd to mcu */ |
64 | ret = jornada_ssp_byte(SETCONTRAST); | 66 | if (jornada_ssp_byte(SETCONTRAST) == TXDUMMY) { |
65 | 67 | /* if successful push the new value */ | |
66 | /* push the new value */ | 68 | if (jornada_ssp_byte(value) == TXDUMMY) |
67 | if (jornada_ssp_byte(value) != TXDUMMY) { | 69 | goto success; |
68 | dev_err(&ld->dev, "set contrast failed\n"); | ||
69 | jornada_ssp_end(); | ||
70 | return -ETIMEDOUT; | ||
71 | } | 70 | } |
72 | 71 | ||
73 | /* if we get here we can assume everything went well */ | 72 | dev_err(&ld->dev, "failed to set contrast\n"); |
74 | jornada_ssp_end(); | 73 | ret = -ETIMEDOUT; |
75 | 74 | ||
76 | return 0; | 75 | success: |
76 | jornada_ssp_end(); | ||
77 | return ret; | ||
77 | } | 78 | } |
78 | 79 | ||
79 | static int jornada_lcd_set_power(struct lcd_device *ld, int power) | 80 | static int jornada_lcd_set_power(struct lcd_device *ld, int power) |
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index 506a6c236039..ccb44e8e4927 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c | |||
@@ -642,11 +642,6 @@ static int ld9040_get_power(struct lcd_device *ld) | |||
642 | return lcd->power; | 642 | return lcd->power; |
643 | } | 643 | } |
644 | 644 | ||
645 | static int ld9040_get_brightness(struct backlight_device *bd) | ||
646 | { | ||
647 | return bd->props.brightness; | ||
648 | } | ||
649 | |||
650 | static int ld9040_set_brightness(struct backlight_device *bd) | 645 | static int ld9040_set_brightness(struct backlight_device *bd) |
651 | { | 646 | { |
652 | int ret = 0, brightness = bd->props.brightness; | 647 | int ret = 0, brightness = bd->props.brightness; |
@@ -674,7 +669,6 @@ static struct lcd_ops ld9040_lcd_ops = { | |||
674 | }; | 669 | }; |
675 | 670 | ||
676 | static const struct backlight_ops ld9040_backlight_ops = { | 671 | static const struct backlight_ops ld9040_backlight_ops = { |
677 | .get_brightness = ld9040_get_brightness, | ||
678 | .update_status = ld9040_set_brightness, | 672 | .update_status = ld9040_set_brightness, |
679 | }; | 673 | }; |
680 | 674 | ||
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index 2ca3a040007b..dcdd5443efcf 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c | |||
@@ -274,15 +274,9 @@ static int lp855x_bl_update_status(struct backlight_device *bl) | |||
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
276 | 276 | ||
277 | static int lp855x_bl_get_brightness(struct backlight_device *bl) | ||
278 | { | ||
279 | return bl->props.brightness; | ||
280 | } | ||
281 | |||
282 | static const struct backlight_ops lp855x_bl_ops = { | 277 | static const struct backlight_ops lp855x_bl_ops = { |
283 | .options = BL_CORE_SUSPENDRESUME, | 278 | .options = BL_CORE_SUSPENDRESUME, |
284 | .update_status = lp855x_bl_update_status, | 279 | .update_status = lp855x_bl_update_status, |
285 | .get_brightness = lp855x_bl_get_brightness, | ||
286 | }; | 280 | }; |
287 | 281 | ||
288 | static int lp855x_backlight_register(struct lp855x *lp) | 282 | static int lp855x_backlight_register(struct lp855x *lp) |
diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index daba34dc46d4..d6c4f6a2d43e 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c | |||
@@ -176,15 +176,9 @@ static int lp8788_bl_update_status(struct backlight_device *bl_dev) | |||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | 178 | ||
179 | static int lp8788_bl_get_brightness(struct backlight_device *bl_dev) | ||
180 | { | ||
181 | return bl_dev->props.brightness; | ||
182 | } | ||
183 | |||
184 | static const struct backlight_ops lp8788_bl_ops = { | 179 | static const struct backlight_ops lp8788_bl_ops = { |
185 | .options = BL_CORE_SUSPENDRESUME, | 180 | .options = BL_CORE_SUSPENDRESUME, |
186 | .update_status = lp8788_bl_update_status, | 181 | .update_status = lp8788_bl_update_status, |
187 | .get_brightness = lp8788_bl_get_brightness, | ||
188 | }; | 182 | }; |
189 | 183 | ||
190 | static int lp8788_backlight_register(struct lp8788_bl *bl) | 184 | static int lp8788_backlight_register(struct lp8788_bl *bl) |
diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 1802b2d1357d..8ab7297b118a 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c | |||
@@ -70,11 +70,6 @@ static int lv5207lp_backlight_update_status(struct backlight_device *backlight) | |||
70 | return 0; | 70 | return 0; |
71 | } | 71 | } |
72 | 72 | ||
73 | static int lv5207lp_backlight_get_brightness(struct backlight_device *backlight) | ||
74 | { | ||
75 | return backlight->props.brightness; | ||
76 | } | ||
77 | |||
78 | static int lv5207lp_backlight_check_fb(struct backlight_device *backlight, | 73 | static int lv5207lp_backlight_check_fb(struct backlight_device *backlight, |
79 | struct fb_info *info) | 74 | struct fb_info *info) |
80 | { | 75 | { |
@@ -86,7 +81,6 @@ static int lv5207lp_backlight_check_fb(struct backlight_device *backlight, | |||
86 | static const struct backlight_ops lv5207lp_backlight_ops = { | 81 | static const struct backlight_ops lv5207lp_backlight_ops = { |
87 | .options = BL_CORE_SUSPENDRESUME, | 82 | .options = BL_CORE_SUSPENDRESUME, |
88 | .update_status = lv5207lp_backlight_update_status, | 83 | .update_status = lv5207lp_backlight_update_status, |
89 | .get_brightness = lv5207lp_backlight_get_brightness, | ||
90 | .check_fb = lv5207lp_backlight_check_fb, | 84 | .check_fb = lv5207lp_backlight_check_fb, |
91 | }; | 85 | }; |
92 | 86 | ||
diff --git a/drivers/video/backlight/pandora_bl.c b/drivers/video/backlight/pandora_bl.c index 2098c5d6efb9..2e3f82063c03 100644 --- a/drivers/video/backlight/pandora_bl.c +++ b/drivers/video/backlight/pandora_bl.c | |||
@@ -100,15 +100,9 @@ done: | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | static int pandora_backlight_get_brightness(struct backlight_device *bl) | ||
104 | { | ||
105 | return bl->props.brightness; | ||
106 | } | ||
107 | |||
108 | static const struct backlight_ops pandora_backlight_ops = { | 103 | static const struct backlight_ops pandora_backlight_ops = { |
109 | .options = BL_CORE_SUSPENDRESUME, | 104 | .options = BL_CORE_SUSPENDRESUME, |
110 | .update_status = pandora_backlight_update_status, | 105 | .update_status = pandora_backlight_update_status, |
111 | .get_brightness = pandora_backlight_get_brightness, | ||
112 | }; | 106 | }; |
113 | 107 | ||
114 | static int pandora_backlight_probe(struct platform_device *pdev) | 108 | static int pandora_backlight_probe(struct platform_device *pdev) |
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 38ca88bc5c3e..d7a3d13e72ec 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -115,11 +115,6 @@ static int pwm_backlight_update_status(struct backlight_device *bl) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static int pwm_backlight_get_brightness(struct backlight_device *bl) | ||
119 | { | ||
120 | return bl->props.brightness; | ||
121 | } | ||
122 | |||
123 | static int pwm_backlight_check_fb(struct backlight_device *bl, | 118 | static int pwm_backlight_check_fb(struct backlight_device *bl, |
124 | struct fb_info *info) | 119 | struct fb_info *info) |
125 | { | 120 | { |
@@ -130,7 +125,6 @@ static int pwm_backlight_check_fb(struct backlight_device *bl, | |||
130 | 125 | ||
131 | static const struct backlight_ops pwm_backlight_ops = { | 126 | static const struct backlight_ops pwm_backlight_ops = { |
132 | .update_status = pwm_backlight_update_status, | 127 | .update_status = pwm_backlight_update_status, |
133 | .get_brightness = pwm_backlight_get_brightness, | ||
134 | .check_fb = pwm_backlight_check_fb, | 128 | .check_fb = pwm_backlight_check_fb, |
135 | }; | 129 | }; |
136 | 130 | ||
@@ -245,13 +239,10 @@ static int pwm_backlight_probe(struct platform_device *pdev) | |||
245 | pb->dev = &pdev->dev; | 239 | pb->dev = &pdev->dev; |
246 | pb->enabled = false; | 240 | pb->enabled = false; |
247 | 241 | ||
248 | pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable"); | 242 | pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable"); |
249 | if (IS_ERR(pb->enable_gpio)) { | 243 | if (IS_ERR(pb->enable_gpio)) { |
250 | ret = PTR_ERR(pb->enable_gpio); | 244 | ret = PTR_ERR(pb->enable_gpio); |
251 | if (ret == -ENOENT) | 245 | goto err_alloc; |
252 | pb->enable_gpio = NULL; | ||
253 | else | ||
254 | goto err_alloc; | ||
255 | } | 246 | } |
256 | 247 | ||
257 | /* | 248 | /* |
diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index 2d6d48196c6d..f3a65c8940ed 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c | |||
@@ -597,11 +597,6 @@ static int s6e63m0_get_power(struct lcd_device *ld) | |||
597 | return lcd->power; | 597 | return lcd->power; |
598 | } | 598 | } |
599 | 599 | ||
600 | static int s6e63m0_get_brightness(struct backlight_device *bd) | ||
601 | { | ||
602 | return bd->props.brightness; | ||
603 | } | ||
604 | |||
605 | static int s6e63m0_set_brightness(struct backlight_device *bd) | 600 | static int s6e63m0_set_brightness(struct backlight_device *bd) |
606 | { | 601 | { |
607 | int ret = 0, brightness = bd->props.brightness; | 602 | int ret = 0, brightness = bd->props.brightness; |
@@ -629,7 +624,6 @@ static struct lcd_ops s6e63m0_lcd_ops = { | |||
629 | }; | 624 | }; |
630 | 625 | ||
631 | static const struct backlight_ops s6e63m0_backlight_ops = { | 626 | static const struct backlight_ops s6e63m0_backlight_ops = { |
632 | .get_brightness = s6e63m0_get_brightness, | ||
633 | .update_status = s6e63m0_set_brightness, | 627 | .update_status = s6e63m0_set_brightness, |
634 | }; | 628 | }; |
635 | 629 | ||
diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c index 595dcf561020..2e04d93aa0ef 100644 --- a/drivers/video/backlight/tps65217_bl.c +++ b/drivers/video/backlight/tps65217_bl.c | |||
@@ -109,15 +109,9 @@ static int tps65217_bl_update_status(struct backlight_device *bl) | |||
109 | return rc; | 109 | return rc; |
110 | } | 110 | } |
111 | 111 | ||
112 | static int tps65217_bl_get_brightness(struct backlight_device *bl) | ||
113 | { | ||
114 | return bl->props.brightness; | ||
115 | } | ||
116 | |||
117 | static const struct backlight_ops tps65217_bl_ops = { | 112 | static const struct backlight_ops tps65217_bl_ops = { |
118 | .options = BL_CORE_SUSPENDRESUME, | 113 | .options = BL_CORE_SUSPENDRESUME, |
119 | .update_status = tps65217_bl_update_status, | 114 | .update_status = tps65217_bl_update_status, |
120 | .get_brightness = tps65217_bl_get_brightness | ||
121 | }; | 115 | }; |
122 | 116 | ||
123 | static int tps65217_bl_hw_init(struct tps65217_bl *tps65217_bl, | 117 | static int tps65217_bl_hw_init(struct tps65217_bl *tps65217_bl, |
diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index 52108be69e77..ff6070170d01 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c | |||
@@ -1802,13 +1802,7 @@ static int aty128_bl_update_status(struct backlight_device *bd) | |||
1802 | return 0; | 1802 | return 0; |
1803 | } | 1803 | } |
1804 | 1804 | ||
1805 | static int aty128_bl_get_brightness(struct backlight_device *bd) | ||
1806 | { | ||
1807 | return bd->props.brightness; | ||
1808 | } | ||
1809 | |||
1810 | static const struct backlight_ops aty128_bl_data = { | 1805 | static const struct backlight_ops aty128_bl_data = { |
1811 | .get_brightness = aty128_bl_get_brightness, | ||
1812 | .update_status = aty128_bl_update_status, | 1806 | .update_status = aty128_bl_update_status, |
1813 | }; | 1807 | }; |
1814 | 1808 | ||
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index c3d0074a32db..37ec09b3fffd 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c | |||
@@ -2211,13 +2211,7 @@ static int aty_bl_update_status(struct backlight_device *bd) | |||
2211 | return 0; | 2211 | return 0; |
2212 | } | 2212 | } |
2213 | 2213 | ||
2214 | static int aty_bl_get_brightness(struct backlight_device *bd) | ||
2215 | { | ||
2216 | return bd->props.brightness; | ||
2217 | } | ||
2218 | |||
2219 | static const struct backlight_ops aty_bl_data = { | 2214 | static const struct backlight_ops aty_bl_data = { |
2220 | .get_brightness = aty_bl_get_brightness, | ||
2221 | .update_status = aty_bl_update_status, | 2215 | .update_status = aty_bl_update_status, |
2222 | }; | 2216 | }; |
2223 | 2217 | ||
diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c index db572df7e1ef..301d6d6aeead 100644 --- a/drivers/video/fbdev/aty/radeon_backlight.c +++ b/drivers/video/fbdev/aty/radeon_backlight.c | |||
@@ -123,13 +123,7 @@ static int radeon_bl_update_status(struct backlight_device *bd) | |||
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | static int radeon_bl_get_brightness(struct backlight_device *bd) | ||
127 | { | ||
128 | return bd->props.brightness; | ||
129 | } | ||
130 | |||
131 | static const struct backlight_ops radeon_bl_data = { | 126 | static const struct backlight_ops radeon_bl_data = { |
132 | .get_brightness = radeon_bl_get_brightness, | ||
133 | .update_status = radeon_bl_update_status, | 127 | .update_status = radeon_bl_update_status, |
134 | }; | 128 | }; |
135 | 129 | ||
diff --git a/drivers/video/fbdev/exynos/s6e8ax0.c b/drivers/video/fbdev/exynos/s6e8ax0.c index 29e70ed3f154..95873f26e39c 100644 --- a/drivers/video/fbdev/exynos/s6e8ax0.c +++ b/drivers/video/fbdev/exynos/s6e8ax0.c | |||
@@ -704,11 +704,6 @@ static int s6e8ax0_get_power(struct lcd_device *ld) | |||
704 | return lcd->power; | 704 | return lcd->power; |
705 | } | 705 | } |
706 | 706 | ||
707 | static int s6e8ax0_get_brightness(struct backlight_device *bd) | ||
708 | { | ||
709 | return bd->props.brightness; | ||
710 | } | ||
711 | |||
712 | static int s6e8ax0_set_brightness(struct backlight_device *bd) | 707 | static int s6e8ax0_set_brightness(struct backlight_device *bd) |
713 | { | 708 | { |
714 | int ret = 0, brightness = bd->props.brightness; | 709 | int ret = 0, brightness = bd->props.brightness; |
@@ -736,7 +731,6 @@ static struct lcd_ops s6e8ax0_lcd_ops = { | |||
736 | }; | 731 | }; |
737 | 732 | ||
738 | static const struct backlight_ops s6e8ax0_backlight_ops = { | 733 | static const struct backlight_ops s6e8ax0_backlight_ops = { |
739 | .get_brightness = s6e8ax0_get_brightness, | ||
740 | .update_status = s6e8ax0_set_brightness, | 734 | .update_status = s6e8ax0_set_brightness, |
741 | }; | 735 | }; |
742 | 736 | ||
diff --git a/drivers/video/fbdev/nvidia/nv_backlight.c b/drivers/video/fbdev/nvidia/nv_backlight.c index 8471008aa6ff..5c151b2ea683 100644 --- a/drivers/video/fbdev/nvidia/nv_backlight.c +++ b/drivers/video/fbdev/nvidia/nv_backlight.c | |||
@@ -82,13 +82,7 @@ static int nvidia_bl_update_status(struct backlight_device *bd) | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | static int nvidia_bl_get_brightness(struct backlight_device *bd) | ||
86 | { | ||
87 | return bd->props.brightness; | ||
88 | } | ||
89 | |||
90 | static const struct backlight_ops nvidia_bl_ops = { | 85 | static const struct backlight_ops nvidia_bl_ops = { |
91 | .get_brightness = nvidia_bl_get_brightness, | ||
92 | .update_status = nvidia_bl_update_status, | 86 | .update_status = nvidia_bl_update_status, |
93 | }; | 87 | }; |
94 | 88 | ||
diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c index 8a8d7f060784..be73727c7227 100644 --- a/drivers/video/fbdev/riva/fbdev.c +++ b/drivers/video/fbdev/riva/fbdev.c | |||
@@ -326,13 +326,7 @@ static int riva_bl_update_status(struct backlight_device *bd) | |||
326 | return 0; | 326 | return 0; |
327 | } | 327 | } |
328 | 328 | ||
329 | static int riva_bl_get_brightness(struct backlight_device *bd) | ||
330 | { | ||
331 | return bd->props.brightness; | ||
332 | } | ||
333 | |||
334 | static const struct backlight_ops riva_bl_ops = { | 329 | static const struct backlight_ops riva_bl_ops = { |
335 | .get_brightness = riva_bl_get_brightness, | ||
336 | .update_status = riva_bl_update_status, | 330 | .update_status = riva_bl_update_status, |
337 | }; | 331 | }; |
338 | 332 | ||