devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/10] Add PWM framework and device tree support.
@ 2012-03-14 15:56 Thierry Reding
  2012-03-14 15:56 ` [PATCH v4 01/10] PWM: add pwm framework support Thierry Reding
                   ` (2 more replies)
  0 siblings, 3 replies; 56+ messages in thread
From: Thierry Reding @ 2012-03-14 15:56 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Sascha Hauer, Arnd Bergmann,
	Matthias Kaehlcke, Kurt Van Dijck, Rob Herring, Grant Likely,
	Colin Cross, Olof Johansson, Stephen Warren, Richard Purdie,
	Mark Brown, Mitch Bradley, Mike Frysinger, Eric Miao,
	Lars-Peter Clausen, Ryan Mallon

This patch series adds very rudimentary device-tree support for PWM
devices. With all of these patches applied (plus one board-specific
patch that is not included), I'm able to control the backlight on the
device I'm working on using the sysfs interface provided by the pwm-bl
driver and the backlight class.

This series is based on Sascha Hauer's series of patches[0] to add a
generic PWM framework. The first patch in this series is taken from
Sascha's branch, while the second patch enables each PWM chip to provide
multiple PWM devices (the Blackfin and PXA drivers have been ported to
the framework for reference). Currently a global namespace is still
provided to keep backwards-compatibility with the legacy PWM API. In
order to achieve this, the number of global PWM devices is limited to
1024. However, patch 2 introduces per-chip indexing of PWM devices in
the core and adds an API to request a PWM device given the PWM chip or
the struct device associated with a PWM chip. They are supposed to
eventually replace pwm_request() and allow to get rid of the global
namespace. The device tree support code does not use the global
namespace.

Patch 3 adds some code to lookup a PWM chip given its device-tree
handle. This code will be used later on by the pwm-bl driver to find the
PWM device that it should be using. If the no corresponding PWM chip is
available yet, the code returns EPROBE_DEFER to have users automatically
probed again later when the PWM provider may have become available.
Device tree binding documentation is also provided.

Patch 4 was taken from the Chromium tree and is required to provide
proper clocking of the Tegra2 PWFM controller. All Chromium-specific
tags have been removed from the commit message. Some cleanup of the
clock registration for Tegra is done in patch 5 because a subsequent
patch will instantiate one PWFM controller device instead of four.

Patch 6 adds a generic PWM framework driver for the Tegra2 PWFM
controller. The code is taken from the Chromium tree with some
adjustments to integrate it with the PWM framework. Device tree based
probing of the driver is implemented in patch 7.

Patches 8 and 9 are ports of the Blackfin PWM and the PXA PWM drivers to
the PWM framework. These are only compile-tested as I do not have any
hardware to test them on. They are meant as test-bed for the framework.
Sascha already has patches that port all in-tree drivers to the
framework and will rebase them on top of this series when it is ready.

Patch 10 implements DT-based probing in the pwm-backlight driver. Note
that this code only handles the "pwm" property (by looking up the PWM
device via the new PWM DT binding). Switching power to the backlight via
GPIOs is not supported yet. The DT binding also deviates from the
platform data in that it requires a list of brightness levels to be
specified instead of assuming a linearily spaced range from 0 to a given
maximum brightness.

The whole series is based on the linux-next tree from 20120314. I think
I've addressed all of the concerns raised in the first three versions.

Thierry

[0]: http://git.pengutronix.de/?p=imx/linux-2.6.git;a=shortlog;h=refs/heads/pwmlib

Sascha Hauer (1):
  PWM: add pwm framework support

Simon Que (1):
  ARM: tegra: Fix PWM clock programming

