Hi,
Originally sent on Apr 14th, note that this series is blocking another 16
patches series, I would like it to be taken in 3.16 if we can agree on this
implementation.
A patch set as suggested by Thierry to make lookup with the lookup table
instead of device tree behave more like when using device tree.
The first patch adds a period and a polarity member to the lookup table and use
those to set period and polarity.
Patch 2, 4 and 5 are making use of those new members from the board files.
Patch 3 removes useless code since setting the polarity is now handled by the
PWM core.
I couldn't decide on a good name for the extended PWM_LOOKUP macro and I believe
we won't have to add members to that structure soon so:
Patch 6 modifies the PWM_LOOKUP macro to also initialize period and polarity
and
Patch 7-9 are making use of the new PWM_LOOKUP macro in the board files
Patch 10 and 11 are making the leds-pwm and pwm_bl drivers get the period from
the PWM before using pwm_period_ns if it is not already set.
Patch 10 will obviously conflict with the series of Russell reworking the
leds-pwm probing. I can rebase if necessary
The final goal would be to get rid of .pwm_period_ns in leds-pwm and pwm_bl
after moving all the remaining users (still around 25) to pwm_lookup.
Changes in v2:
- correctly unlock the pwm_lookup_lock mutex before returning.
- don't change PWM_LOOKUP atomically
- remove tpu_pwm_platform_data and the associated header file
- make the leds-pwm and pwm_bl drivers get the period from the PWM
Alexandre Belloni (11):
pwm: add period and polarity to struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: initialize all struct pwm_lookup
members
pwm: renesas-tpu: remove useless struct tpu_pwm_platform_data
ARM: OMAP3: Beagle: initialize all the struct pwm_lookup members
ARM: pxa: hx4700: initialize all the struct pwm_lookup members
pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members
ARM: OMAP3: Beagle: use PWM_LOOKUP to initialize struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: use PWM_LOOKUP to initialize struct
pwm_lookup
ARM: pxa: hx4700: use PWM_LOOKUP to initialize struct pwm_lookup
leds: leds-pwm: retrieve configured pwm period
backlight: pwm_bl: retrieve configured pwm period
Documentation/pwm.txt | 3 ++-
arch/arm/mach-omap2/board-omap3beagle.c | 3 ++-
arch/arm/mach-pxa/hx4700.c | 3 ++-
arch/arm/mach-shmobile/board-armadillo800eva.c | 14 +++-----------
drivers/leds/leds-pwm.c | 5 ++++-
drivers/pwm/core.c | 8 +++++++-
drivers/pwm/pwm-renesas-tpu.c | 19 +++----------------
drivers/video/backlight/pwm_bl.c | 8 +++++---
include/linux/platform_data/pwm-renesas-tpu.h | 16 ----------------
include/linux/pwm.h | 6 +++++-
10 files changed, 33 insertions(+), 52 deletions(-)
delete mode 100644 include/linux/platform_data/pwm-renesas-tpu.h
--
1.9.1
Adds a period and a polarity member to struct pwm_lookup so that when performing
a lookup using the lookup table instead of device tree, we are able to set the
period and the polarity accordingly like what is done in
of_pwm_xlate_with_flags.
Signed-off-by: Alexandre Belloni <redacted>
---
drivers/pwm/core.c | 8 +++++++-
include/linux/pwm.h | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)
Initializing all the struc pwm_lookup members allows to get rid of the struct
tpu_pwm_platform_data as the polarity initialization will be taken care of by
the PWM core.
Signed-off-by: Alexandre Belloni <redacted>
Acked-by: Simon Horman <horms@verge.net.au>
---
arch/arm/mach-shmobile/board-armadillo800eva.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
Now that PWM_LOOKUP is not used anymore, modify it to initialize all the
members of struct pwm_lookup.
Signed-off-by: Alexandre Belloni <redacted>
---
Documentation/pwm.txt | 3 ++-
include/linux/pwm.h | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
@@ -19,7 +19,8 @@ should instead register a static mapping that can be used to match PWM consumers to providers, as given in the following example: static struct pwm_lookup board_pwm_lookup[] = {- PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL),+ PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL,+ 50000, PWM_POLARITY_NORMAL), }; static void __init board_init(void)
This will allow to get rid of the .pwm_period_ns member of struct
platform_pwm_backlight_data as the period will be set by the PWM core.
Signed-off-by: Alexandre Belloni <redacted>
---
arch/arm/mach-pxa/hx4700.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
The PWM core is now able to initialize the PWM period from platform_data. Use it
and if it is not configured, use the supplied pwm_period_ns.
Signed-off-by: Alexandre Belloni <redacted>
---
drivers/video/backlight/pwm_bl.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
The PWM core is now able to initialize the PWM period. Use it and if it is not
configured, use the supplied pwm_period_ns.
Signed-off-by: Alexandre Belloni <redacted>
---
drivers/leds/leds-pwm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
The struct is not used anymore and the polarity initialization will be taken
care of by the PWM core.
Signed-off-by: Alexandre Belloni <redacted>
---
drivers/pwm/pwm-renesas-tpu.c | 19 +++----------------
include/linux/platform_data/pwm-renesas-tpu.h | 16 ----------------
2 files changed, 3 insertions(+), 32 deletions(-)
delete mode 100644 include/linux/platform_data/pwm-renesas-tpu.h
This will allow to get rid of the .pwm_period_ns member of struct led_pwm as the
period will be set by the PWM core.
Signed-off-by: Alexandre Belloni <redacted>
---
arch/arm/mach-omap2/board-omap3beagle.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
On Mon, May 19, 2014 at 10:42:31PM +0200, Alexandre Belloni wrote:
Hi,
Originally sent on Apr 14th, note that this series is blocking another 16
patches series, I would like it to be taken in 3.16 if we can agree on this
implementation.
It's kind of late for 3.16 now, but it doesn't look very risky from a
quick look. I'll sleep on it and if I don't feel too uncomfortable about
it in the morning I'll apply it for linux-next and see how that goes.
Thierry
From: Simon Horman <horms@verge.net.au> Date: 2014-05-19 22:39:21
[ CCed Laurent Pinchart ]
The renesas and shmobile portions of this seem reasonable to me
and I have checked that there do not seem to be any conflicts
with changes I already have queued up for v3.16 (and v3.17).
I have CCed Laurent Pinchart as I believe he most recently
did work on the renesas and shmobile code in question.
On Mon, May 19, 2014 at 10:42:31PM +0200, Alexandre Belloni wrote:
Hi,
Originally sent on Apr 14th, note that this series is blocking another 16
patches series, I would like it to be taken in 3.16 if we can agree on this
implementation.
A patch set as suggested by Thierry to make lookup with the lookup table
instead of device tree behave more like when using device tree.
The first patch adds a period and a polarity member to the lookup table and use
those to set period and polarity.
Patch 2, 4 and 5 are making use of those new members from the board files.
Patch 3 removes useless code since setting the polarity is now handled by the
PWM core.
I couldn't decide on a good name for the extended PWM_LOOKUP macro and I believe
we won't have to add members to that structure soon so:
Patch 6 modifies the PWM_LOOKUP macro to also initialize period and polarity
and
Patch 7-9 are making use of the new PWM_LOOKUP macro in the board files
Patch 10 and 11 are making the leds-pwm and pwm_bl drivers get the period from
the PWM before using pwm_period_ns if it is not already set.
Patch 10 will obviously conflict with the series of Russell reworking the
leds-pwm probing. I can rebase if necessary
The final goal would be to get rid of .pwm_period_ns in leds-pwm and pwm_bl
after moving all the remaining users (still around 25) to pwm_lookup.
Changes in v2:
- correctly unlock the pwm_lookup_lock mutex before returning.
- don't change PWM_LOOKUP atomically
- remove tpu_pwm_platform_data and the associated header file
- make the leds-pwm and pwm_bl drivers get the period from the PWM
Alexandre Belloni (11):
pwm: add period and polarity to struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: initialize all struct pwm_lookup
members
pwm: renesas-tpu: remove useless struct tpu_pwm_platform_data
The above two patches:
Acked-by: Simon Horman <redacted>
ARM: OMAP3: Beagle: initialize all the struct pwm_lookup members
ARM: pxa: hx4700: initialize all the struct pwm_lookup members
pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members
ARM: OMAP3: Beagle: use PWM_LOOKUP to initialize struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: use PWM_LOOKUP to initialize struct
pwm_lookup
The above patch:
Acked-by: Simon Horman <redacted>
Hi Alexandre and Simon,
On Tuesday 20 May 2014 07:39:13 Simon Horman wrote:
[ CCed Laurent Pinchart ]
The renesas and shmobile portions of this seem reasonable to me
and I have checked that there do not seem to be any conflicts
with changes I already have queued up for v3.16 (and v3.17).
I have CCed Laurent Pinchart as I believe he most recently
did work on the renesas and shmobile code in question.
The series look sane to me. For the three patches that Simon has acked below,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
On Mon, May 19, 2014 at 10:42:31PM +0200, Alexandre Belloni wrote:
quoted
Hi,
Originally sent on Apr 14th, note that this series is blocking another 16
patches series, I would like it to be taken in 3.16 if we can agree on
this implementation.
A patch set as suggested by Thierry to make lookup with the lookup table
instead of device tree behave more like when using device tree.
The first patch adds a period and a polarity member to the lookup table
and use those to set period and polarity.
Patch 2, 4 and 5 are making use of those new members from the board files.
Patch 3 removes useless code since setting the polarity is now handled by
the PWM core.
I couldn't decide on a good name for the extended PWM_LOOKUP macro and I
believe we won't have to add members to that structure soon so:
Patch 6 modifies the PWM_LOOKUP macro to also initialize period and
polarity and Patch 7-9 are making use of the new PWM_LOOKUP macro in the
board files
Patch 10 and 11 are making the leds-pwm and pwm_bl drivers get the period
from the PWM before using pwm_period_ns if it is not already set.
Patch 10 will obviously conflict with the series of Russell reworking the
leds-pwm probing. I can rebase if necessary
The final goal would be to get rid of .pwm_period_ns in leds-pwm and
pwm_bl after moving all the remaining users (still around 25) to
pwm_lookup.
Changes in v2:
- correctly unlock the pwm_lookup_lock mutex before returning.
- don't change PWM_LOOKUP atomically
- remove tpu_pwm_platform_data and the associated header file
- make the leds-pwm and pwm_bl drivers get the period from the PWM
Alexandre Belloni (11):
pwm: add period and polarity to struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: initialize all struct pwm_lookup
members
pwm: renesas-tpu: remove useless struct tpu_pwm_platform_data
The above two patches:
Acked-by: Simon Horman <redacted>
quoted
ARM: OMAP3: Beagle: initialize all the struct pwm_lookup members
ARM: pxa: hx4700: initialize all the struct pwm_lookup members
pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members
ARM: OMAP3: Beagle: use PWM_LOOKUP to initialize struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: use PWM_LOOKUP to initialize struct
pwm_lookup
The above patch:
Acked-by: Simon Horman <redacted>
From: Philipp Zabel <hidden> Date: 2014-05-20 17:27:23
Hi Alexandre,
On Mon, May 19, 2014 at 10:42 PM, Alexandre Belloni
[off-list ref] wrote:
Hi,
Originally sent on Apr 14th, note that this series is blocking another 16
patches series, I would like it to be taken in 3.16 if we can agree on this
implementation.
A patch set as suggested by Thierry to make lookup with the lookup table
instead of device tree behave more like when using device tree.
The first patch adds a period and a polarity member to the lookup table and use
those to set period and polarity.
Patch 2, 4 and 5 are making use of those new members from the board files.
Patch 3 removes useless code since setting the polarity is now handled by the
PWM core.
I couldn't decide on a good name for the extended PWM_LOOKUP macro and I believe
we won't have to add members to that structure soon so:
Patch 6 modifies the PWM_LOOKUP macro to also initialize period and polarity
and
Patch 7-9 are making use of the new PWM_LOOKUP macro in the board files
Patch 10 and 11 are making the leds-pwm and pwm_bl drivers get the period from
the PWM before using pwm_period_ns if it is not already set.
Patch 10 will obviously conflict with the series of Russell reworking the
leds-pwm probing. I can rebase if necessary
The final goal would be to get rid of .pwm_period_ns in leds-pwm and pwm_bl
after moving all the remaining users (still around 25) to pwm_lookup.
Changes in v2:
- correctly unlock the pwm_lookup_lock mutex before returning.
- don't change PWM_LOOKUP atomically
- remove tpu_pwm_platform_data and the associated header file
- make the leds-pwm and pwm_bl drivers get the period from the PWM
Alexandre Belloni (11):
pwm: add period and polarity to struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: initialize all struct pwm_lookup
members
pwm: renesas-tpu: remove useless struct tpu_pwm_platform_data
ARM: OMAP3: Beagle: initialize all the struct pwm_lookup members
ARM: pxa: hx4700: initialize all the struct pwm_lookup members
pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members
ARM: OMAP3: Beagle: use PWM_LOOKUP to initialize struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: use PWM_LOOKUP to initialize struct
pwm_lookup
ARM: pxa: hx4700: use PWM_LOOKUP to initialize struct pwm_lookup
leds: leds-pwm: retrieve configured pwm period
backlight: pwm_bl: retrieve configured pwm period
For the hx4700 patches (5 an 9),
Acked-by: Philipp Zabel <redacted>
regards
Philipp
On Mon, May 19, 2014 at 10:42:31PM +0200, Alexandre Belloni wrote:
Hi,
Originally sent on Apr 14th, note that this series is blocking another 16
patches series, I would like it to be taken in 3.16 if we can agree on this
implementation.
A patch set as suggested by Thierry to make lookup with the lookup table
instead of device tree behave more like when using device tree.
The first patch adds a period and a polarity member to the lookup table and use
those to set period and polarity.
Patch 2, 4 and 5 are making use of those new members from the board files.
Patch 3 removes useless code since setting the polarity is now handled by the
PWM core.
I couldn't decide on a good name for the extended PWM_LOOKUP macro and I believe
we won't have to add members to that structure soon so:
Patch 6 modifies the PWM_LOOKUP macro to also initialize period and polarity
and
Patch 7-9 are making use of the new PWM_LOOKUP macro in the board files
Patch 10 and 11 are making the leds-pwm and pwm_bl drivers get the period from
the PWM before using pwm_period_ns if it is not already set.
Patch 10 will obviously conflict with the series of Russell reworking the
leds-pwm probing. I can rebase if necessary
The final goal would be to get rid of .pwm_period_ns in leds-pwm and pwm_bl
after moving all the remaining users (still around 25) to pwm_lookup.
Changes in v2:
- correctly unlock the pwm_lookup_lock mutex before returning.
- don't change PWM_LOOKUP atomically
- remove tpu_pwm_platform_data and the associated header file
- make the leds-pwm and pwm_bl drivers get the period from the PWM
Alexandre Belloni (11):
pwm: add period and polarity to struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: initialize all struct pwm_lookup
members
pwm: renesas-tpu: remove useless struct tpu_pwm_platform_data
ARM: OMAP3: Beagle: initialize all the struct pwm_lookup members
ARM: pxa: hx4700: initialize all the struct pwm_lookup members
pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members
ARM: OMAP3: Beagle: use PWM_LOOKUP to initialize struct pwm_lookup
ARM: shmobile: Armadillo 800 EVA: use PWM_LOOKUP to initialize struct
pwm_lookup
ARM: pxa: hx4700: use PWM_LOOKUP to initialize struct pwm_lookup
leds: leds-pwm: retrieve configured pwm period
backlight: pwm_bl: retrieve configured pwm period
Documentation/pwm.txt | 3 ++-
arch/arm/mach-omap2/board-omap3beagle.c | 3 ++-
arch/arm/mach-pxa/hx4700.c | 3 ++-
arch/arm/mach-shmobile/board-armadillo800eva.c | 14 +++-----------
drivers/leds/leds-pwm.c | 5 ++++-
drivers/pwm/core.c | 8 +++++++-
drivers/pwm/pwm-renesas-tpu.c | 19 +++----------------
drivers/video/backlight/pwm_bl.c | 8 +++++---
include/linux/platform_data/pwm-renesas-tpu.h | 16 ----------------
include/linux/pwm.h | 6 +++++-
10 files changed, 33 insertions(+), 52 deletions(-)
delete mode 100644 include/linux/platform_data/pwm-renesas-tpu.h
I've applied this whole series with some minor fixups (mostly adding
detail to commit messages). Test builds show no breakage, so I've pushed
this to the for-next branch.
Thanks,
Thierry