mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
leds: call led_pwm_set() in leds-pwm to enforce default LED_OFF
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@ait.ac.at> Tested-by: Markus Hofstaetter <markus.hofstaetter@ait.ac.at> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
This commit is contained in:
parent
fb65ee94ee
commit
f16703360d
@ -124,6 +124,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user