Thierry Reding (8):
  pwm: Allow chips to support multiple PWMs.
  pwm: Add device tree support
  ARM: tegra: Provide clock for only one PWM controller
  pwm: Add NVIDIA Tegra SoC support
  pwm: tegra: Add device tree support
  pwm: Add Blackfin support
  pwm: Add PXA support
  pwm-backlight: Add rudimentary device tree support

 Documentation/devicetree/bindings/pwm/pwm.txt      |   48 ++
 .../devicetree/bindings/pwm/tegra-pwm.txt          |   18 +
 .../bindings/video/backlight/pwm-backlight         |   19 +
 Documentation/pwm.txt                              |   56 ++
 MAINTAINERS                                        |    6 +
 arch/arm/boot/dts/tegra20.dtsi                     |    6 +
 arch/arm/boot/dts/tegra30.dtsi                     |    6 +
 arch/arm/mach-tegra/board-dt-tegra20.c             |    1 +
 arch/arm/mach-tegra/board-dt-tegra30.c             |    3 +
 arch/arm/mach-tegra/tegra2_clocks.c                |   37 +-
 arch/arm/plat-pxa/Makefile                         |    1 -
 arch/arm/plat-pxa/pwm.c                            |  304 -----------
 arch/blackfin/Kconfig                              |   10 -
 arch/blackfin/kernel/Makefile                      |    1 -
 arch/blackfin/kernel/pwm.c                         |  100 ----
 drivers/Kconfig                                    |    2 +
 drivers/Makefile                                   |    1 +
 drivers/of/Kconfig                                 |    6 +
 drivers/pwm/Kconfig                                |   40 ++
 drivers/pwm/Makefile                               |    4 +
 drivers/pwm/core.c                                 |  557 ++++++++++++++++++++
 drivers/pwm/pwm-bfin.c                             |  164 ++++++
 drivers/pwm/pwm-pxa.c                              |  244 +++++++++
 drivers/pwm/pwm-tegra.c                            |  267 ++++++++++
 drivers/video/backlight/Kconfig                    |    2 +-
 drivers/video/backlight/pwm_bl.c                   |  136 ++++-
 include/linux/of_pwm.h                             |   36 ++
 include/linux/pwm.h                                |   97 ++++
 include/linux/pwm_backlight.h                      |    2 +
 29 files changed, 1732 insertions(+), 442 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/tegra-pwm.txt
 create mode 100644 Documentation/devicetree/bindings/video/backlight/pwm-backlight
 create mode 100644 Documentation/pwm.txt
 delete mode 100644 arch/arm/plat-pxa/pwm.c
 delete mode 100644 arch/blackfin/kernel/pwm.c
 create mode 100644 drivers/pwm/Kconfig
 create mode 100644 drivers/pwm/Makefile
 create mode 100644 drivers/pwm/core.c
 create mode 100644 drivers/pwm/pwm-bfin.c
 create mode 100644 drivers/pwm/pwm-pxa.c
 create mode 100644 drivers/pwm/pwm-tegra.c
 create mode 100644 include/linux/of_pwm.h

-- 
1.7.9.4

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2012-04-04 18:33 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-14 15:56 [PATCH v4 00/10] Add PWM framework and device tree support Thierry Reding
2012-03-14 15:56 ` [PATCH v4 01/10] PWM: add pwm framework support Thierry Reding
     [not found]   ` <1331740593-10807-2-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-14 20:52     ` Lars-Peter Clausen
     [not found]       ` <4F610517.7090006-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2012-03-14 20:57         ` Thierry Reding
2012-03-16  7:19     ` Shawn Guo
     [not found]       ` <20120316071951.GB7758-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-03-16  7:28         ` Thierry Reding
2012-03-20  1:55     ` Stephen Warren
     [not found]       ` <4F67E38F.6080300-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20  5:59         ` Thierry Reding
     [not found] ` <1331740593-10807-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-14 15:56   ` [PATCH v4 02/10] pwm: Allow chips to support multiple PWMs Thierry Reding
     [not found]     ` <1331740593-10807-3-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-14 20:42       ` H Hartley Sweeten
     [not found]         ` <ADE657CA350FB648AAC2C43247A983F0020695DB57DC-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2012-03-14 20:49           ` Thierry Reding
     [not found]             ` <20120314204935.GB12334-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-15  0:42               ` H Hartley Sweeten
2012-03-14 15:56   ` [PATCH v4 03/10] pwm: Add device tree support Thierry Reding
     [not found]     ` <1331740593-10807-4-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-14 20:11       ` Sascha Hauer
     [not found]         ` <20120314201138.GU3852-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-03-14 20:46           ` Thierry Reding
