From: Bill Gatliff <bgat@billgatliff.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: David Brownell <david-b@pacbell.net>,
Mike Frysinger <vapier.adi@gmail.com>,
linux-embedded@vger.kernel.org
Subject: Re: [PATCH 0/6] Generic PWM API implementation
Date: Mon, 23 Nov 2009 08:12:02 -0600 [thread overview]
Message-ID: <4B0A9832.20908@billgatliff.com> (raw)
In-Reply-To: <fa686aa40911201414u6a9023e6y9addc97635d1c88@mail.gmail.com>
Grant Likely wrote:
> I'm talking about discrete controllable entities.
At the extreme, I see discrete, single-pin GPIO as being a degenerate
case of PWM: only 0% or 100% duty cycle e.g. one-bit granularity, a
single output, and no dependencies with any other channels or pins.
But the perspectives of the two groups of users are completely
different, so I don't see any advantage to having a combined user-facing
API.
> I'm talking about the management code to obtain a reference to
> the pin your interested in. There is a non-trivial amount of code
> associated with getting a reference to a pin and the behaviour
> required is largely identical between GPIO and PWM.
True, but anything involving pins has to be dealt with at the platform
level. And the general approach for that so far is that the board's
startup code sets the pins how it wants them, and the peripheral drivers
more or less assume that things are as they should be when it comes time
to activate the peripherals themselves. Anything more sophisticated
than that and you prevent the kind of reuse that's taking place now
between AVR32 and AT91, for example.
Maybe that's an opportunity for improvement: an API for pin reservation,
that GPIO, PWM and other platform-oriented drivers could use to request
the pins that they want. A kind of common version of the OMAP mux
management code, if you will.
But I don't think such an API would be all that useful for GPIO- and
PWM-related scenarios. Out of necessity, PWM and GPIO are very specific
to the board hardware, and on-the-fly pin configuration changes aren't
possible: either the hardware needs that pin to be an output, or it
doesn't. You can't make that decision at runtime because you'd probably
have to swap out or add resistors, drivers, etc. The software to do
*that* would be.... tricky. :)
> I don't want to see a new subsystem that largely does the exact same job, but is
> different in subtle ways. I think it should either be a unified
> PWM/GPIO pin management subsystem, or a common library used by each.
>
Where is there overlap? My PWM code is totally pin-agnostic, at least
for the drivers I've worked with so far. And I'm not aware of any GPIO
chip drivers that deal with pin multiplexing, either. Not saying there
aren't any, only that I haven't seen them.
It's a nice idea in the abstract, but I sure don't see how to make it
work well enough in practice to be worth the effort. I'm not saying it
can't be done, just that it isn't my focus. Yours? :)
b.g.
--
Bill Gatliff
bgat@billgatliff.com
next prev parent reply other threads:[~2009-11-23 14:12 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 18:14 [PATCH 0/6] Generic PWM API implementation Bill Gatliff
2008-10-15 18:14 ` [PATCH 1/6] [PWM] " Bill Gatliff
2008-10-17 15:59 ` Mike Frysinger
2008-11-04 20:16 ` Bill Gatliff
2008-11-04 20:51 ` Mike Frysinger
2008-11-04 23:55 ` David Brownell
2008-11-05 0:17 ` Mike Frysinger
2008-11-05 2:59 ` Bill Gatliff
2008-11-05 5:08 ` David Brownell
2008-11-05 2:56 ` Bill Gatliff
2008-10-15 18:14 ` [PATCH 2/6] [PWM] Changes to existing include/linux/pwm.h to adapt to generic PWM API Bill Gatliff
2008-10-15 18:14 ` [PATCH 3/6] [PWM] Documentation Bill Gatliff
2008-10-15 18:14 ` [PATCH 4/6] [PWM] Driver for Atmel PWMC peripheral Bill Gatliff
2008-10-15 18:14 ` [PATCH 5/6] [PWM] Install new Atmel PWMC driver in Kconfig, expunge old one Bill Gatliff
2008-10-15 18:14 ` [PATCH 6/6] [PWM] New LED driver and trigger that use PWM API Bill Gatliff
2009-11-13 19:08 ` [PATCH 0/6] Generic PWM API implementation Grant Likely
2009-11-14 4:22 ` Mike Frysinger
2009-11-14 7:55 ` Grant Likely
2009-11-17 7:47 ` David Brownell
2009-11-17 15:48 ` Bill Gatliff
2009-11-17 16:53 ` David Brownell
2009-11-20 22:51 ` Grant Likely
2009-11-20 22:14 ` Grant Likely
2009-11-23 14:12 ` Bill Gatliff [this message]
2009-11-23 17:39 ` Grant Likely
2009-11-23 20:51 ` Albrecht Dreß
2009-11-28 21:38 ` David Brownell
2009-11-28 21:59 ` David Brownell
2009-11-17 15:45 ` Bill Gatliff
2009-11-17 8:27 ` David Brownell
2009-11-17 15:54 ` Bill Gatliff
2009-11-20 22:21 ` Grant Likely
2009-11-23 14:13 ` Bill Gatliff
2009-11-23 17:40 ` Grant Likely
2009-11-23 15:29 ` Mark Brown
2009-11-23 17:44 ` Grant Likely
2009-11-23 18:09 ` Mark Brown
2009-11-28 21:54 ` David Brownell
2009-11-17 15:39 ` Bill Gatliff
2009-11-20 22:49 ` Grant Likely
2009-11-28 21:28 ` David Brownell
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=4B0A9832.20908@billgatliff.com \
--to=bgat@billgatliff.com \
--cc=david-b@pacbell.net \
--cc=grant.likely@secretlab.ca \
--cc=linux-embedded@vger.kernel.org \
--cc=vapier.adi@gmail.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;
as well as URLs for NNTP newsgroup(s).