Skip to content

Commit 8eca6b0

Browse files
committed
Merge tag 'pwm/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm updates from Thierry Reding: "Quite a large number of conversions this time around, courtesy of Uwe who has been working tirelessly on these. No drivers of the legacy API are left at this point, so as a next step the old API can be removed. Support is added for a few new devices such as the Xilinx AXI timer- based PWMs and the PWM IP found on Sunplus SoCs. Other than that, there's a number of fixes, cleanups and optimizations" * tag 'pwm/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (43 commits) pwm: pwm-cros-ec: Add channel type support dt-bindings: google,cros-ec-pwm: Add the new -type compatible dt-bindings: Add mfd/cros_ec definitions pwm: Document that the pinstate of a disabled PWM isn't reliable pwm: twl-led: Implement .apply() callback pwm: lpc18xx: Implement .apply() callback pwm: mediatek: Implement .apply() callback pwm: lpc32xx: Implement .apply() callback pwm: tegra: Implement .apply() callback pwm: stmpe: Implement .apply() callback pwm: sti: Implement .apply() callback pwm: pwm-mediatek: Add support for MediaTek Helio X10 MT6795 dt-bindings: pwm: pwm-mediatek: Add documentation for MT6795 SoC pwm: tegra: Optimize period calculation pwm: renesas-tpu: Improve precision of period and duty_cycle calculation pwm: renesas-tpu: Improve maths to compute register settings pwm: renesas-tpu: Rename variables to match the usual naming pwm: renesas-tpu: Implement .apply() callback pwm: renesas-tpu: Make use of devm functions pwm: renesas-tpu: Make use of dev_err_probe() ...
2 parents 68e6134 + 3d593b6 commit 8eca6b0

33 files changed

+1558
-367
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/pwm/atmel,at91sam-pwm.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Atmel/Microchip PWM controller
9+
10+
maintainers:
11+
- Claudiu Beznea <claudiu.beznea@microchip.com>
12+
13+
allOf:
14+
- $ref: "pwm.yaml#"
15+
16+
properties:
17+
compatible:
18+
oneOf:
19+
- items:
20+
- enum:
21+
- atmel,at91sam9rl-pwm
22+
- atmel,sama5d3-pwm
23+
- atmel,sama5d2-pwm
24+
- microchip,sam9x60-pwm
25+
- items:
26+
- const: microchip,sama7g5-pwm
27+
- const: atmel,sama5d2-pwm
28+
29+
reg:
30+
maxItems: 1
31+
32+
"#pwm-cells":
33+
const: 3
34+
35+
required:
36+
- compatible
37+
- reg
38+
39+
unevaluatedProperties: false
40+
41+
examples:
42+
- |
43+
pwm0: pwm@f8034000 {
44+
compatible = "atmel,at91sam9rl-pwm";
45+
reg = <0xf8034000 0x400>;
46+
#pwm-cells = <3>;
47+
};

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

Lines changed: 0 additions & 35 deletions
This file was deleted.

Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ allOf:
2121

