Skip to content

Commit 070d9a9

Browse files
committed
Merge branch 'for-4.8/drivers' into for-next
2 parents bd26861 + 1f0d3bb commit 070d9a9

21 files changed

+1198
-240
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Broadcom iProc PWM controller device tree bindings
2+
3+
This controller has 4 channels.
4+
5+
Required Properties :
6+
- compatible: must be "brcm,iproc-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+
12+
Refer to clocks/clock-bindings.txt for generic clock consumer properties.
13+
14+
Example:
15+
16+
pwm: pwm@18031000 {
17+
compatible = "brcm,iproc-pwm";
18+
reg = <0x18031000 0x28>;
19+
clocks = <&osc>;
20+
#pwm-cells = <3>;
21+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
* PWM controlled by ChromeOS EC
2+
3+
Google's ChromeOS EC PWM is a simple PWM attached to the Embedded Controller
4+
(EC) and controlled via a host-command interface.
5+
6+
An EC PWM node should be only found as a sub-node of the EC node (see
7+
Documentation/devicetree/bindings/mfd/cros-ec.txt).
8+
9+
Required properties:
10+
- compatible: Must contain "google,cros-ec-pwm"
11+
- #pwm-cells: Should be 1. The cell specifies the PWM index.
12+
13+
Example:
14+
cros-ec@0 {
15+
compatible = "google,cros-ec-spi";
16+
17+
...
18+
19+
cros_ec_pwm: ec-pwm {
20+
compatible = "google,cros-ec-pwm";
21+
#pwm-cells = <1>;
22+
};
23+
};

Documentation/devicetree/bindings/pwm/nvidia,tegra20-pwm.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
Tegra SoC PWFM controller
22

33
Required properties:
4-
- compatible: For Tegra20, must contain "nvidia,tegra20-pwm". For Tegra30,
5-
must contain "nvidia,tegra30-pwm". Otherwise, must contain
6-
"nvidia,<chip>-pwm", plus one of the above, where <chip> is tegra114,
7-
tegra124, tegra132, or tegra210.
4+
- compatible: Must be:
5+
- "nvidia,tegra20-pwm": for Tegra20
6+
- "nvidia,tegra30-pwm", "nvidia,tegra20-pwm": for Tegra30
7+
- "nvidia,tegra114-pwm", "nvidia,tegra20-pwm": for Tegra114
8+
- "nvidia,tegra124-pwm", "nvidia,tegra20-pwm": for Tegra124
9+
- "nvidia,tegra132-pwm", "nvidia,tegra20-pwm": for Tegra132
10+
- "nvidia,tegra210-pwm", "nvidia,tegra20-pwm": for Tegra210
11+
- "nvidia,tegra186-pwm": for Tegra186
812
- reg: physical base address and length of the controller's registers
913
- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
1014
the cells format.

Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Optional properties:
1515

1616
Example:
1717

18-
ehrpwm0: ehrpwm@0 { /* EHRPWM on am33xx */
18+
ehrpwm0: pwm@48300200 { /* EHRPWM on am33xx */
1919
compatible = "ti,am33xx-ehrpwm";
2020
#pwm-cells = <3>;
2121
reg = <0x48300200 0x100>;
2222
ti,hwmods = "ehrpwm0";
2323
};
2424

25-
ehrpwm0: ehrpwm@0 { /* EHRPWM on da850 */
25+
ehrpwm0: pwm@300000 { /* EHRPWM on da850 */
2626
compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
2727
#pwm-cells = <3>;
2828
reg = <0x300000 0x2000>;

Documentation/devicetree/bindings/pwm/renesas,pwm-rcar.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Required Properties:
77
- "renesas,pwm-r8a7790": for R-Car H2
88
- "renesas,pwm-r8a7791": for R-Car M2-W
99
- "renesas,pwm-r8a7794": for R-Car E2
10+
- "renesas,pwm-r8a7795": for R-Car H3
1011
- reg: base address and length of the registers block for the PWM.
1112
- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
1213
the cells format.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
== ST STMPE PWM controller ==
2+
3+
This is a PWM block embedded in the ST Microelectronics STMPE
4+
(ST Multi-Purpose Expander) chips. The PWM is registered as a
5+
subdevices of the STMPE MFD device.
6+
7+
Required properties:
8+
- compatible: should be:
9+
- "st,stmpe-pwm"
10+
- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
11+
the cells format.
12+
13+
Example:
14+
15+
pwm0: pwm {
16+
compatible = "st,stmpe-pwm";
17+
#pwm-cells = <2>;
18+
};

drivers/pwm/Kconfig

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ config PWM_ATMEL_TCB
7474
To compile this driver as a module, choose M here: the module
7575
will be called pwm-atmel-tcb.
7676

77+
config PWM_BCM_IPROC
78+
tristate "iProc PWM support"
79+
depends on ARCH_BCM_IPROC
80+
help
81+
Generic PWM framework driver for Broadcom iProc PWM block. This
82+
block is used in Broadcom iProc SoC's.
83+
84+
To compile this driver as a module, choose M here: the module
85+
will be called pwm-bcm-iproc.
86+
7787
config PWM_BCM_KONA
7888
tristate "Kona PWM support"
7989
depends on ARCH_BCM_MOBILE
@@ -137,6 +147,13 @@ config PWM_CRC
137147
Generic PWM framework driver for Crystalcove (CRC) PMIC based PWM
138148
control.
139149

150+
config PWM_CROS_EC
151+
tristate "ChromeOS EC PWM driver"
152+
depends on MFD_CROS_EC
153+
help
154+
PWM driver for exposing a PWM attached to the ChromeOS Embedded
155+
Controller.
156+
140157
config PWM_EP93XX
141158
tristate "Cirrus Logic EP93xx PWM support"
142159
depends on ARCH_EP93XX
@@ -305,7 +322,7 @@ config PWM_PXA
305322

306323
config PWM_RCAR
307324
tristate "Renesas R-Car PWM support"
308-
depends on ARCH_RCAR_GEN1 || ARCH_RCAR_GEN2 || COMPILE_TEST
325+
depends on ARCH_RENESAS || COMPILE_TEST
309326
depends on HAS_IOMEM
310327
help
311328
This driver exposes the PWM Timer controller found in Renesas
@@ -362,6 +379,13 @@ config PWM_STI
362379
To compile this driver as a module, choose M here: the module
363380
will be called pwm-sti.
364381

382+
config PWM_STMPE
383+
bool "STMPE expander PWM export"
384+
depends on MFD_STMPE
385+
help
386+
This enables support for the PWMs found in the STMPE I/O
387+
expanders.
388+
365389
config PWM_SUN4I
366390
tristate "Allwinner PWM support"
367391
depends on ARCH_SUNXI || COMPILE_TEST

drivers/pwm/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o
44
obj-$(CONFIG_PWM_ATMEL) += pwm-atmel.o
55
obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o
66
obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o
7+
obj-$(CONFIG_PWM_BCM_IPROC) += pwm-bcm-iproc.o
78
obj-$(CONFIG_PWM_BCM_KONA) += pwm-bcm-kona.o
89
obj-$(CONFIG_PWM_BCM2835) += pwm-bcm2835.o
910
obj-$(CONFIG_PWM_BERLIN) += pwm-berlin.o
1011
obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o
1112
obj-$(CONFIG_PWM_BRCMSTB) += pwm-brcmstb.o
1213
obj-$(CONFIG_PWM_CLPS711X) += pwm-clps711x.o
1314
obj-$(CONFIG_PWM_CRC) += pwm-crc.o
15+
obj-$(CONFIG_PWM_CROS_EC) += pwm-cros-ec.o
1416
obj-$(CONFIG_PWM_EP93XX) += pwm-ep93xx.o
1517
obj-$(CONFIG_PWM_FSL_FTM) += pwm-fsl-ftm.o
1618
obj-$(CONFIG_PWM_IMG) += pwm-img.o
@@ -34,6 +36,7 @@ obj-$(CONFIG_PWM_ROCKCHIP) += pwm-rockchip.o
3436
obj-$(CONFIG_PWM_SAMSUNG) += pwm-samsung.o
3537
obj-$(CONFIG_PWM_SPEAR) += pwm-spear.o
3638
obj-$(CONFIG_PWM_STI) += pwm-sti.o
39+
obj-$(CONFIG_PWM_STMPE) += pwm-stmpe.o
3740
obj-$(CONFIG_PWM_SUN4I) += pwm-sun4i.o
3841
obj-$(CONFIG_PWM_TEGRA) += pwm-tegra.o
3942
obj-$(CONFIG_PWM_TIECAP) += pwm-tiecap.o

drivers/pwm/pwm-atmel.c

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ struct atmel_pwm_chip {
6464
void __iomem *base;
6565

6666
unsigned int updated_pwms;
67-
struct mutex isr_lock; /* ISR is cleared when read, ensure only one thread does that */
67+
/* ISR is cleared when read, ensure only one thread does that */
68+
struct mutex isr_lock;
6869

6970
void (*config)(struct pwm_chip *chip, struct pwm_device *pwm,
7071
unsigned long dty, unsigned long prd);
@@ -271,6 +272,16 @@ static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
271272
mutex_unlock(&atmel_pwm->isr_lock);
272273
atmel_pwm_writel(atmel_pwm, PWM_DIS, 1 << pwm->hwpwm);
273274

275+
/*
276+
* Wait for the PWM channel disable operation to be effective before
277+
* stopping the clock.
278+
*/
279+
timeout = jiffies + 2 * HZ;
280+
281+
while ((atmel_pwm_readl(atmel_pwm, PWM_SR) & (1 << pwm->hwpwm)) &&
282+
time_before(jiffies, timeout))
283+
usleep_range(10, 100);
284+
274285
clk_disable(atmel_pwm->clk);
275286
}
276287

@@ -324,21 +335,14 @@ MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids);
324335
static inline const struct atmel_pwm_data *
325336
atmel_pwm_get_driver_data(struct platform_device *pdev)
326337
{
327-
if (pdev->dev.of_node) {
328-
const struct of_device_id *match;
329-
330-
match = of_match_device(atmel_pwm_dt_ids, &pdev->dev);
331-
if (!match)
332-
return NULL;
338+
const struct platform_device_id *id;
333339

334-
return match->data;
335-
} else {
336-
const struct platform_device_id *id;
340+
if (pdev->dev.of_node)
341+
return of_device_get_match_data(&pdev->dev);
337342

338-
id = platform_get_device_id(pdev);
343+
id = platform_get_device_id(pdev);
339344

340-
return (struct atmel_pwm_data *)id->driver_data;
341-
}
345+
return (struct atmel_pwm_data *)id->driver_data;
342346
}
343347

344348
static int atmel_pwm_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)