Commit df7cb187 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'backlight-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
 "Core Framework:
   - Report correct error status to user

  Fix-ups:
   - Move Backlight headers out of I2C (adp8860, adp8870)"

* tag 'backlight-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  video: adp8870: move header file out of I2C realm
  backlight: adp8860: Move header file out of I2C realm
  backlight: Report error on failure
parents 6972b007 056d6ff4
...@@ -1995,7 +1995,7 @@ static struct adp5588_gpio_platform_data adp5588_gpio_data = { ...@@ -1995,7 +1995,7 @@ static struct adp5588_gpio_platform_data adp5588_gpio_data = {
#endif #endif
#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870) #if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870)
#include <linux/i2c/adp8870.h> #include <linux/platform_data/adp8870.h>
static struct led_info adp8870_leds[] = { static struct led_info adp8870_leds[] = {
{ {
.name = "adp8870-led7", .name = "adp8870-led7",
...@@ -2047,7 +2047,7 @@ static struct adp8870_backlight_platform_data adp8870_pdata = { ...@@ -2047,7 +2047,7 @@ static struct adp8870_backlight_platform_data adp8870_pdata = {
#endif #endif
#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860) #if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860)
#include <linux/i2c/adp8860.h> #include <linux/platform_data/adp8860.h>
static struct led_info adp8860_leds[] = { static struct led_info adp8860_leds[] = {
{ {
.name = "adp8860-led7", .name = "adp8860-led7",
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/i2c/adp8860.h> #include <linux/platform_data/adp8860.h>
#define ADP8860_EXT_FEATURES #define ADP8860_EXT_FEATURES
#define ADP8860_USE_LEDS #define ADP8860_USE_LEDS
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c/adp8870.h> #include <linux/platform_data/adp8870.h>
#define ADP8870_EXT_FEATURES #define ADP8870_EXT_FEATURES
#define ADP8870_USE_LEDS #define ADP8870_USE_LEDS
......
...@@ -134,7 +134,7 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr, ...@@ -134,7 +134,7 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr,
{ {
int rc; int rc;
struct backlight_device *bd = to_backlight_device(dev); struct backlight_device *bd = to_backlight_device(dev);
unsigned long power; unsigned long power, old_power;
rc = kstrtoul(buf, 0, &power); rc = kstrtoul(buf, 0, &power);
if (rc) if (rc)
...@@ -145,10 +145,16 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr, ...@@ -145,10 +145,16 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr,
if (bd->ops) { if (bd->ops) {
pr_debug("set power to %lu\n", power); pr_debug("set power to %lu\n", power);
if (bd->props.power != power) { if (bd->props.power != power) {
old_power = bd->props.power;
bd->props.power = power; bd->props.power = power;
backlight_update_status(bd); rc = backlight_update_status(bd);
if (rc)
bd->props.power = old_power;
else
rc = count;
} else {
rc = count;
} }
rc = count;
} }
mutex_unlock(&bd->ops_lock); mutex_unlock(&bd->ops_lock);
...@@ -176,8 +182,7 @@ int backlight_device_set_brightness(struct backlight_device *bd, ...@@ -176,8 +182,7 @@ int backlight_device_set_brightness(struct backlight_device *bd,
else { else {
pr_debug("set brightness to %lu\n", brightness); pr_debug("set brightness to %lu\n", brightness);
bd->props.brightness = brightness; bd->props.brightness = brightness;
backlight_update_status(bd); rc = backlight_update_status(bd);
rc = 0;
} }
} }
mutex_unlock(&bd->ops_lock); mutex_unlock(&bd->ops_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment