Skip to content

Commit

Permalink
Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Feb 26, 2013
2 parents ed5dc23 + 30f7861 commit 3eb0522
Show file tree
Hide file tree
Showing 14 changed files with 741 additions and 42 deletions.
18 changes: 18 additions & 0 deletions Documentation/devicetree/bindings/pwm/atmel-tcb-pwm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Atmel TCB PWM controller

Required properties:
- compatible: should be "atmel,tcb-pwm"
- #pwm-cells: Should be 3. The first cell specifies the per-chip index
of the PWM to use, the second cell is the period in nanoseconds and
bit 0 in the third cell is used to encode the polarity of PWM output.
Set bit 0 of the third cell in PWM specifier to 1 for inverse polarity &
set to 0 for normal polarity.
- tc-block: The Timer Counter block to use as a PWM chip.

Example:

pwm {
compatible = "atmel,tcb-pwm";
#pwm-cells = <3>;
tc-block = <1>;
};
9 changes: 6 additions & 3 deletions Documentation/devicetree/bindings/pwm/vt8500-pwm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ VIA/Wondermedia VT8500/WM8xxx series SoC PWM controller
Required properties:
- compatible: should be "via,vt8500-pwm"
- reg: physical base address and length of the controller's registers
- #pwm-cells: should be 2. The first cell specifies the per-chip index
of the PWM to use and the second cell is the period in nanoseconds.
- #pwm-cells: Should be 3. Number of cells being used to specify PWM property.
First cell specifies the per-chip index of the PWM to use, the second
cell is the period in nanoseconds and bit 0 in the third cell is used to
encode the polarity of PWM output. Set bit 0 of the third in PWM specifier
to 1 for inverse polarity & set to 0 for normal polarity.
- clocks: phandle to the PWM source clock

Example:

pwm1: pwm@d8220000 {
#pwm-cells = <2>;
#pwm-cells = <3>;
compatible = "via,vt8500-pwm";
reg = <0xd8220000 0x1000>;
clocks = <&clkpwm>;
Expand Down
18 changes: 15 additions & 3 deletions drivers/pwm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ config PWM_AB8500
To compile this driver as a module, choose M here: the module
will be called pwm-ab8500.

config PWM_ATMEL_TCB
tristate "Atmel TC Block PWM support"
depends on ATMEL_TCLIB && OF
help
Generic PWM framework driver for Atmel Timer Counter Block.

A Timer Counter Block provides 6 PWM devices grouped by 2.
Devices in a given group must have the same period.

To compile this driver as a module, choose M here: the module
will be called pwm-atmel-tcb.

config PWM_BFIN
tristate "Blackfin PWM support"
depends on BFIN_GPTIMERS
Expand All @@ -47,7 +59,7 @@ config PWM_BFIN
will be called pwm-bfin.

config PWM_IMX
tristate "i.MX pwm support"
tristate "i.MX PWM support"
depends on ARCH_MXC
help
Generic PWM framework driver for i.MX.
Expand Down Expand Up @@ -104,7 +116,7 @@ config PWM_PXA
will be called pwm-pxa.

config PWM_SAMSUNG
tristate "Samsung pwm support"
tristate "Samsung PWM support"
depends on PLAT_SAMSUNG
help
Generic PWM framework driver for Samsung.
Expand Down Expand Up @@ -183,7 +195,7 @@ config PWM_TWL_LED
will be called pwm-twl-led.

config PWM_VT8500
tristate "vt8500 pwm support"
tristate "vt8500 PWM support"
depends on ARCH_VT8500
help
Generic PWM framework driver for vt8500.
Expand Down
1 change: 1 addition & 0 deletions drivers/pwm/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
obj-$(CONFIG_PWM) += core.o
obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o
obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o
obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o
obj-$(CONFIG_PWM_IMX) += pwm-imx.o
obj-$(CONFIG_PWM_JZ4740) += pwm-jz4740.o
Expand Down
14 changes: 14 additions & 0 deletions drivers/pwm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ int pwm_set_chip_data(struct pwm_device *pwm, void *data)

return 0;
}
EXPORT_SYMBOL_GPL(pwm_set_chip_data);

/**
* pwm_get_chip_data() - get private chip data for a PWM
Expand All @@ -220,6 +221,7 @@ void *pwm_get_chip_data(struct pwm_device *pwm)
{
return pwm ? pwm->chip_data : NULL;
}
EXPORT_SYMBOL_GPL(pwm_get_chip_data);

/**
* pwmchip_add() - register a new PWM chip
Expand Down Expand Up @@ -763,6 +765,18 @@ void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
}
EXPORT_SYMBOL_GPL(devm_pwm_put);

/**
* pwm_can_sleep() - report whether PWM access will sleep
* @pwm: PWM device
*
* It returns true if accessing the PWM can sleep, false otherwise.
*/
bool pwm_can_sleep(struct pwm_device *pwm)
{
return pwm->chip->can_sleep;
}
EXPORT_SYMBOL_GPL(pwm_can_sleep);

#ifdef CONFIG_DEBUG_FS
static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s)
{
Expand Down
Loading

0 comments on commit 3eb0522

Please sign in to comment.