]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 14:50:57 +0000 (15:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 14:50:57 +0000 (15:50 +0100)
added patches:
leds-tlc591xx-update-the-maximum-brightness.patch

queue-4.9/leds-tlc591xx-update-the-maximum-brightness.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/leds-tlc591xx-update-the-maximum-brightness.patch b/queue-4.9/leds-tlc591xx-update-the-maximum-brightness.patch
new file mode 100644 (file)
index 0000000..163258e
--- /dev/null
@@ -0,0 +1,56 @@
+From a2cafdfd8cf5ad8adda6c0ce44a59f46431edf02 Mon Sep 17 00:00:00 2001
+From: Jean-Jacques Hiblot <jjhiblot@ti.com>
+Date: Mon, 23 Sep 2019 12:02:50 +0200
+Subject: leds: tlc591xx: update the maximum brightness
+
+From: Jean-Jacques Hiblot <jjhiblot@ti.com>
+
+commit a2cafdfd8cf5ad8adda6c0ce44a59f46431edf02 upstream.
+
+The TLC chips actually offer 257 levels:
+- 0: led OFF
+- 1-255: Led dimmed is using a PWM. The duty cycle range from 0.4% to 99.6%
+- 256: led fully ON
+
+Fixes: e370d010a5fe ("leds: tlc591xx: Driver for the TI 8/16 Channel i2c LED driver")
+Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
+Signed-off-by: Pavel Machek <pavel@ucw.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/leds/leds-tlc591xx.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/leds/leds-tlc591xx.c
++++ b/drivers/leds/leds-tlc591xx.c
+@@ -16,6 +16,7 @@
+ #include <linux/slab.h>
+ #define TLC591XX_MAX_LEDS     16
++#define TLC591XX_MAX_BRIGHTNESS       256
+ #define TLC591XX_REG_MODE1    0x00
+ #define MODE1_RESPON_ADDR_MASK        0xF0
+@@ -115,11 +116,11 @@ tlc591xx_brightness_set(struct led_class
+       struct tlc591xx_priv *priv = led->priv;
+       int err;
+-      switch (brightness) {
++      switch ((int)brightness) {
+       case 0:
+               err = tlc591xx_set_ledout(priv, led, LEDOUT_OFF);
+               break;
+-      case LED_FULL:
++      case TLC591XX_MAX_BRIGHTNESS:
+               err = tlc591xx_set_ledout(priv, led, LEDOUT_ON);
+               break;
+       default:
+@@ -160,7 +161,7 @@ tlc591xx_configure(struct device *dev,
+               led->priv = priv;
+               led->led_no = i;
+               led->ldev.brightness_set_blocking = tlc591xx_brightness_set;
+-              led->ldev.max_brightness = LED_FULL;
++              led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS;
+               err = led_classdev_register(dev, &led->ldev);
+               if (err < 0) {
+                       dev_err(dev, "couldn't register LED %s\n",
index 794c7e0358f1140b7f7a24100f8b3606a5a29dae..839edad6e0269ae78104c75145efba27ad4a8318 100644 (file)
@@ -1,3 +1,4 @@
 xfs-sanity-check-flags-of-q_xquotarm-call.patch
 powerpc-archrandom-fix-arch_get_random_seed_int.patch
 mt7601u-fix-bbp-version-check-in-mt7601u_wait_bbp_ready.patch
+leds-tlc591xx-update-the-maximum-brightness.patch