lkml.org 
[lkml]   [2013]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 RESEND] pwm: atmel: add Timer Counter Block PWM driver
On Tue, Jan 08, 2013 at 01:43:56PM +0100, Boris BREZILLON wrote:
> On 08/01/2013 08:10, Thierry Reding wrote:
> > On Thu, Dec 20, 2012 at 10:12:56AM +0100, Boris BREZILLON wrote:
[...]
> >> +static void atmel_tcb_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
> >> +{
> > [...]
> >> + /* If duty is 0 reverse polarity */
> >> + if (tcbpwm->duty == 0)
> >> + polarity = !polarity;
> >
> > Rather than commenting on what the code does, this should say why it
> > does so.
> >
>
> Is this an acceptable explanation ?
>
> /*
> * If duty is 0 the timer will be stopped and we have to
> * configure the output correctly on software trigger:
> * - set output to high if PWM_POLARITY_INVERSED
> * - set output to low if PWM_POLARITY_NORMAL
> *
> * This is why we're reverting polarity in this case.
> */

Yes, that should work.

Thierry
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-01-08 15:01    [W:0.119 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site