1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/pwm/allwinner,sun4i-a10-pwm.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: Allwinner A10 PWM
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Chen-Yu Tsai <wens@csie.org>
11c66ec88fSEmmanuel Vadot  - Maxime Ripard <mripard@kernel.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotproperties:
14c66ec88fSEmmanuel Vadot  "#pwm-cells":
15c66ec88fSEmmanuel Vadot    const: 3
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadot  compatible:
18c66ec88fSEmmanuel Vadot    oneOf:
19c66ec88fSEmmanuel Vadot      - const: allwinner,sun4i-a10-pwm
20c66ec88fSEmmanuel Vadot      - const: allwinner,sun5i-a10s-pwm
21c66ec88fSEmmanuel Vadot      - const: allwinner,sun5i-a13-pwm
22c66ec88fSEmmanuel Vadot      - const: allwinner,sun7i-a20-pwm
23c66ec88fSEmmanuel Vadot      - const: allwinner,sun8i-h3-pwm
24c66ec88fSEmmanuel Vadot      - items:
25c66ec88fSEmmanuel Vadot          - const: allwinner,sun8i-a83t-pwm
26c66ec88fSEmmanuel Vadot          - const: allwinner,sun8i-h3-pwm
27c66ec88fSEmmanuel Vadot      - items:
28*8bab661aSEmmanuel Vadot          - enum:
29*8bab661aSEmmanuel Vadot              - allwinner,suniv-f1c100s-pwm
30*8bab661aSEmmanuel Vadot              - allwinner,sun8i-v3s-pwm
315956d97fSEmmanuel Vadot          - const: allwinner,sun7i-a20-pwm
325956d97fSEmmanuel Vadot      - items:
33c66ec88fSEmmanuel Vadot          - const: allwinner,sun50i-a64-pwm
34c66ec88fSEmmanuel Vadot          - const: allwinner,sun5i-a13-pwm
35c66ec88fSEmmanuel Vadot      - items:
36c66ec88fSEmmanuel Vadot          - const: allwinner,sun50i-h5-pwm
37c66ec88fSEmmanuel Vadot          - const: allwinner,sun5i-a13-pwm
38c66ec88fSEmmanuel Vadot      - const: allwinner,sun50i-h6-pwm
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  reg:
41c66ec88fSEmmanuel Vadot    maxItems: 1
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  clocks:
44c66ec88fSEmmanuel Vadot    minItems: 1
45c66ec88fSEmmanuel Vadot    items:
46c66ec88fSEmmanuel Vadot      - description: Module Clock
47c66ec88fSEmmanuel Vadot      - description: Bus Clock
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel Vadot  # Even though it only applies to subschemas under the conditionals,
50c66ec88fSEmmanuel Vadot  # not listing them here will trigger a warning because of the
51c66ec88fSEmmanuel Vadot  # additionalsProperties set to false.
52c66ec88fSEmmanuel Vadot  clock-names: true
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel Vadot  resets:
55c66ec88fSEmmanuel Vadot    maxItems: 1
56c66ec88fSEmmanuel Vadot
57c9ccf3a3SEmmanuel Vadot
58c9ccf3a3SEmmanuel VadotallOf:
59c9ccf3a3SEmmanuel Vadot  - $ref: pwm.yaml#
60c9ccf3a3SEmmanuel Vadot
61c9ccf3a3SEmmanuel Vadot  - if:
62c66ec88fSEmmanuel Vadot      properties:
63c66ec88fSEmmanuel Vadot        compatible:
64c66ec88fSEmmanuel Vadot          contains:
65c66ec88fSEmmanuel Vadot            const: allwinner,sun50i-h6-pwm
66c66ec88fSEmmanuel Vadot
67c66ec88fSEmmanuel Vadot    then:
68c66ec88fSEmmanuel Vadot      properties:
69c66ec88fSEmmanuel Vadot        clocks:
70c66ec88fSEmmanuel Vadot          maxItems: 2
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot        clock-names:
73c66ec88fSEmmanuel Vadot          items:
74c66ec88fSEmmanuel Vadot            - const: mod
75c66ec88fSEmmanuel Vadot            - const: bus
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadot      required:
78c66ec88fSEmmanuel Vadot        - clock-names
79c66ec88fSEmmanuel Vadot        - resets
80c66ec88fSEmmanuel Vadot
81c66ec88fSEmmanuel Vadot    else:
82c66ec88fSEmmanuel Vadot      properties:
83c66ec88fSEmmanuel Vadot        clocks:
84c66ec88fSEmmanuel Vadot          maxItems: 1
85c66ec88fSEmmanuel Vadot
86c66ec88fSEmmanuel Vadotrequired:
87c66ec88fSEmmanuel Vadot  - compatible
88c66ec88fSEmmanuel Vadot  - reg
89c66ec88fSEmmanuel Vadot  - clocks
90c66ec88fSEmmanuel Vadot
91c66ec88fSEmmanuel VadotadditionalProperties: false
92c66ec88fSEmmanuel Vadot
93c66ec88fSEmmanuel Vadotexamples:
94c66ec88fSEmmanuel Vadot  - |
95c66ec88fSEmmanuel Vadot    pwm: pwm@1c20e00 {
96c66ec88fSEmmanuel Vadot        compatible = "allwinner,sun7i-a20-pwm";
97c66ec88fSEmmanuel Vadot        reg = <0x01c20e00 0xc>;
98c66ec88fSEmmanuel Vadot        clocks = <&osc24M>;
99c66ec88fSEmmanuel Vadot        #pwm-cells = <3>;
100c66ec88fSEmmanuel Vadot    };
101c66ec88fSEmmanuel Vadot
102c66ec88fSEmmanuel Vadot  - |
103c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/sun50i-h6-ccu.h>
104c66ec88fSEmmanuel Vadot    #include <dt-bindings/reset/sun50i-h6-ccu.h>
105c66ec88fSEmmanuel Vadot
106c66ec88fSEmmanuel Vadot    pwm@300a000 {
107c66ec88fSEmmanuel Vadot      compatible = "allwinner,sun50i-h6-pwm";
108c66ec88fSEmmanuel Vadot      reg = <0x0300a000 0x400>;
109c66ec88fSEmmanuel Vadot      clocks = <&osc24M>, <&ccu CLK_BUS_PWM>;
110c66ec88fSEmmanuel Vadot      clock-names = "mod", "bus";
111c66ec88fSEmmanuel Vadot      resets = <&ccu RST_BUS_PWM>;
112c66ec88fSEmmanuel Vadot      #pwm-cells = <3>;
113c66ec88fSEmmanuel Vadot    };
114c66ec88fSEmmanuel Vadot
115c66ec88fSEmmanuel Vadot...
116