From: Thierry Reding <thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Matthias Kaehlcke
<matthias-RprLehDfhQ3k1uMJSBkQmQ@public.gmane.org>,
Kurt Van Dijck <kurt.van.dijck-/BeEPy95v10@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
Richard Purdie <rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org>,
Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>,
Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>,
Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
Ryan Mallon <rmallon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v3 00/10] Add PWM framework and device tree support.
Date: Wed, 22 Feb 2012 16:17:11 +0100 [thread overview]
Message-ID: <1329923841-32017-1-git-send-email-thierry.reding@avionic-design.de> (raw)
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). When this series is ready I think it would
be best to merge patches 1 and 2. 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, so it should be easy to add an API to request a PWM device on
a per-chip basis and get rid of the global namespace eventually. 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. 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 20120222. I think I've
addressed all of the concerns raised in the first two 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.
of: Add PWM support.
arm/tegra: Provide clock for only one PWM controller
pwm: Add NVIDIA Tegra SoC support
arm/tegra: Add PWFM controller device tree probing
pwm: Add Blackfin support
pwm: Add PXA support
pwm-backlight: Add rudimentary device tree support
Documentation/devicetree/bindings/pwm/pwm.txt | 48 +++
.../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/clock.h | 1 +
arch/arm/mach-tegra/tegra2_clocks.c | 33 ++-
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/of/Makefile | 1 +
drivers/of/pwm.c | 130 +++++++
drivers/pwm/Kconfig | 40 ++
drivers/pwm/Makefile | 4 +
drivers/pwm/core.c | 381 ++++++++++++++++++++
drivers/pwm/pwm-bfin.c | 164 +++++++++
drivers/pwm/pwm-pxa.c | 244 +++++++++++++
drivers/pwm/pwm-tegra.c | 263 ++++++++++++++
drivers/video/backlight/Kconfig | 2 +-
drivers/video/backlight/pwm_bl.c | 113 ++++++-
include/linux/of_pwm.h | 51 +++
include/linux/pwm.h | 89 +++++
include/linux/pwm_backlight.h | 1 +
31 files changed, 1652 insertions(+), 435 deletions(-)
create mode 100644 Documentation/devicetree/bindings/pwm/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/of/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.1
next reply other threads:[~2012-02-22 15:17 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 15:17 Thierry Reding [this message]
[not found] ` <1329923841-32017-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-22 15:17 ` [PATCH v3 01/10] PWM: add pwm framework support Thierry Reding
2012-02-22 15:17 ` [PATCH v3 02/10] pwm: Allow chips to support multiple PWMs Thierry Reding
[not found] ` <1329923841-32017-3-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-22 16:34 ` Arnd Bergmann
[not found] ` <201202221634.45159.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-23 8:12 ` Thierry Reding
[not found] ` <20120223081235.GC8621-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-02-23 14:07 ` Arnd Bergmann
[not found] ` <201202231407.12981.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-23 16:04 ` Thierry Reding
[not found] ` <20120223160420.GA9899-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-03 19:32 ` Thierry Reding
[not found] ` <20120303193249.GA22021-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-06 15:38 ` Arnd Bergmann
[not found] ` <201203061538.11709.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-06 19:17 ` Thierry Reding
2012-02-22 15:17 ` [PATCH v3 03/10] of: Add PWM support Thierry Reding
[not found] ` <1329923841-32017-4-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-22 16:15 ` Arnd Bergmann
[not found] ` <201202221615.11605.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-23 7:55 ` Thierry Reding
[not found] ` <20120223075537.GB8621-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-02-23 14:03 ` Arnd Bergmann
[not found] ` <201202231403.01614.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-24 6:47 ` Thierry Reding
[not found] ` <20120224064749.GB18786-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-02-24 16:58 ` Arnd Bergmann
[not found] ` <201202241658.32062.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-25 12:33 ` Sascha Hauer
[not found] ` <20120225123357.GU3852-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-25 23:08 ` Ryan Mallon
2012-02-22 15:17 ` [PATCH v3 04/10] arm/tegra: Fix PWM clock programming Thierry Reding
[not found] ` <1329923841-32017-5-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-28 21:01 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1E52-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-03-03 22:47 ` Thierry Reding
[not found] ` <20120303224751.GB6661-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-05 17:33 ` Stephen Warren
2012-02-22 15:17 ` [PATCH v3 05/10] arm/tegra: Provide clock for only one PWM controller Thierry Reding
2012-02-22 15:17 ` [PATCH v3 06/10] pwm: Add NVIDIA Tegra SoC support Thierry Reding
[not found] ` <1329923841-32017-7-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-23 1:47 ` Ryan Mallon
[not found] ` <4F459A94.4030104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-23 8:14 ` Thierry Reding
[not found] ` <20120223081459.GD8621-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-02-23 9:25 ` Ryan Mallon
[not found] ` <4F460616.3080400-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-24 6:48 ` Thierry Reding
2012-02-28 21:14 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1E63-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-03-03 22:42 ` Thierry Reding
[not found] ` <20120303224212.GA6661-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-05 3:39 ` Olof Johansson
[not found] ` <20120305033935.GA32675-O5ziIzlqnXUVNXGz7ipsyg@public.gmane.org>
2012-03-05 7:00 ` Thierry Reding
2012-02-22 15:17 ` [PATCH v3 08/10] pwm: Add Blackfin support Thierry Reding
2012-02-22 15:17 ` [PATCH v3 09/10] pwm: Add PXA support Thierry Reding
[not found] ` <1329923841-32017-10-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-22 15:40 ` Arnd Bergmann
[not found] ` <201202221540.16897.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-23 6:10 ` Thierry Reding
2012-02-22 15:17 ` [PATCH v3 10/10] pwm-backlight: Add rudimentary device tree support Thierry Reding
2012-02-22 16:02 ` [PATCH v3 00/10] Add PWM framework and " Arnd Bergmann
[not found] ` <201202221602.09116.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-23 7:29 ` Thierry Reding
2012-02-22 15:17 ` [PATCH v3 07/10] arm/tegra: Add PWFM controller device tree probing Thierry Reding
[not found] ` <1329923841-32017-8-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-28 21:20 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1E67-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-03-03 22:54 ` Thierry Reding
[not found] ` <20120303225404.GC6661-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-04 20:39 ` Arnd Bergmann
2012-03-05 17:51 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BE861C46-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-03-05 18:15 ` Thierry Reding
[not found] ` <20120305181555.GA22459-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-03-05 18:39 ` Stephen Warren
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=1329923841-32017-1-git-send-email-thierry.reding@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=rmallon-Re5JQEeQqe8AvxtiuMwx3w@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 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).