From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] PWM: add pwm framework support
Date: Mon, 4 Jul 2011 09:55:56 +0200 [thread overview]
Message-ID: <20110704075556.GD6069@pengutronix.de> (raw)
In-Reply-To: <4E0E6916.50406@gmail.com>
On Sat, Jul 02, 2011 at 10:40:54AM +1000, Ryan Mallon wrote:
> On 01/07/11 18:54, Sascha Hauer wrote:
> >> At _any_ point that you change the pwm api you will need to change all
> >> of the drivers. How do you plan to adapt the api in the future to
> >> support the oddball pwm drivers without having to change all of the
> >> drivers in one go?
> > It is a framework between hardware drivers and user drivers and as such
> > it is able to abstract between the API to the hardware drivers and the
> > API to the user drivers. You can change one of those without touching
> > the other.
>
> You are missing the point. For example, the current in-kernel api to
> configure a pwm is this:
>
> int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);
>
> Bill's proposed change to the api, which is more flexible, looks like this:
>
> int pwm_config(struct pwm_channel *p,
> struct pwm_channel_config *c)
>
> If you want to change the api in this way at any time, you will need to
> change all of the pwm drivers and all of the users (pwm-bl, pwm-leds,
> etc) at the same time, or introduce some sort of wrapper layer to ease
> the conversion. Either way, if you do it now or do it after your patch
> set it is still the same amount of work.
>
> We do want a better api for pwm drivers, if only to support oddball
> hardware like the atmel. The process I see is this if we go with Bill's
> patches:
> - Introduce new api with common framework
I'm repeating myself. At this point you can't convert any of the old
drivers because it breaks the support we already have.
> - Move drivers to new api
And that's one single step. To be really bisectible have would have to
convert *all* PWM drivers in a single patch, not even a patch series
as it would break bisectibility in between.
>
> With your patches we get this:
> - Introduce common framework
And still everything works
> - Move drivers to common framework
One after another, still everything works
> - Modify api
> - Rewrite drivers for new api
There are two of them. One for the hardware drivers and one for the
users. You can change them independently, introduce wrappers where
necessary, you have all the time in the world to do this.
Your aim is to change the API? Then you have to clean up first. People
like Thomas have cleaned up in all areas of the kernel to reach their
goal of merging the RT stuff. They wouldn't have got anywhere with
a here's-a-patch-that-changes-everything approach.
>
> The problem we have seen with these processes in the past is they get
> left half way with some drivers moving to the new framework and some
> trailing behind and some having their own hand-rolled approach because
> the common api doesn't meet their needs.
With two competing APIs it's even worse because you can't go anywhere
without converting everything in tree.
Just imagine Bill or someone else comes up with a series
PATCH: introduce new pwm framework with completely changed API, sysfs
interface and interrupt support, also convert leds-pwm, pwm_bl, pwm-beeper
to new API and convert all hardware drivers to new API aswell.
What do you think would happen? I can think of two things: Either no
reaction at all from others or a huge thread with no result at all
because we can't agree on details. Then someone comes up with the
recommendation to start small and do it in little steps.
I am tired of discussing this. It seems we can't agree and unless
someone else jumps in here we will probably have to wait for another
year until something moves in the PWM area.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2011-07-04 7:55 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-30 10:41 [PATCH v3] implement a generic PWM framework Sascha Hauer
2011-06-30 10:41 ` [PATCH 1/3] PWM: add pwm framework support Sascha Hauer
2011-06-30 11:07 ` Bill Gatliff
2011-06-30 12:41 ` Arnd Bergmann
2011-06-30 16:17 ` Bill Gatliff
2011-06-30 17:02 ` Sascha Hauer
2011-06-30 19:45 ` Bill Gatliff
2011-06-30 23:24 ` Ryan Mallon
2011-07-01 0:33 ` H Hartley Sweeten
2011-07-01 0:55 ` Mike Frysinger
2011-07-01 7:37 ` Sascha Hauer
2011-07-01 8:28 ` Ryan Mallon
2011-07-01 8:54 ` Sascha Hauer
2011-07-02 0:40 ` Ryan Mallon
2011-07-04 7:55 ` Sascha Hauer [this message]
2011-07-04 8:50 ` Dmitry Eremin-Solenikov
2011-07-04 10:43 ` Ryan Mallon
2011-07-04 12:43 ` Sascha Hauer
2011-07-04 14:07 ` Arnd Bergmann
2011-12-07 8:53 ` Thierry Reding
2011-12-07 9:07 ` Sascha Hauer
2011-12-14 10:03 ` Thierry Reding
2011-12-14 11:37 ` Sascha Hauer
[not found] ` <20110704110523.GB316@e-circ.dyndns.org>
2011-07-04 13:53 ` Arnd Bergmann
2011-06-30 10:41 ` [PATCH 2/3] ARM mxs: adjust pwm resources to what the driver expects Sascha Hauer
2011-06-30 11:30 ` Arnd Bergmann
2011-06-30 10:41 ` [PATCH 3/3] pwm: Add a i.MX23/28 pwm driver Sascha Hauer
2011-06-30 11:42 ` Arnd Bergmann
2011-06-30 15:11 ` Sascha Hauer
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=20110704075556.GD6069@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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).