[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181211151609.360457680@linuxfoundation.org>
Date: Tue, 11 Dec 2018 16:41:01 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Markus Hofstaetter <markus.hofstaetter@....ac.at>,
Jacek Anaszewski <j.anaszewski@...sung.com>,
Krzysztof Kozlowski <krzk@...nel.org>
Subject: [PATCH 4.4 42/91] leds: call led_pwm_set() in leds-pwm to enforce default LED_OFF
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Markus Hofstaetter <markus.hofstaetter@....ac.at>
commit f16703360da7731a057df2ffa902306819c22398 upstream.
Some PWMs are disabled by default or the default pin setting
does not match the LED_OFF state (e.g., active-low leds).
Hence, the driver may end up reporting 0 brightness, but
the leds are actually on using full brightness, because
it never enforces its default configuration.
So enforce it by calling led_pwm_set() after successfully
registering the device.
Tested on a Phytec phyFLEX i.MX6Q board based on kernel
v3.19.5.
Signed-off-by: Markus Hofstaetter <markus.hofstaetter@....ac.at>
Tested-by: Markus Hofstaetter <markus.hofstaetter@....ac.at>
Signed-off-by: Jacek Anaszewski <j.anaszewski@...sung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/leds/leds-pwm.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -132,6 +132,7 @@ static int led_pwm_add(struct device *de
ret = led_classdev_register(dev, &led_data->cdev);
if (ret == 0) {
priv->num_leds++;
+ led_pwm_set(&led_data->cdev, led_data->cdev.brightness);
} else {
dev_err(dev, "failed to register PWM led for %s: %d\n",
led->name, ret);
Powered by blists - more mailing lists