Skip to content

Commit c6e63a9

Browse files
committed
Merge tag 'pwm/for-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux
Pull pwm updates from Uwe Kleine-König: "This contains the usual mix of fixes, cleanups, two new drivers and several dt binding updates. The fixes are for minor issues that are already old (4.11-rc1 and 3.9-rc1) and were found by code review and not during usage, so I didn't sent them for earlier inclusion. The changes to include/linux/mfd/stm32-timers.h and drivers/counter/stm32-timer-cnt.c are part of an immutable branch that will also be included in the mfd and counter pulls. It changes some register definitions and affects the pwm-stm32 driver. Thanks go to Andy Shevchenko, AngeloGioacchino Del Regno, Conor Dooley, David Lechner, Dhruva Gole, Drew Fustini, Frank Li, Jeff Johnson, Junyi Zhao, Kelvin Zhang, Krzysztof Kozlowski, Lee Jones, Linus Walleij, Linus Walleij, Michael Hennerich, Nicola Di Lieto, Nicolas Ferre, Nuno Sa, Paul Cercueil, Raag Jadav, Rob Herring, Sean Anderson, Sean Young, Shenwei Wang, Stefan Wahren, Trevor Gamblin, Tzung-Bi Shih, Vincent Whitchurch and William Breathitt Gray for their contributions to this pull request; they authored changes, spend time reviewing changes and coordinated the above mentioned immutable branch" * tag 'pwm/for-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: (38 commits) pwm: axi-pwmgen: add .max_register to regmap dt-bindings: pwm: at91: Add sama7d65 compatible string pwm: atmel-tcb: Make private data variable naming consistent pwm: atmel-tcb: Simplify checking the companion output pwm: Allow pwm state transitions from an invalid state pwm: xilinx: Simplify using devm_ functions pwm: Use guards for pwm_lookup_lock instead of explicity mutex_lock + mutex_unlock pwm: Use guards for export->lock instead of explicity mutex_lock + mutex_unlock pwm: Use guards for pwm_lock instead of explicity mutex_lock + mutex_unlock pwm: Register debugfs operations after the pwm class pwm: imx-tpm: Enable pinctrl setting for sleep state pwm: lpss: drop redundant runtime PM handles pwm: lpss: use devm_pm_runtime_enable() helper pwm-stm32: Make use of parametrised register definitions dt-bindings: pwm: imx: remove interrupt property from required pwm: meson: Add support for Amlogic S4 PWM pwm: Add GPIO PWM driver dt-bindings: pwm: Add pwm-gpio pwm: Drop pwm_apply_state() bus: ts-nbus: Use pwm_apply_might_sleep() ...
2 parents 500a711 + 240b129 commit c6e63a9

35 files changed

+1065
-439
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/adi,axi-pwmgen.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Analog Devices AXI PWM generator
8+
9+
maintainers:
10+
- Michael Hennerich <Michael.Hennerich@analog.com>
11+
- Nuno Sá <nuno.sa@analog.com>
12+
13+
description:
14+
The Analog Devices AXI PWM generator can generate PWM signals
15+
with variable pulse width and period.
16+
17+
https://wiki.analog.com/resources/fpga/docs/axi_pwm_gen
18+
19+
allOf:
20+
- $ref: pwm.yaml#
21+
22+
properties:
23+
compatible:
24+
const: adi,axi-pwmgen-2.00.a
25+
26+
reg:
27+
maxItems: 1
28+
29+
"#pwm-cells":
30+
const: 2
31+
32+
clocks:
33+
maxItems: 1
34+
35+
required:
36+
- reg
37+
- clocks
38+
39+
unevaluatedProperties: false
40+
41+
examples:
42+
- |
43+
pwm@44b00000 {
44+
compatible = "adi,axi-pwmgen-2.00.a";
45+
reg = <0x44b00000 0x1000>;
46+
clocks = <&spi_clk>;
47+
#pwm-cells = <2>;
48+
};

Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ properties:
2323
- atmel,sama5d2-pwm
2424
- microchip,sam9x60-pwm
2525
- items:
26-
- const: microchip,sama7g5-pwm
26+
- enum:
27+
- microchip,sama7d65-pwm
28+
- microchip,sama7g5-pwm
2729
- const: atmel,sama5d2-pwm
2830
- items:
2931
- const: microchip,sam9x7-pwm
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/fsl,vf610-ftm-pwm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Freescale FlexTimer Module (FTM) PWM controller
8+
9+
description: |
10+
The same FTM PWM device can have a different endianness on different SoCs. The
11+
device tree provides a property to describing this so that an operating system
12+
device driver can handle all variants of the device. Refer to the table below
13+
for the endianness of the FTM PWM block as integrated into the existing SoCs:
14+
15+
SoC | FTM-PWM endianness
16+
--------+-------------------
17+
Vybrid | LE
18+
LS1 | BE
19+
LS2 | LE
20+
21+
Please see ../regmap/regmap.txt for more detail about how to specify endian
22+
modes in device tree.
23+
24+
maintainers:
25+
- Frank Li <Frank.Li@nxp.com>
26+
27+
properties:
28+
compatible:
29+
enum:
30+
- fsl,vf610-ftm-pwm
31+
- fsl,imx8qm-ftm-pwm
32+
33+
reg:
34+
maxItems: 1
35+
36+
"#pwm-cells":
37+
const: 3
38+
39+
clocks:
40+
minItems: 4
41+
maxItems: 4
42+
43+
clock-names:
44+
items:
45+
- const: ftm_sys
46+
- const: ftm_ext
47+
- const: ftm_fix
48+
- const: ftm_cnt_clk_en
49+
50+
pinctrl-0: true
51+
pinctrl-1: true
52+
53+
pinctrl-names:
54+
minItems: 1
55+
items:
56+
- const: default
57+
- const: sleep
58+
59+
big-endian:
60+
$ref: /schemas/types.yaml#/definitions/flag
61+
description:
62+
Boolean property, required if the FTM PWM registers use a big-
63+
endian rather than little-endian layout.
64+
65+
required:
66+
- compatible
67+
- reg
68+
- clocks
69+
- clock-names
70+
71+
allOf:
72+
- $ref: pwm.yaml#
73+
74+
unevaluatedProperties: false
75+
76+
examples:
77+
- |
78+
#include <dt-bindings/clock/vf610-clock.h>
79+
80+
pwm@40038000 {
81+
compatible = "fsl,vf610-ftm-pwm";
82+
reg = <0x40038000 0x1000>;
83+
#pwm-cells = <3>;
84+
clocks = <&clks VF610_CLK_FTM0>,
85+
<&clks VF610_CLK_FTM0_EXT_SEL>,
86+
<&clks VF610_CLK_FTM0_FIX_SEL>,
87+
<&clks VF610_CLK_FTM0_EXT_FIX_EN>;
88+
clock-names = "ftm_sys", "ftm_ext", "ftm_fix", "ftm_cnt_clk_en";
89+
pinctrl-names = "default";
90+
pinctrl-0 = <&pinctrl_pwm0_1>;
91+
big-endian;
92+
};

