Re: [PATCH 1/2] PWM: let of_xlate handlers check args count

From: Sascha Hauer
Date: Fri Jan 24 2014 - 02:41:40 EST


On Fri, Jan 24, 2014 at 06:42:54AM +0100, Lothar Waßmann wrote:
> Hi,
>
> > Okay, this works, but there's a problem with pwm-leds.
> >
> > When the duty cycle is set to zero (when you set the brightness to zero)
> > pwm-leds decides to disable the PWM after configuring it. This causes
> > the PWM output to be driven low, causing the LED to go to maximum
> > brightness.
> >
> > So, using the inversion at PWM level doesn't work.
> >
> The problem is that the driver calls pwm_disable() when the duty cycle is 0.
> This sets the PWM output low independent from the output polarity setting.
>
> > To make this work correctly, we really need pwm-leds to do the inversion
> > rather than setting the inversion bit in hardware.
> >
> The same holds for the pwm-backlight driver.
>
> The easiest fix would be not to call pwm_disable() even for a zero duty
> cycle.

IMO that's the right thing to do anyway due to the different PWM
hardware controllers we have. I'm thinking about the following patch
for some time.

Sascha

--------------------8<--------------------------