[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130108131548.GA28676@avionic-0098.adnet.avionic-design.de>
Date: Tue, 8 Jan 2013 14:15:48 +0100
From: Thierry Reding <thierry.reding@...onic-design.de>
To: Boris BREZILLON <linux-arm@...rkiz.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
Nicolas Ferre <nicolas.ferre@...el.com>,
Andrew Victor <linux@...im.org.za>,
Russell King <linux@....linux.org.uk>,
linux-kernel@...r.kernel.org,
Haavard Skinnemoen <hskinnemoen@...il.com>,
Hans-Christian Egtvedt <egtvedt@...fundet.no>
Subject: Re: [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
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists