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