[PATCH 3/4] leds: leds-pwm: set inversed polarty on pwm if led is active_low

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Boris BREZILLON <linux-arm@xxxxxxxxxxx>

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 71aee2c..d533403 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -142,6 +142,9 @@ static int led_pwm_probe(struct platform_device *pdev)
 			led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
 
 			led_pwm_set(&led_dat->cdev, led_dat->cdev.brightness);
+			if (led_dat->active_low)
+				pwm_set_polarity(led_dat->pwm, PWM_POLARITY_INVERSED);
+
 
 			ret = led_classdev_register(&pdev->dev, &led_dat->cdev);
 			if (ret < 0)
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux