aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c4
-rw-r--r--drivers/video/backlight/adp8860_bl.c2
-rw-r--r--drivers/video/backlight/adp8870_bl.c2
-rw-r--r--drivers/video/backlight/backlight.c15
-rw-r--r--include/linux/platform_data/adp8860.h (renamed from include/linux/i2c/adp8860.h)0
-rw-r--r--include/linux/platform_data/adp8870.h (renamed from include/linux/i2c/adp8870.h)0
6 files changed, 14 insertions, 9 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 24985e658c19..7528148dc492 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -1995,7 +1995,7 @@ static struct adp5588_gpio_platform_data adp5588_gpio_data = {
1995#endif 1995#endif
1996 1996
1997#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870) 1997#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870)
1998#include <linux/i2c/adp8870.h> 1998#include <linux/platform_data/adp8870.h>
1999static struct led_info adp8870_leds[] = { 1999static struct led_info adp8870_leds[] = {
2000 { 2000 {
2001 .name = "adp8870-led7", 2001 .name = "adp8870-led7",
@@ -2047,7 +2047,7 @@ static struct adp8870_backlight_platform_data adp8870_pdata = {
2047#endif 2047#endif
2048 2048
2049#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860) 2049#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860)
2050#include <linux/i2c/adp8860.h> 2050#include <linux/platform_data/adp8860.h>
2051static struct led_info adp8860_leds[] = { 2051static struct led_info adp8860_leds[] = {
2052 { 2052 {
2053 .name = "adp8860-led7", 2053 .name = "adp8860-led7",
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index 510e559c060e..e7315bf14d60 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -18,7 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20 20
21#include <linux/i2c/adp8860.h> 21#include <linux/platform_data/adp8860.h>
22#define ADP8860_EXT_FEATURES 22#define ADP8860_EXT_FEATURES
23#define ADP8860_USE_LEDS 23#define ADP8860_USE_LEDS
24 24
diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c
index 21acac90fd77..058d1def2d1f 100644
--- a/drivers/video/backlight/adp8870_bl.c
+++ b/drivers/video/backlight/adp8870_bl.c
@@ -18,7 +18,7 @@
18#include <linux/workqueue.h> 18#include <linux/workqueue.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20 20
21#include <linux/i2c/adp8870.h> 21#include <linux/platform_data/adp8870.h>
22#define ADP8870_EXT_FEATURES 22#define ADP8870_EXT_FEATURES
23#define ADP8870_USE_LEDS 23#define ADP8870_USE_LEDS
24 24
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 288318ad21dd..8049e7656daa 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -134,7 +134,7 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr,
134{ 134{
135 int rc; 135 int rc;
136 struct backlight_device *bd = to_backlight_device(dev); 136 struct backlight_device *bd = to_backlight_device(dev);
137 unsigned long power; 137 unsigned long power, old_power;
138 138
139 rc = kstrtoul(buf, 0, &power); 139 rc = kstrtoul(buf, 0, &power);
140 if (rc) 140 if (rc)
@@ -145,10 +145,16 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr,
145 if (bd->ops) { 145 if (bd->ops) {
146 pr_debug("set power to %lu\n", power); 146 pr_debug("set power to %lu\n", power);
147 if (bd->props.power != power) { 147 if (bd->props.power != power) {
148 old_power = bd->props.power;
148 bd->props.power = power; 149 bd->props.power = power;
149 backlight_update_status(bd); 150 rc = backlight_update_status(bd);
151 if (rc)
152 bd->props.power = old_power;
153 else
154 rc = count;
155 } else {
156 rc = count;
150 } 157 }
151 rc = count;
152 } 158 }
153 mutex_unlock(&bd->ops_lock); 159 mutex_unlock(&bd->ops_lock);
154 160
@@ -176,8 +182,7 @@ int backlight_device_set_brightness(struct backlight_device *bd,
176 else { 182 else {
177 pr_debug("set brightness to %lu\n", brightness); 183 pr_debug("set brightness to %lu\n", brightness);
178 bd->props.brightness = brightness; 184 bd->props.brightness = brightness;
179 backlight_update_status(bd); 185 rc = backlight_update_status(bd);
180 rc = 0;
181 } 186 }
182 } 187 }
183 mutex_unlock(&bd->ops_lock); 188 mutex_unlock(&bd->ops_lock);
diff --git a/include/linux/i2c/adp8860.h b/include/linux/platform_data/adp8860.h
index 0b4d39855c91..0b4d39855c91 100644
--- a/include/linux/i2c/adp8860.h
+++ b/include/linux/platform_data/adp8860.h
diff --git a/include/linux/i2c/adp8870.h b/include/linux/platform_data/adp8870.h
index 624dceccbd5b..624dceccbd5b 100644
--- a/include/linux/i2c/adp8870.h
+++ b/include/linux/platform_data/adp8870.h