diff --git a/drivers/led/led-pwm.c b/drivers/led/led-pwm.c index 419d96e..8a358dd 100644 --- a/drivers/led/led-pwm.c +++ b/drivers/led/led-pwm.c @@ -41,6 +41,9 @@ duty *= brightness; do_div(duty, max); + if (pwmled->active_low) + duty = pwmled->period - duty; + pwm_config(pwmled->pwm, duty, pwmled->period); } @@ -66,6 +69,7 @@ return ret; pwmled->period = pwm_get_period(pwmled->pwm); + pwmled->active_low = of_property_read_bool(child, "active-low"); pwmled->led.set = led_pwm_set;