Skip to content

Commit 5fd61cc

Browse files
jbrun3tUwe Kleine-König
authored andcommitted
dt-bindings: pwm: amlogic: Add a new binding for meson8 pwm types
The binding that is used up to now describe which input the PWM channel multiplexer should pick among its possible parents, which are hardcoded in the driver. This isn't a good binding in the sense that it should describe hardware but not usage. Add a new binding deprecating the old one that uses clocks in a better way and how clocks are usually used today: The list of clocks describe the inputs of the PWM block as they are realised in hardware. So deprecate the old bindings and introduce a compatible per SoC family to replace these. Signed-off-by: Jerome Brunet <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent c2dd6b9 commit 5fd61cc

File tree

1 file changed

+47
-3
lines changed

1 file changed

+47
-3
lines changed

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

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,36 @@ properties:
2121
- amlogic,meson-g12a-ee-pwm
2222
- amlogic,meson-g12a-ao-pwm-ab
2323
- amlogic,meson-g12a-ao-pwm-cd
24-
- amlogic,meson-s4-pwm
24+
deprecated: true
2525
- items:
2626
- const: amlogic,meson-gx-pwm
2727
- const: amlogic,meson-gxbb-pwm
28+
deprecated: true
2829
- items:
2930
- const: amlogic,meson-gx-ao-pwm
3031
- const: amlogic,meson-gxbb-ao-pwm
32+
deprecated: true
3133
- items:
3234
- const: amlogic,meson8-pwm
3335
- const: amlogic,meson8b-pwm
36+
deprecated: true
37+
- enum:
38+
- amlogic,meson8-pwm-v2
39+
- amlogic,meson-s4-pwm
40+
- items:
41+
- enum:
42+
- amlogic,meson8b-pwm-v2
43+
- amlogic,meson-gxbb-pwm-v2
44+
- amlogic,meson-axg-pwm-v2
45+
- amlogic,meson-g12-pwm-v2
46+
- const: amlogic,meson8-pwm-v2
3447

3548
reg:
3649
maxItems: 1
3750

3851
clocks:
3952
minItems: 1
40-
maxItems: 2
53+
maxItems: 4
4154

4255
clock-names:
4356
minItems: 1
@@ -68,11 +81,14 @@ allOf:
6881
- amlogic,meson-g12a-ao-pwm-ab
6982
- amlogic,meson-g12a-ao-pwm-cd
7083
then:
71-
# Historic bindings tied to the driver implementation
84+
# Obsolete historic bindings tied to the driver implementation
7285
# The clocks provided here are meant to be matched with the input
7386
# known (hard-coded) in the driver and used to select pwm clock
7487
# source. Currently, the linux driver ignores this.
88+
# This is kept to maintain ABI backward compatibility.
7589
properties:
90+
clocks:
91+
maxItems: 2
7692
clock-names:
7793
oneOf:
7894
- items:
@@ -81,6 +97,27 @@ allOf:
8197
- const: clkin0
8298
- const: clkin1
8399

100+
# Newer binding where clock describe the actual clock inputs of the pwm
101+
# block. These are necessary but some inputs may be grounded.
102+
- if:
103+
properties:
104+
compatible:
105+
contains:
106+
enum:
107+
- amlogic,meson8-pwm-v2
108+
then:
109+
properties:
110+
clocks:
111+
minItems: 1
112+
items:
113+
- description: input clock 0 of the pwm block
114+
- description: input clock 1 of the pwm block
115+
- description: input clock 2 of the pwm block
116+
- description: input clock 3 of the pwm block
117+
clock-names: false
118+
required:
119+
- clocks
120+
84121
# Newer IP block take a single input per channel, instead of 4 inputs
85122
# for both channels
86123
- if:
@@ -110,6 +147,13 @@ examples:
110147
clock-names = "clkin0", "clkin1";
111148
#pwm-cells = <3>;
112149
};
150+
- |
151+
pwm@2000 {
152+
compatible = "amlogic,meson8-pwm-v2";
153+
reg = <0x1000 0x10>;
154+
clocks = <&xtal>, <0>, <&fdiv4>, <&fdiv5>;
155+
#pwm-cells = <3>;
156+
};
113157
- |
114158
pwm@1000 {
115159
compatible = "amlogic,meson-s4-pwm";

0 commit comments

Comments
 (0)