linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Bart Tanghe <bart.tanghe@thomasmore.be>
Cc: matt.porter@linaro.org, linux-kernel@vger.kernel.org,
	linux-pwm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org
Subject: Re: [PATCH v7]pwm: add BCM2835 PWM driver
Date: Tue, 14 Oct 2014 15:54:47 +0200	[thread overview]
Message-ID: <20141014135445.GA26015@ulmo> (raw)
In-Reply-To: <1412763272-24269-1-git-send-email-bart.tanghe@thomasmore.be>

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

On Wed, Oct 08, 2014 at 12:14:32PM +0200, Bart Tanghe wrote:
[...]
> diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c
[...]
> +static void bcm2835_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
> +{
> +	struct bcm2835_pwm *pc = to_bcm2835_pwm(chip);
> +	u32 value;
> +
> +	value = readl(pc->base);
> +	value &= (~DEFAULT_PWM_MODE << (PWM_CONTROL_STRIDE * pwm->hwpwm));

While applying I noticed this oddity. Is this meant to be:

	value &= ~(DEFAULT_PWM_MODE << (PWM_CONTROL_STRIDE * pwm->hwpwm));

? That would match what's in bcm2835_pwm_request(). If so, what's the
difference between DEFAULT_PWM_MODE and PWM_CONTROL_MASK? Is the value
of a channel's field 0xff or 0x00 in the default mode?

The above indicates that it would be 0x00, in which case it might be
better to just do...

	value &= ~(PWM_CONTROL_MASK << (PWM_CONTROL_STRIDE * pwm->hwpwm));

... and get rid of DEFAULT_PWM_MODE.

No need to respin, I can fix this up when applying. Just let me know if
that's actually the right thing to do.

Thierry

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

  parent reply	other threads:[~2014-10-14 13:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 10:14 [PATCH v7]pwm: add BCM2835 PWM driver Bart Tanghe
2014-10-08 12:19 ` Thierry Reding
2014-10-08 14:02   ` Bart Tanghe
2014-10-08 16:30 ` Stephen Warren
2014-10-14 13:54 ` Thierry Reding [this message]
2014-10-15 10:33   ` Bart Tanghe

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=20141014135445.GA26015@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=bart.tanghe@thomasmore.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=matt.porter@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).