Skip to content

Commit c2dd6b9

Browse files
jbrun3tUwe Kleine-König
authored andcommitted
dt-bindings: pwm: amlogic: fix s4 bindings
s4 has been added to the compatible list while converting the Amlogic PWM binding documentation from txt to yaml. However, on the s4, the clock bindings have different meaning compared to the previous SoCs. On the previous SoCs the clock bindings used to describe which input the PWM channel multiplexer should pick among its possible parents. This is very much tied to the driver implementation, instead of describing the HW for what it is. When support for the Amlogic PWM was first added, how to deal with clocks through DT was not as clear as it nowadays. The Linux driver now ignores this DT setting, but still relies on the hard-coded list of clock sources. On the s4, the input multiplexer is gone. The clock bindings actually describe the clock as it exists, not a setting. The property has a different meaning, even if it is still 2 clocks and it would pass the check when support is actually added. Also the s4 cannot work if the clocks are not provided, so the property is no longer optional. Finally, for once it makes sense to see the input as being numbered somehow. No need to bother with clock-names on the s4 type of PWM. Fixes: 43a1c4f ("dt-bindings: pwm: Convert Amlogic Meson PWM binding") Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Jerome Brunet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 9e3440d commit c2dd6b9

File tree

1 file changed

+58
-9
lines changed

1 file changed

+58
-9
lines changed

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

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ title: Amlogic PWM
99
maintainers:
1010
- Heiner Kallweit <[email protected]>
1111

12-
allOf:
13-
- $ref: pwm.yaml#
14-
1512
properties:
1613
compatible:
1714
oneOf:
@@ -43,12 +40,8 @@ properties:
4340
maxItems: 2
4441

4542
clock-names:
46-
oneOf:
47-
- items:
48-
- enum: [clkin0, clkin1]
49-
- items:
50-
- const: clkin0
51-
- const: clkin1
43+
minItems: 1
44+
maxItems: 2
5245

5346
"#pwm-cells":
5447
const: 3
@@ -57,6 +50,55 @@ required:
5750
- compatible
5851
- reg
5952

53+
allOf:
54+
- $ref: pwm.yaml#
55+
56+
- if:
57+
properties:
58+
compatible:
59+
contains:
60+
enum:
61+
- amlogic,meson8-pwm
62+
- amlogic,meson8b-pwm
63+
- amlogic,meson-gxbb-pwm
64+
- amlogic,meson-gxbb-ao-pwm
65+
- amlogic,meson-axg-ee-pwm
66+
- amlogic,meson-axg-ao-pwm
67+
- amlogic,meson-g12a-ee-pwm
68+
- amlogic,meson-g12a-ao-pwm-ab
69+
- amlogic,meson-g12a-ao-pwm-cd
70+
then:
71+
# Historic bindings tied to the driver implementation
72+
# The clocks provided here are meant to be matched with the input
73+
# known (hard-coded) in the driver and used to select pwm clock
74+
# source. Currently, the linux driver ignores this.
75+
properties:
76+
clock-names:
77+
oneOf:
78+
- items:
79+
- enum: [clkin0, clkin1]
80+
- items:
81+
- const: clkin0
82+
- const: clkin1
83+
84+
# Newer IP block take a single input per channel, instead of 4 inputs
85+
# for both channels
86+
- if:
87+
properties:
88+
compatible:
89+
contains:
90+
enum:
91+
- amlogic,meson-s4-pwm
92+
then:
93+
properties:
94+
clocks:
95+
items:
96+
- description: input clock of PWM channel A
97+
- description: input clock of PWM channel B
98+
clock-names: false
99+
required:
100+
- clocks
101+
60102
additionalProperties: false
61103

62104
examples:
@@ -68,3 +110,10 @@ examples:
68110
clock-names = "clkin0", "clkin1";
69111
#pwm-cells = <3>;
70112
};
113+
- |
114+
pwm@1000 {
115+
compatible = "amlogic,meson-s4-pwm";
116+
reg = <0x1000 0x10>;
117+
clocks = <&pwm_src_a>, <&pwm_src_b>;
118+
#pwm-cells = <3>;
119+
};

0 commit comments

Comments
 (0)