From: Thierry Reding <thierry.reding@gmail.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Bart Tanghe <bart.tanghe@thomasmore.be>,
matt.porter@linaro.org, linux-kernel@vger.kernel.org,
linux-pwm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org
Subject: Re: [resend rfc v5]pwm: add BCM2835 PWM driver
Date: Tue, 7 Oct 2014 10:28:17 +0200 [thread overview]
Message-ID: <20141007082816.GC24254@ulmo> (raw)
In-Reply-To: <54335F80.9050005@wwwdotorg.org>
[-- Attachment #1: Type: text/plain, Size: 1655 bytes --]
On Mon, Oct 06, 2014 at 08:35:28PM -0700, Stephen Warren wrote:
> On 10/02/2014 04:41 AM, Bart Tanghe wrote:
> > Add pwm driver for Broadcom BCM2835 processor (Raspberry Pi)
> >
> > Signed-off-by: Bart Tanghe <bart.tanghe@thomasmore.be>
> > ---
> > Changes in v5:
>
> By v5, I would drop "rfc" from the email subject.
And resend as well. Use resend only if you're resending without having
made any changes.
> > diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c
>
> > +static int bcm2835_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
> > +{
> > + struct bcm2835_pwm *pc = to_bcm2835_pwm(chip);
> > + u32 value;
> > +
> > + value = readl(pc->base);
> > + value &= ~(PWM_CONTROL_MASK << PWM_CONTROL_STRIDE * pwm->pwm);
> > + value |= (PWM_MODE << (PWM_CONTROL_STRIDE * pwm->pwm));
> > + writel(value, pc->base);
> > + return 0;
> > +}
> > +
> > +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 &= ~(PWM_CONTROL_MASK << PWM_CONTROL_STRIDE * pwm->pwm);
> > + value &= (~DEFAULT << (PWM_CONTROL_STRIDE * pwm->pwm));
>
> What is this second mask operation intended to do? The first mask
> operation already clears all the control bits, so clearing them again
> doesn't seem useful.
I suspend that you'll also want to use pwm->hwpwm instead of pwm->pwm.
pwm->hwpwm is the index of the PWM for the chip, whereas pwm->pwm is a
global index so the above breaks if another driver registered a PWM chip
before this driver.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2014-10-07 8:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-02 11:41 [resend rfc v5]pwm: add BCM2835 PWM driver Bart Tanghe
2014-10-07 3:35 ` Stephen Warren
2014-10-07 8:28 ` Thierry Reding [this message]
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=20141007082816.GC24254@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 \
--cc=swarren@wwwdotorg.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