diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 12:34:29 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 12:34:29 -0500 |
| commit | 3eb05225ee8efb81fe50558f5f9d94e7477ade8f (patch) | |
| tree | 40692236718c808455f1fcdfbc1c6de6a274eb36 | |
| parent | ed5dc2372dba46e0ecd08791b1a0399d313e5cff (diff) | |
| parent | 30f786170352b8264bc7b61c2482713e54accec8 (diff) | |
Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm
Pull PWM changes from Thierry Reding:
"A new driver has been added to support the PWM mode of the timer
counter blocks found on Atmel AT91 SoCs. The VT8500 driver now
supports changing the PWM signal polarity and the TI drivers (EHRPWM
and ECAP) gained suspend and resume functionality.
User drivers can now query the core for whether access to a PWM device
will sleep (if the PWM chip is on a slow bus such as I2C or SPI).
The pwm-backlight driver now handles the backlight BL_CORE_FBBLANK
state in addition to the FB layer's blanking states.
To round things off, a few fixes and cleanups are also included"
* tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm:
pwm: twl: Use to_twl() instead of container_of()
pwm: tegra: assume CONFIG_OF
pwm_backlight: Validate dft_brightness in main probe function
pwm: Export pwm_{set,get}_chip_data()
pwm: Make Kconfig entries more consistent
pwm: Add can_sleep property to drivers
pwm: Add pwm_can_sleep() as exported API to users
pwm-backlight: handle BL_CORE_FBBLANK state
pwm: pwm-tiecap: Low power sleep support
pwm: pwm-tiehrpwm: Low power sleep support
pwm: pwm-tiehrpwm: Update the clock handling of pwm-tiehrpwm driver
pwm: vt8500: Add polarity support
pwm: vt8500: Register write busy test performed incorrectly
pwm: atmel: add Timer Counter Block PWM driver
| -rw-r--r-- | Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt | 18 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/pwm/vt8500-pwm.txt | 9 | ||||
| -rw-r--r-- | drivers/pwm/Kconfig | 18 | ||||
| -rw-r--r-- | drivers/pwm/Makefile | 1 | ||||
| -rw-r--r-- | drivers/pwm/core.c | 14 | ||||
| -rw-r--r-- | drivers/pwm/pwm-atmel-tcb.c | 445 | ||||
| -rw-r--r-- | drivers/pwm/pwm-tegra.c | 4 | ||||
| -rw-r--r-- | drivers/pwm/pwm-tiecap.c | 53 | ||||
| -rw-r--r-- | drivers/pwm/pwm-tiehrpwm.c | 93 | ||||
| -rw-r--r-- | drivers/pwm/pwm-twl-led.c | 1 | ||||
| -rw-r--r-- | drivers/pwm/pwm-twl.c | 10 | ||||
| -rw-r--r-- | drivers/pwm/pwm-vt8500.c | 87 | ||||
| -rw-r--r-- | drivers/video/backlight/pwm_bl.c | 20 | ||||
| -rw-r--r-- | include/linux/pwm.h | 10 |
14 files changed, 741 insertions, 42 deletions
diff --git a/Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt new file mode 100644 index 000000000000..de0eaed86651 --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | Atmel TCB PWM controller | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible: should be "atmel,tcb-pwm" | ||
| 5 | - #pwm-cells: Should be 3. The first cell specifies the per-chip index | ||
| 6 | of the PWM to use, the second cell is the period in nanoseconds and | ||
| 7 | bit 0 in the third cell is used to encode the polarity of PWM output. | ||
| 8 | Set bit 0 of the third cell in PWM specifier to 1 for inverse polarity & | ||
| 9 | set to 0 for normal polarity. | ||
| 10 | - tc-block: The Timer Counter block to use as a PWM chip. | ||
| 11 | |||
| 12 | Example: | ||
| 13 | |||
| 14 | pwm { | ||
| 15 | compatible = "atmel,tcb-pwm"; | ||
| 16 | #pwm-cells = <3>; | ||
| 17 | tc-block = <1>; | ||
| 18 | }; | ||
diff --git a/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt b/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt index bcc63678a9a5..d21d82d29855 100644 --- a/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt +++ b/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt | |||
| @@ -3,14 +3,17 @@ VIA/Wondermedia VT8500/WM8xxx series SoC PWM controller | |||
| 3 | Required properties: | 3 | Required properties: |
| 4 | - compatible: should be "via,vt8500-pwm" | 4 | - compatible: should be "via,vt8500-pwm" |
| 5 | - reg: physical base address and length of the controller's registers | 5 | - reg: physical base address and length of the controller's registers |
| 6 | - #pwm-cells: should be 2. The first cell specifies the per-chip index | 6 | - #pwm-cells: Should be 3. Number of cells being used to specify PWM property. |
| 7 | of the PWM to use and the second cell is the period in nanoseconds. | 7 | First cell specifies the per-chip index of the PWM to use, the second |
| 8 | cell is the period in nanoseconds and bit 0 in the third cell is used to | ||
| 9 | encode the polarity of PWM output. Set bit 0 of the third in PWM specifier | ||
| 10 | to 1 for inverse polarity & set to 0 for normal polarity. | ||
| 8 | - clocks: phandle to the PWM source clock | 11 | - clocks: phandle to the PWM source clock |
| 9 | 12 | ||
| 10 | Example: | 13 | Example: |
| 11 | 14 | ||
| 12 | pwm1: pwm@d8220000 { | 15 | pwm1: pwm@d8220000 { |
| 13 | #pwm-cells = <2>; | 16 | #pwm-cells = <3>; |
| 14 | compatible = "via,vt8500-pwm"; | 17 | compatible = "via,vt8500-pwm"; |
| 15 | reg = <0xd8220000 0x1000>; | 18 | reg = <0xd8220000 0x1000>; |
| 16 | clocks = <&clkpwm>; | 19 | clocks = <&clkpwm>; |
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index e513cd998170..0e0bfa035083 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig | |||
| @@ -37,6 +37,18 @@ config PWM_AB8500 | |||
| 37 | To compile this driver as a module, choose M here: the module | 37 | To compile this driver as a module, choose M here: the module |
| 38 | will be called pwm-ab8500. | 38 | will be called pwm-ab8500. |
| 39 | 39 | ||
| 40 | config PWM_ATMEL_TCB | ||
| 41 | tristate "Atmel TC Block PWM support" | ||
| 42 | depends on ATMEL_TCLIB && OF | ||
| 43 | help | ||
| 44 | Generic PWM framework driver for Atmel Timer Counter Block. | ||
| 45 | |||
| 46 | A Timer Counter Block provides 6 PWM devices grouped by 2. | ||
| 47 | Devices in a given group must have the same period. | ||
| 48 | |||
| 49 | To compile this driver as a module, choose M here: the module | ||
| 50 | will be called pwm-atmel-tcb. | ||
| 51 | |||
| 40 | config PWM_BFIN | 52 | config PWM_BFIN |
| 41 | tristate "Blackfin PWM support" | 53 | tristate "Blackfin PWM support" |
| 42 | depends on BFIN_GPTIMERS | 54 | depends on BFIN_GPTIMERS |
| @@ -47,7 +59,7 @@ config PWM_BFIN | |||
| 47 | will be called pwm-bfin. | 59 | will be called pwm-bfin. |
| 48 | 60 | ||
| 49 | config PWM_IMX | 61 | config PWM_IMX |
| 50 | tristate "i.MX pwm support" | 62 | tristate "i.MX PWM support" |
| 51 | depends on ARCH_MXC | 63 | depends on ARCH_MXC |
| 52 | help | 64 | help |
| 53 | Generic PWM framework driver for i.MX. | 65 | Generic PWM framework driver for i.MX. |
| @@ -104,7 +116,7 @@ config PWM_PXA | |||
| 104 | will be called pwm-pxa. | 116 | will be called pwm-pxa. |
| 105 | 117 | ||
| 106 | config PWM_SAMSUNG | 118 | config PWM_SAMSUNG |
| 107 | tristate "Samsung pwm support" | 119 | tristate "Samsung PWM support" |
| 108 | depends on PLAT_SAMSUNG | 120 | depends on PLAT_SAMSUNG |
| 109 | help | 121 | help |
| 110 | Generic PWM framework driver for Samsung. | 122 | Generic PWM framework driver for Samsung. |
| @@ -183,7 +195,7 @@ config PWM_TWL_LED | |||
| 183 | will be called pwm-twl-led. | 195 | will be called pwm-twl-led. |
| 184 | 196 | ||
| 185 | config PWM_VT8500 | 197 | config PWM_VT8500 |
| 186 | tristate "vt8500 pwm support" | 198 | tristate "vt8500 PWM support" |
| 187 | depends on ARCH_VT8500 | 199 | depends on ARCH_VT8500 |
| 188 | help | 200 | help |
| 189 | Generic PWM framework driver for vt8500. | 201 | Generic PWM framework driver for vt8500. |
diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 62a2963cfe58..94ba21e24bd6 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | obj-$(CONFIG_PWM) += core.o | 1 | obj-$(CONFIG_PWM) += core.o |
| 2 | obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o | 2 | obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o |
| 3 | obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o | ||
| 3 | obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o | 4 | obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o |
| 4 | obj-$(CONFIG_PWM_IMX) += pwm-imx.o | 5 | obj-$(CONFIG_PWM_IMX) += pwm-imx.o |
| 5 | obj-$(CONFIG_PWM_JZ4740) += pwm-jz4740.o | 6 | obj-$(CONFIG_PWM_JZ4740) += pwm-jz4740.o |
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 4a13da48fefe..32221cb0cbe7 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c | |||
| @@ -211,6 +211,7 @@ int pwm_set_chip_data(struct pwm_device *pwm, void *data) | |||
| 211 | 211 | ||
| 212 | return 0; | 212 | return 0; |
| 213 | } | 213 | } |
| 214 | EXPORT_SYMBOL_GPL(pwm_set_chip_data); | ||
| 214 | 215 | ||
| 215 | /** | 216 | /** |
| 216 | * pwm_get_chip_data() - get private chip data for a PWM | 217 | * pwm_get_chip_data() - get private chip data for a PWM |
| @@ -220,6 +221,7 @@ void *pwm_get_chip_data(struct pwm_device *pwm) | |||
| 220 | { | 221 | { |
| 221 | return pwm ? pwm->chip_data : NULL; | 222 | return pwm ? pwm->chip_data : NULL; |
| 222 | } | 223 | } |
| 224 | EXPORT_SYMBOL_GPL(pwm_get_chip_data); | ||
| 223 | 225 | ||
| 224 | /** | 226 | /** |
| 225 | * pwmchip_add() - register a new PWM chip | 227 | * pwmchip_add() - register a new PWM chip |
| @@ -763,6 +765,18 @@ void devm_pwm_put(struct device *dev, struct pwm_device *pwm) | |||
| 763 | } | 765 | } |
| 764 | EXPORT_SYMBOL_GPL(devm_pwm_put); | 766 | EXPORT_SYMBOL_GPL(devm_pwm_put); |
| 765 | 767 | ||
| 768 | /** | ||
| 769 | * pwm_can_sleep() - report whether PWM access will sleep | ||
| 770 | * @pwm: PWM device | ||
| 771 | * | ||
| 772 | * It returns true if accessing the PWM can sleep, false otherwise. | ||
| 773 | */ | ||
| 774 | bool pwm_can_sleep(struct pwm_device *pwm) | ||
| 775 | { | ||
| 776 | return pwm->chip->can_sleep; | ||
| 777 | } | ||
| 778 | EXPORT_SYMBOL_GPL(pwm_can_sleep); | ||
| 779 | |||
| 766 | #ifdef CONFIG_DEBUG_FS | 780 | #ifdef CONFIG_DEBUG_FS |
| 767 | static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s) | 781 | static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s) |
| 768 | { | 782 | { |
diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c new file mode 100644 index 000000000000..16cb53092857 --- /dev/null +++ b/drivers/pwm/pwm-atmel-tcb.c | |||
| @@ -0,0 +1,445 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) Overkiz SAS 2012 | ||
| 3 | * | ||
| 4 | * Author: Boris BREZILLON <b.brezillon@overkiz.com> | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/module.h> | ||