2012-03-15  8:40       ` Arnd Bergmann
     [not found]         ` <201203150840.42659.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-15 10:29           ` Mark Brown
     [not found]             ` <20120315102944.GB3138-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-03-15 12:44               ` Arnd Bergmann
2012-03-20  2:12       ` Stephen Warren
     [not found]         ` <4F67E7A3.3090603-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20  5:51           ` Thierry Reding
2012-03-14 15:56   ` [PATCH v4 04/10] ARM: tegra: Fix PWM clock programming Thierry Reding
     [not found]     ` <1331740593-10807-5-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-20  2:15       ` Stephen Warren
2012-03-14 15:56   ` [PATCH v4 05/10] ARM: tegra: Provide clock for only one PWM controller Thierry Reding
     [not found]     ` <1331740593-10807-6-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-20  2:18       ` Stephen Warren
     [not found]         ` <4F67E8E4.7000604-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20  8:44           ` Thierry Reding
     [not found]             ` <20120320084403.GB20249-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-03-20 15:27               ` Stephen Warren
2012-03-14 15:56   ` [PATCH v4 06/10] pwm: Add NVIDIA Tegra SoC support Thierry Reding
     [not found]     ` <1331740593-10807-7-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-16  8:00       ` Shawn Guo
     [not found]         ` <20120316080025.GD7758-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-03-16  8:21           ` Thierry Reding
2012-03-20  2:35       ` Stephen Warren
2012-03-14 15:56   ` [PATCH v4 07/10] pwm: tegra: Add device tree support Thierry Reding
     [not found]     ` <1331740593-10807-8-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-20  2:42       ` Stephen Warren
     [not found]         ` <4F67EE9A.6080101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20  8:48           ` Thierry Reding
     [not found]             ` <20120320084807.GC20249-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-03-20 15:33               ` Stephen Warren
     [not found]                 ` <4F68A32D.1000402-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20 15:44                   ` Thierry Reding
2012-04-04  7:04           ` Shawn Guo
     [not found]             ` <20120404070432.GF7264-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-04 18:33               ` Stephen Warren
2012-03-14 15:56   ` [PATCH v4 08/10] pwm: Add Blackfin support Thierry Reding
2012-03-14 15:56   ` [PATCH v4 09/10] pwm: Add PXA support Thierry Reding
     [not found]     ` <1331740593-10807-10-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-15  0:13       ` Ryan Mallon
     [not found]         ` <4F61343A.80103-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-15  6:56           ` Thierry Reding
     [not found]             ` <20120315065631.GB20502-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-15  9:05               ` Sascha Hauer
     [not found]                 ` <20120315090540.GW3852-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-03-15  9:21                   ` Thierry Reding
     [not found]                     ` <20120315092134.GA29841-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-03-15  9:45                       ` Sascha Hauer
2012-03-16  8:12       ` Shawn Guo
     [not found]         ` <20120316081222.GE7758-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-03-16  8:29           ` Thierry Reding
2012-03-14 15:56   ` [PATCH v4 10/10] pwm-backlight: Add rudimentary device tree support Thierry Reding
     [not found]     ` <1331740593-10807-11-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-03-15  8:48       ` Arnd Bergmann
2012-03-20  2:59       ` Stephen Warren
     [not found]         ` <4F67F2AF.3020404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20  8:39           ` Thierry Reding
     [not found]             ` <20120320083943.GA20249-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-03-20 15:27               ` Stephen Warren
     [not found]                 ` <4F68A1C8.5080608-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20 15:43                   ` Thierry Reding
     [not found]                     ` <20120320154330.GA8651-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-20 15:56                       ` Stephen Warren
     [not found]                         ` <4F68A899.3030009-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-03-20 16:08                           ` Mark Brown
2012-03-14 23:19 ` [PATCH v4 00/10] Add PWM framework and " H Hartley Sweeten
     [not found]   ` <ADE657CA350FB648AAC2C43247A983F0020695DB5858-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2012-03-15  6:41     ` Thierry Reding

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).