All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Boris BREZILLON <linux-arm@overkiz.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Andrew Victor <linux@maxim.org.za>,
	Russell King <linux@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>
Subject: Re: [PATCH v4 RESEND] pwm: atmel: add Timer Counter Block PWM driver
Date: Tue, 8 Jan 2013 14:15:48 +0100	[thread overview]
Message-ID: <20130108131548.GA28676@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <50EC148C.7080304@overkiz.com>

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-01-08 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20  9:12 [PATCH v4 RESEND] pwm: atmel: add Timer Counter Block PWM driver Boris BREZILLON
2013-01-08  7:10 ` Thierry Reding
2013-01-08 12:43   ` Boris BREZILLON
2013-01-08 13:15     ` Thierry Reding [this message]
2013-01-08 15:21   ` Boris BREZILLON
2013-01-08 15:25     ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130108131548.GA28676@avionic-0098.adnet.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=egtvedt@samfundet.no \
    --cc=hskinnemoen@gmail.com \
    --cc=linux-arm@overkiz.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linux@maxim.org.za \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.