aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-11 17:06:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-11 17:06:55 -0400
commit7f33e7241d3dbad3c0563fd1fc79fc9380b5c351 (patch)
tree4f0f72e0954e9a5a60679780a4cdf0bf243d47e1
parent2dc24b0d0636349d403ae803bbad0c84f6c2ea57 (diff)
parent39fd3f99aba3f7683fc9b62e916e4c886a1cb6b0 (diff)
Merge tag 'pwm/for-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm changes from Thierry Reding: "The majority of these changes are cleanups and fixes across all drivers. Redundant error messages are removed and more PWM controllers set the .can_sleep flag to signal that they can't be used in atomic context. Support is added for the Broadcom Kona family of SoCs and the Intel LPSS driver can now probe PCI devices in addition to ACPI devices. Upon shutdown, the pwm-backlight driver will now power off the backlight. It also uses the new descriptor-based GPIO API for more concise GPIO handling. A large chunk of these changes also converts platforms to use the lookup mechanism rather than relying on the global number space to reference PWM devices. This is largely in preparation for more unification and cleanups in future patches. Eventually it will allow the legacy PWM API to be removed" * tag 'pwm/for-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (38 commits) pwm: fsl-ftm: set pwm_chip can_sleep flag pwm: ab8500: Fix wrong value shift for disable/enable PWM pwm: samsung: do not set manual update bit in pwm_samsung_config pwm: lp3943: Set pwm_chip can_sleep flag pwm: atmel: set pwm_chip can_sleep flag pwm: mxs: set pwm_chip can_sleep flag pwm: tiehrpwm: inline accessor functions pwm: tiehrpwm: don't build PM related functions when not needed pwm-backlight: retrieve configured PWM period leds: leds-pwm: retrieve configured PWM period ARM: pxa: hx4700: use PWM_LOOKUP to initialize struct pwm_lookup ARM: shmobile: armadillo: use PWM_LOOKUP to initialize struct pwm_lookup ARM: OMAP3: Beagle: use PWM_LOOKUP to initialize struct pwm_lookup pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members ARM: pxa: hx4700: initialize all the struct pwm_lookup members ARM: OMAP3: Beagle: initialize all the struct pwm_lookup members pwm: renesas-tpu: remove unused struct tpu_pwm_platform_data ARM: shmobile: armadillo: initialize all struct pwm_lookup members pwm: add period and polarity to struct pwm_lookup pwm: twl: Really disable twl6030 PWMs ...
-rw-r--r--Documentation/devicetree/bindings/pwm/bcm-kona-pwm.txt21
-rw-r--r--Documentation/pwm.txt10
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c3
-rw-r--r--arch/arm/mach-pxa/hx4700.c3
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c14
-rw-r--r--arch/arm/plat-samsung/dev-backlight.c2
-rw-r--r--drivers/leds/leds-pwm.c5
-rw-r--r--drivers/pwm/Kconfig9
-rw-r--r--drivers/pwm/Makefile1
-rw-r--r--drivers/pwm/core.c8
-rw-r--r--drivers/pwm/pwm-ab8500.c13
-rw-r--r--drivers/pwm/pwm-atmel.c1
-rw-r--r--drivers/pwm/pwm-bcm-kona.c318
-rw-r--r--drivers/pwm/pwm-fsl-ftm.c1
-rw-r--r--drivers/pwm/pwm-imx.c4
-rw-r--r--drivers/pwm/pwm-lp3943.c1
-rw-r--r--drivers/pwm/pwm-lpss.c161
-rw-r--r--drivers/pwm/pwm-mxs.c1
-rw-r--r--drivers/pwm/pwm-pxa.c4
-rw-r--r--drivers/pwm/pwm-renesas-tpu.c23
-rw-r--r--drivers/pwm/pwm-samsung.c3
-rw-r--r--drivers/pwm/pwm-spear.c6
-rw-r--r--drivers/pwm/pwm-tegra.c4
-rw-r--r--drivers/pwm/pwm-tiecap.c4
-rw-r--r--drivers/pwm/pwm-tiehrpwm.c10
-rw-r--r--drivers/pwm/pwm-twl.c8
-rw-r--r--drivers/pwm/pwm-vt8500.c4
-rw-r--r--drivers/video/backlight/pwm_bl.c87
-rw-r--r--include/linux/platform_data/pwm-renesas-tpu.h16
-rw-r--r--include/linux/pwm.h6
-rw-r--r--include/linux/pwm_backlight.h5
31 files changed, 578 insertions, 178 deletions
diff --git a/Documentation/devicetree/bindings/pwm/bcm-kona-pwm.txt b/Documentation/devicetree/bindings/pwm/bcm-kona-pwm.txt
new file mode 100644
index 000000000000..8eae9fe7841c
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/bcm-kona-pwm.txt
@@ -0,0 +1,21 @@
1Broadcom Kona PWM controller device tree bindings
2
3This controller has 6 channels.
4
5Required Properties :
6- compatible: should contain "brcm,kona-pwm"
7- reg: physical base address and length of the controller's registers
8- clocks: phandle + clock specifier pair for the external clock
9- #pwm-cells: Should be 3. See pwm.txt in this directory for a
10 description of the cells format.
11
12Refer to clocks/clock-bindings.txt for generic clock consumer properties.
13
14Example:
15
16pwm: pwm@3e01a000 {
17 compatible = "brcm,bcm11351-pwm", "brcm,kona-pwm";
18 reg = <0x3e01a000 0xc4>;
19 clocks = <&pwm_clk>;
20 #pwm-cells = <3>;
21};
diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt
index 93cb97974986..ca895fd211e4 100644
--- a/Documentation/pwm.txt
+++ b/Documentation/pwm.txt
@@ -19,7 +19,8 @@ should instead register a static mapping that can be used to match PWM
19consumers to providers, as given in the following example: 19consumers to providers, as given in the following example:
20 20
21 static struct pwm_lookup board_pwm_lookup[] = { 21 static struct pwm_lookup board_pwm_lookup[] = {
22 PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL), 22 PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL,
23 50000, PWM_POLARITY_NORMAL),
23 }; 24 };
24 25
25 static void __init board_init(void) 26 static void __init board_init(void)
@@ -97,6 +98,13 @@ pwm_chip as argument which provides a description of the PWM chip, the
97number of PWM devices provided by the chip and the chip-specific 98number of PWM devices provided by the chip and the chip-specific
98implementation of the supported PWM operations to the framework. 99implementation of the supported PWM operations to the framework.
99 100
101When implementing polarity support in a PWM driver, make sure to respect the
102signal conventions in the PWM framework. By definition, normal polarity
103characterizes a signal starts high for the duration of the duty cycle and
104goes low for the remainder of the period. Conversely, a signal with inversed
105polarity starts low for the duration of the duty cycle and goes high for the
106remainder of the period.
107
100Locking 108Locking
101------- 109-------
102 110
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 660bfc5a70d7..e2e52031f056 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -60,7 +60,8 @@
60 60
61static struct pwm_lookup pwm_lookup[] = { 61static struct pwm_lookup pwm_lookup[] = {
62 /* LEDB -> PMU_STAT */ 62 /* LEDB -> PMU_STAT */
63 PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat"), 63 PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat",
64 7812500, PWM_POLARITY_NORMAL),
64}; 65};
65 66
66static struct led_pwm pwm_leds[] = { 67static struct led_pwm pwm_leds[] = {
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index a7c30eb0c8db..c66ad4edc5e3 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -574,7 +574,8 @@ static struct platform_device backlight = {
574}; 574};
575 575
576static struct pwm_lookup hx4700_pwm_lookup[] = { 576static struct pwm_lookup hx4700_pwm_lookup[] = {
577 PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL), 577 PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL,
578 30923, PWM_POLARITY_NORMAL),
578}; 579};
579 580
580/* 581/*
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 01f81100c330..30fcac73a540 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -31,7 +31,7 @@
31#include <linux/gpio_keys.h> 31#include <linux/gpio_keys.h>
32#include <linux/regulator/driver.h> 32#include <linux/regulator/driver.h>
33#include <linux/pinctrl/machine.h> 33#include <linux/pinctrl/machine.h>
34#include <linux/platform_data/pwm-renesas-tpu.h> 34#include <linux/pwm.h>
35#include <linux/pwm_backlight.h> 35#include <linux/pwm_backlight.h>
36#include <linux/regulator/fixed.h> 36#include <linux/regulator/fixed.h>
37#include <linux/regulator/gpio-regulator.h> 37#include <linux/regulator/gpio-regulator.h>
@@ -399,24 +399,16 @@ static struct resource pwm_resources[] = {
399 }, 399 },
400}; 400};
401 401
402static struct tpu_pwm_platform_data pwm_device_data = {
403 .channels[2] = {
404 .polarity = PWM_POLARITY_INVERSED,
405 }
406};
407
408static struct platform_device pwm_device = { 402static struct platform_device pwm_device = {
409 .name = "renesas-tpu-pwm", 403 .name = "renesas-tpu-pwm",
410 .id = -1, 404 .id = -1,
411 .dev = {
412 .platform_data = &pwm_device_data,
413 },
414 .num_resources = ARRAY_SIZE(pwm_resources), 405 .num_resources = ARRAY_SIZE(pwm_resources),
415 .resource = pwm_resources, 406 .resource = pwm_resources,
416}; 407};
417 408
418static struct pwm_lookup pwm_lookup[] = { 409static struct pwm_lookup pwm_lookup[] = {
419 PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL), 410 PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL,
411 33333, PWM_POLARITY_INVERSED),
420}; 412};
421 413
422/* LCDC and backlight */ 414/* LCDC and backlight */
diff --git a/arch/arm/plat-samsung/dev-backlight.c b/arch/arm/plat-samsung/dev-backlight.c
index be4ad0b21c08..2157c5b539e6 100644
--- a/arch/arm/plat-samsung/dev-backlight.c
+++ b/arch/arm/plat-samsung/dev-backlight.c
@@ -124,8 +124,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
124 samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns; 124 samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns;