From: Grant Likely <grant.likely@secretlab.ca>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Rob Landley <rob@landley.net>,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-omap@vger.kernel.org
Subject: Re: [PATCH] gpio: New driver for GPO emulation using PWM generators
Date: Mon, 26 Nov 2012 15:46:00 +0000 [thread overview]
Message-ID: <20121126154600.765E03E1AFD@localhost> (raw)
In-Reply-To: <50AF4584.7020604@ti.com>
On Fri, 23 Nov 2012 10:44:36 +0100, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> Hi Grant,
>
> On 11/23/2012 10:13 AM, Peter Ujfalusi wrote:
> > Hi Grant,
> >
> > On 11/23/2012 08:55 AM, Grant Likely wrote:
> >> Ugh. and this is why I wanted the PWM and GPIO subsystems to use the
> >> same namespace and binding. <grumble, mutter> But that's not your fault.
> >>
> >> It's pretty horrible to have a separate translator node to convert a PWM
> >> into a GPIO (with output only of course). The gpio properties should
> >> appear directly in the PWM node itself and the translation code should
> >> be in either the pwm or the gpio core. I don't think it should look like
> >> a separate device.
> >
> > Let me see if I understand your suggestion correctly. In the DT you suggest
> > something like this:
> >
> > twl_pwmled: pwmled {
> > compatible = "ti,twl4030-pwmled";
> > #pwm-cells = <2>;
> > #gpio-cells = <2>;
> > gpio-controller;
> > };
>
> After I thought about this.. Is this what we really want?
> After all what we have here is a PWM generator used to emulate a GPIO signal.
> The PWM itself can be used for driving a LED (standard LED or backlight and we
> have DT bindings for these already), vibra motor, or other things.
> If we combine the PWM with GPIO we should go and 'bloat' the DT node to also
> include all sort of other uses of PWM at once?
>
> IMHO it is better to keep them as separate things.
> pwm node to describe the PWM generator,
> separate nodes to describe it's uses like led, backlight, motor and gpio.
You're effectively asking the pwm layer to behave like a gpio (which
is completely reasonable). Having a completely separate translation node
really doesn't make sense because it is entirely a software construct.
In fact, the way your using it is *entirely* to make the Linux driver
model instantiate the translation code. It has *nothing* to do with the
structure of the hardware. It makes complete sense that if a PWM is
going to be used as a GPIO, then the PWM node should conform to the GPIO
binding.
g.
next prev parent reply other threads:[~2012-11-26 15:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 13:42 [PATCH] gpio: New driver for GPO emulation using PWM generators Peter Ujfalusi
2012-11-23 7:55 ` Grant Likely
2012-11-23 9:13 ` Peter Ujfalusi
2012-11-23 9:44 ` Peter Ujfalusi
2012-11-26 10:30 ` Lars-Peter Clausen
2012-11-26 11:36 ` Peter Ujfalusi
2012-11-26 15:46 ` Grant Likely [this message]
2012-11-28 8:54 ` Peter Ujfalusi
[not found] ` <50B5D161.6010200-l0cyMroinI0@public.gmane.org>
2012-11-28 19:30 ` Thierry Reding
2012-11-29 12:18 ` Peter Ujfalusi
2012-11-28 21:02 ` Lars-Peter Clausen
2012-11-29 16:10 ` Grant Likely
2012-11-30 6:47 ` Thierry Reding
2012-11-30 10:20 ` Grant Likely
2012-11-30 10:47 ` Peter Ujfalusi
2012-11-30 11:04 ` Thierry Reding
2012-11-30 11:09 ` Grant Likely
2012-11-30 11:00 ` Peter Ujfalusi
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=20121126154600.765E03E1AFD@localhost \
--to=grant.likely@secretlab.ca \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=rob@landley.net \
/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).