Documentation/devicetree/bindings/pwm/imx-pwm.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ required:
6868
- reg
6969
- clocks
7070
- clock-names
71-
- interrupts
7271

7372
additionalProperties: false
7473

Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/pwm-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Generic software PWM for modulating GPIOs
8+
9+
maintainers:
10+
- Stefan Wahren <wahrenst@gmx.net>
11+
12+
allOf:
13+
- $ref: pwm.yaml#
14+
15+
properties:
16+
compatible:
17+
const: pwm-gpio
18+
19+
"#pwm-cells":
20+
const: 3
21+
description:
22+
See pwm.yaml in this directory for a description of the cells format.
23+
The first cell which represents the PWM instance number must always
24+
be zero.
25+
26+
gpios:
27+
description:
28+
GPIO to be modulated
29+
maxItems: 1
30+
31+
required:
32+
- compatible
33+
- "#pwm-cells"
34+
- gpios
35+
36+
additionalProperties: false
37+
38+
examples:
39+
- |
40+
#include <dt-bindings/gpio/gpio.h>
41+
42+
pwm {
43+
#pwm-cells = <3>;
44+
compatible = "pwm-gpio";
45+
gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
46+
};

Documentation/devicetree/bindings/pwm/pwm.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ properties:
1616
pattern: "^pwm(@.*|-([0-9]|[1-9][0-9]+))?$"
1717

1818
"#pwm-cells":
19-
description:
20-
Number of cells in a PWM specifier.
19+
description: |
20+
Number of cells in a PWM specifier. Typically the cells represent, in
21+
order: the chip-relative PWM number, the PWM period in nanoseconds and
22+
optionally a number of flags (defined in <dt-bindings/pwm/pwm.h>).
2123
2224
required:
2325
- "#pwm-cells"

Documentation/driver-api/gpio/drivers-on-gpio.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ hardware descriptions such as device tree or ACPI:
2727
to the lines for a more permanent solution of this type.
2828

2929
- gpio-beeper: drivers/input/misc/gpio-beeper.c is used to provide a beep from
30-
an external speaker connected to a GPIO line.
30+
an external speaker connected to a GPIO line. (If the beep is controlled by
31+
off/on, for an actual PWM waveform, see pwm-gpio below.)
32+
33+
- pwm-gpio: drivers/pwm/pwm-gpio.c is used to toggle a GPIO with a high
34+
resolution timer producing a PWM waveform on the GPIO line, as well as
35+
Linux high resolution timers can do.
3136

3237
- extcon-gpio: drivers/extcon/extcon-gpio.c is used when you need to read an
3338
external connector status, such as a headset line for an audio driver or an

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3549,6 +3549,15 @@ W: https://ez.analog.com/linux-software-drivers
35493549
F: Documentation/devicetree/bindings/spi/adi,axi-spi-engine.yaml
35503550
F: drivers/spi/spi-axi-spi-engine.c
35513551

3552+
AXI PWM GENERATOR
3553+
M: Michael Hennerich <michael.hennerich@analog.com>
3554+
M: Nuno Sá <nuno.sa@analog.com>
3555+
L: linux-pwm@vger.kernel.org
3556+
S: Supported
3557+
W: https://ez.analog.com/linux-software-drivers
3558+
F: Documentation/devicetree/bindings/pwm/adi,axi-pwmgen.yaml
3559+
F: drivers/pwm/pwm-axi-pwmgen.c
3560+
35523561
AXXIA I2C CONTROLLER
35533562
M: Krzysztof Adamski <krzysztof.adamski@nokia.com>
35543563
L: linux-i2c@vger.kernel.org

drivers/bus/ts-nbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static int ts_nbus_probe(struct platform_device *pdev)
294294
state.duty_cycle = state.period;
295295
state.enabled = true;
296296

297-
ret = pwm_apply_state(pwm, &state);
297+
ret = pwm_apply_might_sleep(pwm, &state);
298298
if (ret < 0)
299299
return dev_err_probe(dev, ret, "failed to configure PWM\n");
300300

0 commit comments

Comments
 (0)