summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/mfd/allwinner,sun8i-a23-prcm.yaml
blob: aa5e683b236c32fe0ae43311cdd590f7f8d52fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# SPDX-License-Identifier: GPL-2.0+
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/allwinner,sun8i-a23-prcm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A23 PRCM Device Tree Bindings

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

deprecated: true

properties:
  compatible:
    const: allwinner,sun8i-a23-prcm

  reg:
    maxItems: 1

patternProperties:
  "^.*(clk|rst|codec).*$":
    type: object

    properties:
      compatible:
        enum:
          - fixed-factor-clock
          - allwinner,sun8i-a23-apb0-clk
          - allwinner,sun8i-a23-apb0-gates-clk
          - allwinner,sun6i-a31-clock-reset
          - allwinner,sun8i-a23-codec-analog

    required:
      - compatible

    allOf:
      - if:
          properties:
            compatible:
              contains:
                const: allwinner,sun8i-a23-apb0-clk

        then:
          properties:
            "#clock-cells":
              const: 0

            # Already checked in the main schema
            compatible: true

            clocks:
              maxItems: 1

            clock-output-names:
              maxItems: 1

            phandle: true

          required:
            - "#clock-cells"
            - compatible
            - clocks
            - clock-output-names

          additionalProperties: false

      - if:
          properties:
            compatible:
              contains:
                const: allwinner,sun8i-a23-apb0-gates-clk

        then:
          properties:
            "#clock-cells":
              const: 1
              description: >
                This additional argument passed to that clock is the
                offset of the bit controlling this particular gate in
                the register.

            # Already checked in the main schema
            compatible: true

            clocks:
              maxItems: 1

            clock-output-names:
              minItems: 1
              maxItems: 32

            phandle: true

          required:
            - "#clock-cells"
            - compatible
            - clocks
            - clock-output-names

          additionalProperties: false

      - if:
          properties:
            compatible:
              contains:
                const: allwinner,sun6i-a31-clock-reset

        then:
          properties:
            "#reset-cells":
              const: 1

            # Already checked in the main schema
            compatible: true

            phandle: true

          required:
            - "#reset-cells"
            - compatible

          additionalProperties: false

      - if:
          properties:
            compatible:
              contains:
                const: allwinner,sun8i-a23-codec-analog

        then:
          properties:
            # Already checked in the main schema
            compatible: true

            phandle: true

          required:
            - compatible

          additionalProperties: false

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    prcm@1f01400 {
        compatible = "allwinner,sun8i-a23-prcm";
        reg = <0x01f01400 0x200>;

        ar100: ar100_clk {
            compatible = "fixed-factor-clock";
            #clock-cells = <0>;
            clock-div = <1>;
            clock-mult = <1>;
            clocks = <&osc24M>;
            clock-output-names = "ar100";
        };

        ahb0: ahb0_clk {
            compatible = "fixed-factor-clock";
            #clock-cells = <0>;
            clock-div = <1>;
            clock-mult = <1>;
            clocks = <&ar100>;
            clock-output-names = "ahb0";
        };

        apb0: apb0_clk {
            compatible = "allwinner,sun8i-a23-apb0-clk";
            #clock-cells = <0>;
            clocks = <&ahb0>;
            clock-output-names = "apb0";
        };

        apb0_gates: apb0_gates_clk {
            compatible = "allwinner,sun8i-a23-apb0-gates-clk";
            #clock-cells = <1>;
            clocks = <&apb0>;
            clock-output-names = "apb0_pio", "apb0_timer",
                                 "apb0_rsb", "apb0_uart",
                                 "apb0_i2c";
        };

        apb0_rst: apb0_rst {
            compatible = "allwinner,sun6i-a31-clock-reset";
            #reset-cells = <1>;
        };

        codec_analog: codec-analog {
            compatible = "allwinner,sun8i-a23-codec-analog";
        };
    };

...