Skip to content

Commit

Permalink
Merge tag 'pwm/for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/thierry.reding/linux-pwm

Pull pwm changes from Thierry Reding:
 "The patches for this release cycle include various enhancements
  (device tree support, better compile coverage, ...) for existing
  drivers.  There is a new driver for Atmel SoCs.

  Various drivers as well as the sysfs support received minor fixes and
  cleanups"

* tag 'pwm/for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: tiecap: Remove duplicate put_sync call
  pwm: tiehrpwm: use dev_err() instead of pr_err()
  pwm: pxa: remove unnecessary space before tabs
  pwm: ep93xx: split module author names
  pwm: use seq_puts() instead of seq_printf()
  pwm: atmel-pwm: Do not unprepare clock after successful registration
  of: Add Atmel PWM controller device tree binding
  pwm: atmel-pwm: Add Atmel PWM controller driver
  backlight: pwm_bl: Remove error message upon devm_kzalloc() failure
  pwm: pca9685: depends on I2C rather than REGMAP_I2C
  pwm: renesas-tpu: Enable driver compilation with COMPILE_TEST
  pwm: jz4740: Use devm_clk_get()
  pwm: jz4740: Pass device to clk_get()
  pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
  pwm: pxa: Add device tree support
  • Loading branch information
Linus Torvalds committed Jan 27, 2014
2 parents 028e219 + 6691a19 commit 398b60a
Show file tree
Hide file tree
Showing 13 changed files with 537 additions and 39 deletions.
33 changes: 33 additions & 0 deletions Documentation/devicetree/bindings/pwm/atmel-pwm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Atmel PWM controller

Required properties:
- compatible: should be one of:
- "atmel,at91sam9rl-pwm"
- "atmel,sama5d3-pwm"
- reg: physical base address and length of the controller's registers
- #pwm-cells: Should be 3. See pwm.txt in this directory for a
description of the cells format.

Example:

pwm0: pwm@f8034000 {
compatible = "atmel,at91sam9rl-pwm";
reg = <0xf8034000 0x400>;
#pwm-cells = <3>;
};

pwmleds {
compatible = "pwm-leds";

d1 {
label = "d1";
pwms = <&pwm0 3 5000 0>
max-brightness = <255>;
};

d2 {
label = "d2";
pwms = <&pwm0 1 5000 1>
max-brightness = <255>;
};
};
30 changes: 30 additions & 0 deletions Documentation/devicetree/bindings/pwm/pxa-pwm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Marvell PWM controller

Required properties:
- compatible: should be one or more of:
- "marvell,pxa250-pwm"
- "marvell,pxa270-pwm"
- "marvell,pxa168-pwm"
- "marvell,pxa910-pwm"
- reg: Physical base address and length of the registers used by the PWM channel
Note that one device instance must be created for each PWM that is used, so the
length covers only the register window for one PWM output, not that of the
entire PWM controller. Currently length is 0x10 for all supported devices.
- #pwm-cells: Should be 1. This cell is used to specify the period in
nanoseconds.

Example PWM device node:

pwm0: pwm@40b00000 {
compatible = "marvell,pxa250-pwm";
reg = <0x40b00000 0x10>;
#pwm-cells = <1>;
};

Example PWM client node:

backlight {
compatible = "pwm-backlight";
pwms = <&pwm0 5000000>;
...
}
14 changes: 12 additions & 2 deletions drivers/pwm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ config PWM_AB8500
To compile this driver as a module, choose M here: the module
will be called pwm-ab8500.

config PWM_ATMEL
tristate "Atmel PWM support"
depends on ARCH_AT91
help
Generic PWM framework driver for Atmel SoC.

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

config PWM_ATMEL_TCB
tristate "Atmel TC Block PWM support"
depends on ATMEL_TCLIB && OF
Expand Down Expand Up @@ -122,7 +131,8 @@ config PWM_MXS

config PWM_PCA9685
tristate "NXP PCA9685 PWM driver"
depends on OF && REGMAP_I2C
depends on OF && I2C
select REGMAP_I2C
help
Generic PWM framework driver for NXP PCA9685 LED controller.

Expand All @@ -149,7 +159,7 @@ config PWM_PXA

config PWM_RENESAS_TPU
tristate "Renesas TPU PWM support"
depends on ARCH_SHMOBILE
depends on ARCH_SHMOBILE || COMPILE_TEST
help
This driver exposes the Timer Pulse Unit (TPU) PWM controller found
in Renesas chips through the PWM API.
Expand Down
1 change: 1 addition & 0 deletions drivers/pwm/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
obj-$(CONFIG_PWM) += core.o
obj-$(CONFIG_PWM_SYSFS) += sysfs.o
obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o
obj-$(CONFIG_PWM_ATMEL) += pwm-atmel.o
obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o
obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o
obj-$(CONFIG_PWM_EP93XX) += pwm-ep93xx.o
Expand Down
6 changes: 3 additions & 3 deletions drivers/pwm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,12 +808,12 @@ static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s)
seq_printf(s, " pwm-%-3d (%-20.20s):", i, pwm->label);

if (test_bit(PWMF_REQUESTED, &pwm->flags))
seq_printf(s, " requested");
seq_puts(s, " requested");

if (test_bit(PWMF_ENABLED, &pwm->flags))
seq_printf(s, " enabled");
seq_puts(s, " enabled");

seq_printf(s, "\n");
seq_puts(s, "\n");
}
}

Expand Down
Loading

0 comments on commit 398b60a

Please sign in to comment.