From: Thierry Reding <thierry.reding@avionic-design.de>
To: "Philip, Avinash" <avinashphilip@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Nori, Sekhar" <nsekhar@ti.com>,
"Hebbar, Gururaja" <gururaja.hebbar@ti.com>
Subject: Re: [PATCH] PWM: Add support for configuring polarity of PWM
Date: Mon, 23 Jul 2012 15:08:25 +0200 [thread overview]
Message-ID: <20120723130825.GA21254@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <518397C60809E147AF5323E0420B992E3E97189D@DBDE01.ent.ti.com>
[-- Attachment #1: Type: text/plain, Size: 1636 bytes --]
On Mon, Jul 23, 2012 at 12:51:11PM +0000, Philip, Avinash wrote:
> On Mon, Jul 23, 2012 at 14:00:32, Thierry Reding wrote:
> > On Wed, Jul 18, 2012 at 06:24:13PM +0530, Philip, Avinash wrote:
[...]
> > > +
> > > + if (test_bit(PWMF_ENABLED, &pwm->flags)) {
> > > + dev_err(pwm->chip->dev,
> > > + "Polarity configuration Failed!, PWM device enabled\n");
> > > + return -EBUSY;
> > > + }
> >
> > Maybe something like: "polarity cannot be configured while PWM device is
> > enabled"?
>
> Ok I will update.
>
> > Though I'm not sure the error message is all that useful. I'd
> > expect the user driver to handle -EBUSY specially.
>
> On EBUSY, client driver has to rework on it. Nothing to be done from
> framework
Exactly, so I think that if an error is displayed because the PWM has
been enabled, then that client (== user) driver should output an error
message, not the framework. Also, it really shouldn't happen because it
clearly is a driver problem that needs to be fixed.
> > > /*
> > > * pwm_enable - start a PWM output toggling
> > > */
> > > @@ -37,6 +47,7 @@ struct pwm_chip;
> > > enum {
> > > PWMF_REQUESTED = 1 << 0,
> > > PWMF_ENABLED = 1 << 1,
> > > + PWMF_POLARITY_INVERSE = 1 << 2,
> >
> > This should be named PWMF_POLARITY_INVERSED for consistency.
>
> Ok I will correct it.
>
> > I'm not sure that we really need this flag, though. It isn't used anywhere. But
> > maybe you have a use-case in mind?
>
> It can be used to find the polarity of the PWM at runtime.
Yes, but is there any use-case where this information would be required?
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-07-23 13:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 12:54 [PATCH] PWM: Add support for configuring polarity of PWM Philip, Avinash
2012-07-23 8:30 ` Thierry Reding
2012-07-23 12:51 ` Philip, Avinash
2012-07-23 13:08 ` Thierry Reding [this message]
2012-07-23 15:05 ` Philip, Avinash
2012-07-23 19:52 ` Thierry Reding
2012-07-24 6:08 ` Philip, Avinash
2012-07-23 20:15 ` Lars-Peter Clausen
2012-07-24 6:51 ` Thierry Reding
2012-07-24 8:25 ` Lars-Peter Clausen
2012-07-24 8:26 ` Thierry Reding
2012-07-24 8:37 ` Philip, Avinash
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=20120723130825.GA21254@avionic-0098.mockup.avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=avinashphilip@ti.com \
--cc=gururaja.hebbar@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nsekhar@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox