diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-04 14:40:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-04 14:40:40 -0400 |
commit | 670c039deeffb5c0a3a900de53b95dba781aaf89 (patch) | |
tree | 2a145c07e601b85956048d030b43dda745c596d0 | |
parent | 8bd8fd0a29bfd5ad8e1976edd8c4c40cdb39aa4f (diff) | |
parent | 13d20b3b618adc43168b034792eec57063b5ec6f (diff) |
Merge tag 'backlight-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones:
- Stop using LP855X Platform Data to control regulators
- Move PWM8941 WLED driver into Backlight
- Remove invalid use of IS_ERR_VALUE() macro
- Remove duplicate check for NULL data before unregistering
- Export I2C Device ID structure
* tag 'backlight-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
backlight: tosa: Export I2C module alias information
backlight: lp8788_bl: Delete a check before backlight_device_unregister()
backlight: sky81452: Remove unneeded use of IS_ERR_VALUE() macro
backlight: pm8941-wled: Move PM8941 WLED driver to backlight
backlight: lp855x: Use private data for regulator control
-rw-r--r-- | Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt (renamed from Documentation/devicetree/bindings/leds/leds-pm8941-wled.txt) | 5 | ||||
-rw-r--r-- | drivers/leds/Kconfig | 8 | ||||
-rw-r--r-- | drivers/leds/Makefile | 1 | ||||
-rw-r--r-- | drivers/video/backlight/Kconfig | 7 | ||||
-rw-r--r-- | drivers/video/backlight/Makefile | 1 | ||||
-rw-r--r-- | drivers/video/backlight/lp855x_bl.c | 23 | ||||
-rw-r--r-- | drivers/video/backlight/lp8788_bl.c | 3 | ||||
-rw-r--r-- | drivers/video/backlight/pm8941-wled.c (renamed from drivers/leds/leds-pm8941-wled.c) | 60 | ||||
-rw-r--r-- | drivers/video/backlight/sky81452-backlight.c | 26 | ||||
-rw-r--r-- | drivers/video/backlight/tosa_bl.c | 1 | ||||
-rw-r--r-- | include/linux/platform_data/lp855x.h | 2 |
11 files changed, 62 insertions, 75 deletions
diff --git a/Documentation/devicetree/bindings/leds/leds-pm8941-wled.txt b/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt index a85a964d61f5..424f8444a6cd 100644 --- a/Documentation/devicetree/bindings/leds/leds-pm8941-wled.txt +++ b/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt | |||
@@ -5,10 +5,7 @@ Required properties: | |||
5 | - reg: slave address | 5 | - reg: slave address |
6 | 6 | ||
7 | Optional properties: | 7 | Optional properties: |
8 | - label: The label for this led | 8 | - label: The name of the backlight device |
9 | See Documentation/devicetree/bindings/leds/common.txt | ||
10 | - linux,default-trigger: Default trigger assigned to the LED | ||
11 | See Documentation/devicetree/bindings/leds/common.txt | ||
12 | - qcom,cs-out: bool; enable current sink output | 9 | - qcom,cs-out: bool; enable current sink output |
13 | - qcom,cabc: bool; enable content adaptive backlight control | 10 | - qcom,cabc: bool; enable content adaptive backlight control |
14 | - qcom,ext-gen: bool; use externally generated modulator signal to dim | 11 | - qcom,ext-gen: bool; use externally generated modulator signal to dim |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index bea24bd4d519..70f4255ff291 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -594,14 +594,6 @@ config LEDS_VERSATILE | |||
594 | This option enabled support for the LEDs on the ARM Versatile | 594 | This option enabled support for the LEDs on the ARM Versatile |
595 | and RealView boards. Say Y to enabled these. | 595 | and RealView boards. Say Y to enabled these. |
596 | 596 | ||
597 | config LEDS_PM8941_WLED | ||
598 | tristate "LED support for the Qualcomm PM8941 WLED block" | ||
599 | depends on LEDS_CLASS | ||
600 | select REGMAP | ||
601 | help | ||
602 | This option enables support for the 'White' LED block | ||
603 | on Qualcomm PM8941 PMICs. | ||
604 | |||
605 | comment "LED Triggers" | 597 | comment "LED Triggers" |
606 | source "drivers/leds/trigger/Kconfig" | 598 | source "drivers/leds/trigger/Kconfig" |
607 | 599 | ||
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 6a943d16ecab..b503f92dc2c4 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -63,7 +63,6 @@ obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o | |||
63 | obj-$(CONFIG_LEDS_SYSCON) += leds-syscon.o | 63 | obj-$(CONFIG_LEDS_SYSCON) += leds-syscon.o |
64 | obj-$(CONFIG_LEDS_VERSATILE) += leds-versatile.o | 64 | obj-$(CONFIG_LEDS_VERSATILE) += leds-versatile.o |
65 | obj-$(CONFIG_LEDS_MENF21BMC) += leds-menf21bmc.o | 65 | obj-$(CONFIG_LEDS_MENF21BMC) += leds-menf21bmc.o |
66 | obj-$(CONFIG_LEDS_PM8941_WLED) += leds-pm8941-wled.o | ||
67 | obj-$(CONFIG_LEDS_KTD2692) += leds-ktd2692.o | 66 | obj-$(CONFIG_LEDS_KTD2692) += leds-ktd2692.o |
68 | obj-$(CONFIG_LEDS_POWERNV) += leds-powernv.o | 67 | obj-$(CONFIG_LEDS_POWERNV) += leds-powernv.o |
69 | 68 | ||
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 0505b796d743..5ffa4b4e26c0 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig | |||
@@ -299,6 +299,13 @@ config BACKLIGHT_TOSA | |||
299 | If you have an Sharp SL-6000 Zaurus say Y to enable a driver | 299 | If you have an Sharp SL-6000 Zaurus say Y to enable a driver |
300 | for its backlight | 300 | for its backlight |
301 | 301 | ||
302 | config BACKLIGHT_PM8941_WLED | ||
303 | tristate "Qualcomm PM8941 WLED Driver" | ||
304 | select REGMAP | ||
305 | help | ||
306 | If you have the Qualcomm PM8941, say Y to enable a driver for the | ||
307 | WLED block. | ||
308 | |||
302 | config BACKLIGHT_SAHARA | 309 | config BACKLIGHT_SAHARA |
303 | tristate "Tabletkiosk Sahara Touch-iT Backlight Driver" | 310 | tristate "Tabletkiosk Sahara Touch-iT Backlight Driver" |
304 | depends on X86 | 311 | depends on X86 |
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index d67073f9d421..16ec534cff30 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile | |||
@@ -48,6 +48,7 @@ obj-$(CONFIG_BACKLIGHT_OMAP1) += omap1_bl.o | |||
48 | obj-$(CONFIG_BACKLIGHT_OT200) += ot200_bl.o | 48 | obj-$(CONFIG_BACKLIGHT_OT200) += ot200_bl.o |
49 | obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o | 49 | obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o |
50 | obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o | 50 | obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o |
51 | obj-$(CONFIG_BACKLIGHT_PM8941_WLED) += pm8941-wled.o | ||
51 | obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o | 52 | obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o |
52 | obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o | 53 | obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o |
53 | obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o | 54 | obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o |
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index 88116b493f3b..f88df9ec08d0 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c | |||
@@ -73,6 +73,7 @@ struct lp855x { | |||
73 | struct device *dev; | 73 | struct device *dev; |
74 | struct lp855x_platform_data *pdata; | 74 | struct lp855x_platform_data *pdata; |
75 | struct pwm_device *pwm; | 75 | struct pwm_device *pwm; |
76 | struct regulator *supply; /* regulator for VDD input */ | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data) | 79 | static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data) |
@@ -378,13 +379,6 @@ static int lp855x_parse_dt(struct lp855x *lp) | |||
378 | pdata->rom_data = &rom[0]; | 379 | pdata->rom_data = &rom[0]; |
379 | } | 380 | } |
380 | 381 | ||
381 | pdata->supply = devm_regulator_get(dev, "power"); | ||
382 | if (IS_ERR(pdata->supply)) { | ||
383 | if (PTR_ERR(pdata->supply) == -EPROBE_DEFER) | ||
384 | return -EPROBE_DEFER; | ||
385 | pdata->supply = NULL; | ||
386 | } | ||
387 | |||
388 | lp->pdata = pdata; | 382 | lp->pdata = pdata; |
389 | 383 | ||
390 | return 0; | 384 | return 0; |
@@ -425,8 +419,15 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) | |||
425 | else | 419 | else |
426 | lp->mode = REGISTER_BASED; | 420 | lp->mode = REGISTER_BASED; |
427 | 421 | ||
428 | if (lp->pdata->supply) { | 422 | lp->supply = devm_regulator_get(lp->dev, "power"); |
429 | ret = regulator_enable(lp->pdata->supply); | 423 | if (IS_ERR(lp->supply)) { |
424 | if (PTR_ERR(lp->supply) == -EPROBE_DEFER) | ||
425 | return -EPROBE_DEFER; | ||
426 | lp->supply = NULL; | ||
427 | } | ||
428 | |||
429 | if (lp->supply) { | ||
430 | ret = regulator_enable(lp->supply); | ||
430 | if (ret < 0) { | 431 | if (ret < 0) { |
431 | dev_err(&cl->dev, "failed to enable supply: %d\n", ret); | 432 | dev_err(&cl->dev, "failed to enable supply: %d\n", ret); |
432 | return ret; | 433 | return ret; |
@@ -464,8 +465,8 @@ static int lp855x_remove(struct i2c_client *cl) | |||
464 | 465 | ||
465 | lp->bl->props.brightness = 0; | 466 | lp->bl->props.brightness = 0; |
466 | backlight_update_status(lp->bl); | 467 | backlight_update_status(lp->bl); |
467 | if (lp->pdata->supply) | 468 | if (lp->supply) |
468 | regulator_disable(lp->pdata->supply); | 469 | regulator_disable(lp->supply); |
469 | sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group); | 470 | sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group); |
470 | 471 | ||
471 | return 0; | 472 | return 0; |
diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index e418d5b1aa55..5d583d7a517b 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c | |||
@@ -221,8 +221,7 @@ static void lp8788_backlight_unregister(struct lp8788_bl *bl) | |||
221 | { | 221 | { |
222 | struct backlight_device *bl_dev = bl->bl_dev; | 222 | struct backlight_device *bl_dev = bl->bl_dev; |
223 | 223 | ||
224 | if (bl_dev) | 224 | backlight_device_unregister(bl_dev); |
225 | backlight_device_unregister(bl_dev); | ||
226 | } | 225 | } |
227 | 226 | ||
228 | static ssize_t lp8788_get_bl_ctl_mode(struct device *dev, | 227 | static ssize_t lp8788_get_bl_ctl_mode(struct device *dev, |
diff --git a/drivers/leds/leds-pm8941-wled.c b/drivers/video/backlight/pm8941-wled.c index bf64a593fbf1..c704c3236034 100644 --- a/drivers/leds/leds-pm8941-wled.c +++ b/drivers/video/backlight/pm8941-wled.c | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/leds.h> | 14 | #include <linux/backlight.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
17 | #include <linux/of_device.h> | 17 | #include <linux/of_device.h> |
@@ -76,30 +76,29 @@ struct pm8941_wled_config { | |||
76 | }; | 76 | }; |
77 | 77 | ||
78 | struct pm8941_wled { | 78 | struct pm8941_wled { |
79 | const char *name; | ||
79 | struct regmap *regmap; | 80 | struct regmap *regmap; |
80 | u16 addr; | 81 | u16 addr; |
81 | 82 | ||
82 | struct led_classdev cdev; | ||
83 | |||
84 | struct pm8941_wled_config cfg; | 83 | struct pm8941_wled_config cfg; |
85 | }; | 84 | }; |
86 | 85 | ||
87 | static int pm8941_wled_set(struct led_classdev *cdev, | 86 | static int pm8941_wled_update_status(struct backlight_device *bl) |
88 | enum led_brightness value) | ||
89 | { | 87 | { |
90 | struct pm8941_wled *wled; | 88 | struct pm8941_wled *wled = bl_get_data(bl); |
89 | u16 val = bl->props.brightness; | ||
91 | u8 ctrl = 0; | 90 | u8 ctrl = 0; |
92 | u16 val; | ||
93 | int rc; | 91 | int rc; |
94 | int i; | 92 | int i; |
95 | 93 | ||
96 | wled = container_of(cdev, struct pm8941_wled, cdev); | 94 | if (bl->props.power != FB_BLANK_UNBLANK || |
95 | bl->props.fb_blank != FB_BLANK_UNBLANK || | ||
96 | bl->props.state & BL_CORE_FBBLANK) | ||
97 | val = 0; | ||
97 | 98 | ||
98 | if (value != 0) | 99 | if (val != 0) |
99 | ctrl = PM8941_WLED_REG_MOD_EN_BIT; | 100 | ctrl = PM8941_WLED_REG_MOD_EN_BIT; |
100 | 101 | ||
101 | val = value * PM8941_WLED_REG_VAL_MAX / LED_FULL; | ||
102 | |||
103 | rc = regmap_update_bits(wled->regmap, | 102 | rc = regmap_update_bits(wled->regmap, |
104 | wled->addr + PM8941_WLED_REG_MOD_EN, | 103 | wled->addr + PM8941_WLED_REG_MOD_EN, |
105 | PM8941_WLED_REG_MOD_EN_MASK, ctrl); | 104 | PM8941_WLED_REG_MOD_EN_MASK, ctrl); |
@@ -128,16 +127,6 @@ static int pm8941_wled_set(struct led_classdev *cdev, | |||
128 | return rc; | 127 | return rc; |
129 | } | 128 | } |
130 | 129 | ||
131 | static void pm8941_wled_set_brightness(struct led_classdev *cdev, | ||
132 | enum led_brightness value) | ||
133 | { | ||
134 | if (pm8941_wled_set(cdev, value)) { | ||
135 | dev_err(cdev->dev, "Unable to set brightness\n"); | ||
136 | return; | ||
137 | } | ||
138 | cdev->brightness = value; | ||
139 | } | ||
140 | |||
141 | static int pm8941_wled_setup(struct pm8941_wled *wled) | 130 | static int pm8941_wled_setup(struct pm8941_wled *wled) |
142 | { | 131 | { |
143 | int rc; | 132 | int rc; |
@@ -336,12 +325,9 @@ static int pm8941_wled_configure(struct pm8941_wled *wled, struct device *dev) | |||
336 | } | 325 | } |
337 | wled->addr = val; | 326 | wled->addr = val; |
338 | 327 | ||
339 | rc = of_property_read_string(dev->of_node, "label", &wled->cdev.name); | 328 | rc = of_property_read_string(dev->of_node, "label", &wled->name); |
340 | if (rc) | 329 | if (rc) |
341 | wled->cdev.name = dev->of_node->name; | 330 | wled->name = dev->of_node->name; |
342 | |||
343 | wled->cdev.default_trigger = of_get_property(dev->of_node, | ||
344 | "linux,default-trigger", NULL); | ||
345 | 331 | ||
346 | *cfg = pm8941_wled_config_defaults; | 332 | *cfg = pm8941_wled_config_defaults; |
347 | for (i = 0; i < ARRAY_SIZE(u32_opts); ++i) { | 333 | for (i = 0; i < ARRAY_SIZE(u32_opts); ++i) { |
@@ -377,8 +363,14 @@ static int pm8941_wled_configure(struct pm8941_wled *wled, struct device *dev) | |||
377 | return 0; | 363 | return 0; |
378 | } | 364 | } |
379 | 365 | ||
366 | static const struct backlight_ops pm8941_wled_ops = { | ||
367 | .update_status = pm8941_wled_update_status, | ||
368 | }; | ||
369 | |||
380 | static int pm8941_wled_probe(struct platform_device *pdev) | 370 | static int pm8941_wled_probe(struct platform_device *pdev) |
381 | { | 371 | { |
372 | struct backlight_properties props; | ||
373 | struct backlight_device *bl; | ||
382 | struct pm8941_wled *wled; | 374 | struct pm8941_wled *wled; |
383 | struct regmap *regmap; | 375 | struct regmap *regmap; |
384 | int rc; | 376 | int rc; |
@@ -403,13 +395,14 @@ static int pm8941_wled_probe(struct platform_device *pdev) | |||
403 | if (rc) | 395 | if (rc) |
404 | return rc; | 396 | return rc; |
405 | 397 | ||
406 | wled->cdev.brightness_set = pm8941_wled_set_brightness; | 398 | memset(&props, 0, sizeof(struct backlight_properties)); |
407 | 399 | props.type = BACKLIGHT_RAW; | |
408 | rc = devm_led_classdev_register(&pdev->dev, &wled->cdev); | 400 | props.max_brightness = PM8941_WLED_REG_VAL_MAX; |
409 | if (rc) | 401 | bl = devm_backlight_device_register(&pdev->dev, wled->name, |
410 | return rc; | 402 | &pdev->dev, wled, |
411 | 403 | &pm8941_wled_ops, &props); | |
412 | platform_set_drvdata(pdev, wled); | 404 | if (IS_ERR(bl)) |
405 | return PTR_ERR(bl); | ||
413 | 406 | ||
414 | return 0; | 407 | return 0; |
415 | }; | 408 | }; |
@@ -432,4 +425,3 @@ module_platform_driver(pm8941_wled_driver); | |||
432 | 425 | ||
433 | MODULE_DESCRIPTION("pm8941 wled driver"); | 426 | MODULE_DESCRIPTION("pm8941 wled driver"); |
434 | MODULE_LICENSE("GPL v2"); | 427 | MODULE_LICENSE("GPL v2"); |
435 | MODULE_ALIAS("platform:pm8941-wled"); | ||
diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c index 052fa1bac03d..d414c7a3acf5 100644 --- a/drivers/video/backlight/sky81452-backlight.c +++ b/drivers/video/backlight/sky81452-backlight.c | |||
@@ -65,7 +65,7 @@ static int sky81452_bl_update_status(struct backlight_device *bd) | |||
65 | 65 | ||
66 | if (brightness > 0) { | 66 | if (brightness > 0) { |
67 | ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); | 67 | ret = regmap_write(regmap, SKY81452_REG0, brightness - 1); |
68 | if (IS_ERR_VALUE(ret)) | 68 | if (ret < 0) |
69 | return ret; | 69 | return ret; |
70 | 70 | ||
71 | return regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, | 71 | return regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, |
@@ -87,12 +87,12 @@ static ssize_t sky81452_bl_store_enable(struct device *dev, | |||
87 | int ret; | 87 | int ret; |
88 | 88 | ||
89 | ret = kstrtoul(buf, 16, &value); | 89 | ret = kstrtoul(buf, 16, &value); |
90 | if (IS_ERR_VALUE(ret)) | 90 | if (ret < 0) |
91 | return ret; | 91 | return ret; |
92 | 92 | ||
93 | ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, | 93 | ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, |
94 | value << CTZ(SKY81452_EN)); | 94 | value << CTZ(SKY81452_EN)); |
95 | if (IS_ERR_VALUE(ret)) | 95 | if (ret < 0) |
96 | return ret; | 96 | return ret; |
97 | 97 | ||
98 | return count; | 98 | return count; |
@@ -108,7 +108,7 @@ static ssize_t sky81452_bl_show_open_short(struct device *dev, | |||
108 | 108 | ||
109 | reg = !strcmp(attr->attr.name, "open") ? SKY81452_REG5 : SKY81452_REG4; | 109 | reg = !strcmp(attr->attr.name, "open") ? SKY81452_REG5 : SKY81452_REG4; |
110 | ret = regmap_read(regmap, reg, &value); | 110 | ret = regmap_read(regmap, reg, &value); |
111 | if (IS_ERR_VALUE(ret)) | 111 | if (ret < 0) |
112 | return ret; | 112 | return ret; |
113 | 113 | ||
114 | if (value & SKY81452_SHRT) { | 114 | if (value & SKY81452_SHRT) { |
@@ -136,7 +136,7 @@ static ssize_t sky81452_bl_show_fault(struct device *dev, | |||
136 | int ret; | 136 | int ret; |
137 | 137 | ||
138 | ret = regmap_read(regmap, SKY81452_REG4, &value); | 138 | ret = regmap_read(regmap, SKY81452_REG4, &value); |
139 | if (IS_ERR_VALUE(ret)) | 139 | if (ret < 0) |
140 | return ret; | 140 | return ret; |
141 | 141 | ||
142 | *buf = 0; | 142 | *buf = 0; |
@@ -196,7 +196,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt( | |||
196 | pdata->gpio_enable = of_get_gpio(np, 0); | 196 | pdata->gpio_enable = of_get_gpio(np, 0); |
197 | 197 | ||
198 | ret = of_property_count_u32_elems(np, "led-sources"); | 198 | ret = of_property_count_u32_elems(np, "led-sources"); |
199 | if (IS_ERR_VALUE(ret)) { | 199 | if (ret < 0) { |
200 | pdata->enable = SKY81452_EN >> CTZ(SKY81452_EN); | 200 | pdata->enable = SKY81452_EN >> CTZ(SKY81452_EN); |
201 | } else { | 201 | } else { |
202 | num_entry = ret; | 202 | num_entry = ret; |
@@ -205,7 +205,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt( | |||
205 | 205 | ||
206 | ret = of_property_read_u32_array(np, "led-sources", sources, | 206 | ret = of_property_read_u32_array(np, "led-sources", sources, |
207 | num_entry); | 207 | num_entry); |
208 | if (IS_ERR_VALUE(ret)) { | 208 | if (ret < 0) { |
209 | dev_err(dev, "led-sources node is invalid.\n"); | 209 | dev_err(dev, "led-sources node is invalid.\n"); |
210 | return ERR_PTR(-EINVAL); | 210 | return ERR_PTR(-EINVAL); |
211 | } | 211 | } |
@@ -218,12 +218,12 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt( | |||
218 | ret = of_property_read_u32(np, | 218 | ret = of_property_read_u32(np, |
219 | "skyworks,short-detection-threshold-volt", | 219 | "skyworks,short-detection-threshold-volt", |
220 | &pdata->short_detection_threshold); | 220 | &pdata->short_detection_threshold); |
221 | if (IS_ERR_VALUE(ret)) | 221 | if (ret < 0) |
222 | pdata->short_detection_threshold = 7; | 222 | pdata->short_detection_threshold = 7; |
223 | 223 | ||
224 | ret = of_property_read_u32(np, "skyworks,current-limit-mA", | 224 | ret = of_property_read_u32(np, "skyworks,current-limit-mA", |
225 | &pdata->boost_current_limit); | 225 | &pdata->boost_current_limit); |
226 | if (IS_ERR_VALUE(ret)) | 226 | if (ret < 0) |
227 | pdata->boost_current_limit = 2750; | 227 | pdata->boost_current_limit = 2750; |
228 | 228 | ||
229 | of_node_put(np); | 229 | of_node_put(np); |
@@ -278,14 +278,14 @@ static int sky81452_bl_probe(struct platform_device *pdev) | |||
278 | if (gpio_is_valid(pdata->gpio_enable)) { | 278 | if (gpio_is_valid(pdata->gpio_enable)) { |
279 | ret = devm_gpio_request_one(dev, pdata->gpio_enable, | 279 | ret = devm_gpio_request_one(dev, pdata->gpio_enable, |
280 | GPIOF_OUT_INIT_HIGH, "sky81452-en"); | 280 | GPIOF_OUT_INIT_HIGH, "sky81452-en"); |
281 | if (IS_ERR_VALUE(ret)) { | 281 | if (ret < 0) { |
282 | dev_err(dev, "failed to request GPIO. err=%d\n", ret); | 282 | dev_err(dev, "failed to request GPIO. err=%d\n", ret); |
283 | return ret; | 283 | return ret; |
284 | } | 284 | } |
285 | } | 285 | } |
286 | 286 | ||
287 | ret = sky81452_bl_init_device(regmap, pdata); | 287 | ret = sky81452_bl_init_device(regmap, pdata); |
288 | if (IS_ERR_VALUE(ret)) { | 288 | if (ret < 0) { |
289 | dev_err(dev, "failed to initialize. err=%d\n", ret); | 289 | dev_err(dev, "failed to initialize. err=%d\n", ret); |
290 | return ret; | 290 | return ret; |
291 | } | 291 | } |
@@ -302,8 +302,8 @@ static int sky81452_bl_probe(struct platform_device *pdev) | |||
302 | 302 | ||
303 | platform_set_drvdata(pdev, bd); | 303 | platform_set_drvdata(pdev, bd); |
304 | 304 | ||
305 | ret = sysfs_create_group(&bd->dev.kobj, &sky81452_bl_attr_group); | 305 | ret = sysfs_create_group(&bd->dev.kobj, &sky81452_bl_attr_group); |
306 | if (IS_ERR_VALUE(ret)) { | 306 | if (ret < 0) { |
307 | dev_err(dev, "failed to create attribute. err=%d\n", ret); | 307 | dev_err(dev, "failed to create attribute. err=%d\n", ret); |
308 | return ret; | 308 | return ret; |
309 | } | 309 | } |
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 3ad676558c80..83742d806391 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c | |||
@@ -158,6 +158,7 @@ static const struct i2c_device_id tosa_bl_id[] = { | |||
158 | { "tosa-bl", 0 }, | 158 | { "tosa-bl", 0 }, |
159 | { }, | 159 | { }, |
160 | }; | 160 | }; |
161 | MODULE_DEVICE_TABLE(i2c, tosa_bl_id); | ||
161 | 162 | ||
162 | static struct i2c_driver tosa_bl_driver = { | 163 | static struct i2c_driver tosa_bl_driver = { |
163 | .driver = { | 164 | .driver = { |
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index 9c7fd1efe495..1b2ba24e4e03 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h | |||
@@ -136,7 +136,6 @@ struct lp855x_rom_data { | |||
136 | Only valid when mode is PWM_BASED. | 136 | Only valid when mode is PWM_BASED. |
137 | * @size_program : total size of lp855x_rom_data | 137 | * @size_program : total size of lp855x_rom_data |
138 | * @rom_data : list of new eeprom/eprom registers | 138 | * @rom_data : list of new eeprom/eprom registers |
139 | * @supply : regulator that supplies 3V input | ||
140 | */ | 139 | */ |
141 | struct lp855x_platform_data { | 140 | struct lp855x_platform_data { |
142 | const char *name; | 141 | const char *name; |
@@ -145,7 +144,6 @@ struct lp855x_platform_data { | |||
145 | unsigned int period_ns; | 144 | unsigned int period_ns; |
146 | int size_program; | 145 | int size_program; |
147 | struct lp855x_rom_data *rom_data; | 146 | struct lp855x_rom_data *rom_data; |
148 | struct regulator *supply; | ||
149 | }; | 147 | }; |
150 | 148 | ||
151 | #endif | 149 | #endif |