All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
To: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
	Richard Purdie <rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org>,
	Matthias Kaehlcke
	<matthias-RprLehDfhQ3k1uMJSBkQmQ@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Kurt Van Dijck <kurt.van.dijck-/BeEPy95v10@public.gmane.org>
Subject: Re: [PATCH v2 02/10] pwm: Allow chips to support multiple PWMs.
Date: Tue, 7 Feb 2012 08:04:00 +0100	[thread overview]
Message-ID: <20120207070400.GA29238@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <4F3044A9.8000202-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]

* Lars-Peter Clausen wrote:
> On 02/06/2012 04:19 PM, Thierry Reding wrote:
> > This commit modifies the PWM core to support multiple PWMs per struct
> > pwm_chip.
> 
> I think you should mention what motivates this change.

Okay, I can add that.

> > It achieves this in a similar way to how gpiolib works, by
> > allowing PWM ranges to be requested dynamically (pwm_chip.base == -1) or
> > starting at a given offset (pwm_chip.base >= 0).
> 
> If we've learned one thing from gpiolib, I think it is that using a global
> index to identify a resource was a bad idea.

Yes, that concern has been raised several times already. The reason for it
being this way is that the current API requires it. So either we keep it as
is for now and change it over to indexing on a per-chip basis later (which
has the advantage of not breaking anything currently in-tree) or we make that
change now, in which case this patch series will probably double in size. I'm
also not sure if I can reasonably keep the series bisectible that way.

One of the major problems when converting to a non-global namespace is how to
represent the relationship in code. For device tree this should be easy to do
because it has all the infrastructure in place. For non-device-tree devices I
have no idea yet how this could be done. Perhaps by using something like the
clock API and using names for lookup?

> > A chip specifies how
> > many PWMs it controls using the npwm member. Each of the functions in
> > the pwm_ops structure gets an additional argument that specified the PWM
> > number (it can be converted to a per-chip index by subtracting the
> > chip's base).
> > 
> > The total maximum number of PWM devices is currently fixed to 64, but
> > can easily be made configurable via Kconfig.
> 
> The code says 1024.

Right, I missed that. Thanks.

> > The patch is incomplete in that it doesn't convert any existing drivers
> > that are now broken.

I just noticed that this isn't completely valid anymore either since I've
ported two of the drivers. However, The remaining drivers won't work properly
when built against a kernel with PWM framework support because of the
duplicate symbols.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: thierry.reding@avionic-design.de (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 02/10] pwm: Allow chips to support multiple PWMs.
Date: Tue, 7 Feb 2012 08:04:00 +0100	[thread overview]
Message-ID: <20120207070400.GA29238@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <4F3044A9.8000202@metafoo.de>

* Lars-Peter Clausen wrote:
> On 02/06/2012 04:19 PM, Thierry Reding wrote:
> > This commit modifies the PWM core to support multiple PWMs per struct
> > pwm_chip.
> 
> I think you should mention what motivates this change.

Okay, I can add that.

> > It achieves this in a similar way to how gpiolib works, by
> > allowing PWM ranges to be requested dynamically (pwm_chip.base == -1) or
> > starting at a given offset (pwm_chip.base >= 0).
> 
> If we've learned one thing from gpiolib, I think it is that using a global
> index to identify a resource was a bad idea.

Yes, that concern has been raised several times already. The reason for it
being this way is that the current API requires it. So either we keep it as
is for now and change it over to indexing on a per-chip basis later (which
has the advantage of not breaking anything currently in-tree) or we make that
change now, in which case this patch series will probably double in size. I'm
also not sure if I can reasonably keep the series bisectible that way.

One of the major problems when converting to a non-global namespace is how to
represent the relationship in code. For device tree this should be easy to do
because it has all the infrastructure in place. For non-device-tree devices I
have no idea yet how this could be done. Perhaps by using something like the
clock API and using names for lookup?

> > A chip specifies how
> > many PWMs it controls using the npwm member. Each of the functions in
> > the pwm_ops structure gets an additional argument that specified the PWM
> > number (it can be converted to a per-chip index by subtracting the
> > chip's base).
> > 
> > The total maximum number of PWM devices is currently fixed to 64, but
> > can easily be made configurable via Kconfig.
> 
> The code says 1024.

Right, I missed that. Thanks.

> > The patch is incomplete in that it doesn't convert any existing drivers
> > that are now broken.

I just noticed that this isn't completely valid anymore either since I've
ported two of the drivers. However, The remaining drivers won't work properly
when built against a kernel with PWM framework support because of the
duplicate symbols.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120207/f0c17d08/attachment.sig>

  parent reply	other threads:[~2012-02-07  7:04 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 15:19 [PATCH v2 00/10] Add PWM framework and device-tree support Thierry Reding
2012-02-06 15:19 ` Thierry Reding
     [not found] ` <1328541585-24642-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-06 15:19   ` [PATCH v2 01/10] PWM: add pwm framework support Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 02/10] pwm: Allow chips to support multiple PWMs Thierry Reding
2012-02-06 15:19     ` Thierry Reding
     [not found]     ` <1328541585-24642-3-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-06 21:22       ` Lars-Peter Clausen
2012-02-06 21:22         ` Lars-Peter Clausen
     [not found]         ` <4F3044A9.8000202-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2012-02-07  7:04           ` Thierry Reding [this message]
2012-02-07  7:04             ` Thierry Reding
     [not found]             ` <20120207070400.GA29238-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-02-07 11:38               ` Mark Brown
2012-02-07 11:38                 ` Mark Brown
2012-02-08  9:13               ` Russell King - ARM Linux
2012-02-08  9:13                 ` Russell King - ARM Linux
     [not found]                 ` <20120208091327.GH889-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-02-08 11:12                   ` Thierry Reding
2012-02-08 11:12                     ` Thierry Reding
2012-02-07 22:53       ` Ryan Mallon
2012-02-07 22:53         ` Ryan Mallon
     [not found]         ` <4F31AB63.3020301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-08  8:15           ` Thierry Reding
2012-02-08  8:15             ` Thierry Reding
     [not found]             ` <20120208081508.GA6673-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-02-08  9:00               ` Sascha Hauer
2012-02-08  9:00                 ` Sascha Hauer
     [not found]                 ` <20120208090055.GP3852-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-08 11:16                   ` Thierry Reding
2012-02-08 11:16                     ` Thierry Reding
2012-02-08  9:17               ` Russell King - ARM Linux
2012-02-08  9:17                 ` Russell King - ARM Linux
     [not found]                 ` <20120208091720.GI889-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-02-08 10:31                   ` Thierry Reding
2012-02-08 10:31                     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 03/10] of: Add PWM support Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 04/10] arm/tegra: Fix PWM clock programming Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 05/10] arm/tegra: Provide clock for only one PWM controller Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 06/10] pwm: Add NVIDIA Tegra SoC support Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 07/10] arm/tegra: Add PWFM controller device tree probing Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 08/10] pwm: Add Blackfin support Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 09/10] pwm: Add PXA support Thierry Reding
2012-02-06 15:19     ` Thierry Reding
2012-02-06 15:19   ` [PATCH v2 10/10] pwm-backlight: Add rudimentary device tree support Thierry Reding
2012-02-06 15:19     ` Thierry Reding

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=20120207070400.GA29238@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding-rm9k5ik7kjkj5m59nbduvrnah6klmebb@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=kurt.van.dijck-/BeEPy95v10@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matthias-RprLehDfhQ3k1uMJSBkQmQ@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org \
    --cc=wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.