2222
properties:
2323
compatible:
24-
const: google,cros-ec-pwm
24+
oneOf:
25+
- description: PWM controlled using EC_PWM_TYPE_GENERIC channels.
26+
items:
27+
- const: google,cros-ec-pwm
28+
- description: PWM controlled using CROS_EC_PWM_DT_<...> types.
29+
items:
30+
- const: google,cros-ec-pwm-type
31+
2532
"#pwm-cells":
2633
description: The cell specifies the PWM index.
2734
const: 1
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/mediatek,pwm-disp.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek DISP_PWM Controller Device Tree Bindings
8+
9+
maintainers:
10+
- Jitao Shi <jitao.shi@mediatek.com>
11+
- Xinlei Lee <xinlei.lee@mediatek.com>
12+
13+
allOf:
14+
- $ref: pwm.yaml#
15+
16+
properties:
17+
compatible:
18+
oneOf:
19+
- enum:
20+
- mediatek,mt2701-disp-pwm
21+
- mediatek,mt6595-disp-pwm
22+
- mediatek,mt8173-disp-pwm
23+
- mediatek,mt8183-disp-pwm
24+
- items:
25+
- const: mediatek,mt8167-disp-pwm
26+
- const: mediatek,mt8173-disp-pwm
27+
- items:
28+
- enum:
29+
- mediatek,mt8186-disp-pwm
30+
- mediatek,mt8192-disp-pwm
31+
- mediatek,mt8195-disp-pwm
32+
- const: mediatek,mt8183-disp-pwm
33+
34+
reg:
35+
maxItems: 1
36+
37+
"#pwm-cells":
38+
const: 2
39+
40+
interrupts:
41+
maxItems: 1
42+
43+
clocks:
44+
items:
45+
- description: Main Clock
46+
- description: Mm Clock
47+
48+
clock-names:
49+
items:
50+
- const: main
51+
- const: mm
52+
53+
required:
54+
- compatible
55+
- reg
56+
- "#pwm-cells"
57+
- clocks
58+
- clock-names
59+
60+
additionalProperties: false
61+
62+
examples:
63+
- |
64+
#include <dt-bindings/interrupt-controller/arm-gic.h>
65+
#include <dt-bindings/clock/mt8173-clk.h>
66+
#include <dt-bindings/interrupt-controller/irq.h>
67+
68+
pwm0: pwm@1401e000 {
69+
compatible = "mediatek,mt8173-disp-pwm";
70+
reg = <0x1401e000 0x1000>;
71+
#pwm-cells = <2>;
72+
clocks = <&mmsys CLK_MM_DISP_PWM026M>,
73+
<&mmsys CLK_MM_DISP_PWM0MM>;
74+
clock-names = "main", "mm";
75+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ MediaTek PWM controller
33
Required properties:
44
- compatible: should be "mediatek,<name>-pwm":
55
- "mediatek,mt2712-pwm": found on mt2712 SoC.
6+
- "mediatek,mt6795-pwm": found on mt6795 SoC.
67
- "mediatek,mt7622-pwm": found on mt7622 SoC.
78
- "mediatek,mt7623-pwm": found on mt7623 SoC.
89
- "mediatek,mt7628-pwm": found on mt7628 SoC.

Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) Sunplus Co., Ltd. 2021
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/pwm/sunplus,sp7021-pwm.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Sunplus SoC SP7021 PWM Controller
9+
10+
maintainers:
11+
- Hammer Hsieh <hammerh0314@gmail.com>
12+
13+
allOf:
14+
- $ref: pwm.yaml#
15+
16+
properties:
17+
compatible:
18+
const: sunplus,sp7021-pwm
19+
20+
reg:
21+
maxItems: 1
22+
23+
clocks:
24+
maxItems: 1
25+
26+
'#pwm-cells':
27+
const: 2
28+
29+
unevaluatedProperties: false
30+
31+
required:
32+
- reg
33+
- clocks
34+
35+
examples:
36+
- |
37+
pwm: pwm@9c007a00 {
38+
compatible = "sunplus,sp7021-pwm";
39+
reg = <0x9c007a00 0x80>;
40+
clocks = <&clkc 0xa2>;
41+
#pwm-cells = <2>;
42+
};
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 OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/timer/xlnx,xps-timer.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Xilinx LogiCORE IP AXI Timer Device Tree Binding
8+
9+
maintainers:
10+
- Sean Anderson <sean.anderson@seco.com>
11+
12+
properties:
13+
compatible:
14+
contains:
15+
const: xlnx,xps-timer-1.00.a
16+
17+
clocks:
18+
maxItems: 1
19+
20+
clock-names:
21+
const: s_axi_aclk
22+
23+
interrupts:
24+
maxItems: 1
25+
26+
reg:
27+
maxItems: 1
28+
29+
'#pwm-cells': true
30+
31+
xlnx,count-width:
32+
$ref: /schemas/types.yaml#/definitions/uint32
33+
enum: [8, 16, 32]
34+
default: 32
35+
description:
36+
The width of the counter(s), in bits.
37+
38+
xlnx,one-timer-only:
39+
$ref: /schemas/types.yaml#/definitions/uint32
40+
enum: [ 0, 1 ]
41+
description:
42+
Whether only one timer is present in this block.
43+
44+
required:
45+
- compatible
46+
- reg
47+
- xlnx,one-timer-only
48+
49+
allOf:
50+
- if:
51+
required:
52+
- '#pwm-cells'
53+
then:
54+
allOf:
55+
- required:
56+
- clocks
57+
- properties:
58+
xlnx,one-timer-only:
59+
const: 0
60+
else:
61+
required:
62+
- interrupts
63+
- if:
64+
required:
65+
- clocks
66+
then:
67+
required:
68+
- clock-names
69+
70+
additionalProperties: false
71+
72+
examples:
73+
- |
74+
timer@800e0000 {
75+
clock-names = "s_axi_aclk";
76+
clocks = <&zynqmp_clk 71>;
77+
compatible = "xlnx,xps-timer-1.00.a";
78+
reg = <0x800e0000 0x10000>;
79+
interrupts = <0 39 2>;
80+
xlnx,count-width = <16>;
81+
xlnx,one-timer-only = <0x0>;
82+
};
83+
84+
timer@800f0000 {
85+
#pwm-cells = <0>;
86+
clock-names = "s_axi_aclk";
87+
clocks = <&zynqmp_clk 71>;
88+
compatible = "xlnx,xps-timer-1.00.a";
89+
reg = <0x800e0000 0x10000>;
90+
xlnx,count-width = <32>;
91+
xlnx,one-timer-only = <0x0>;
92+
};

Documentation/driver-api/pwm.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ After being requested, a PWM has to be configured using::
4949

5050
This API controls both the PWM period/duty_cycle config and the
5151
enable/disable state.
52+
53+
As a consumer, don't rely on the output's state for a disabled PWM. If it's
54+
easily possible, drivers are supposed to emit the inactive state, but some
55+
drivers cannot. If you rely on getting the inactive state, use .duty_cycle=0,
56+
.enabled=true.
57+
5258
There is also a usage_power setting: If set, the PWM driver is only required to
5359
maintain the power output but has more freedom regarding signal form.
5460
If supported by the driver, the signal can be optimized, for example to improve

0 commit comments

Comments
 (0)