]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Bindings/mfd/cirrus,lochnagar.yaml
Import DTS from Linux 5.8
[FreeBSD/FreeBSD.git] / Bindings / mfd / cirrus,lochnagar.yaml
1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/mfd/cirrus,lochnagar.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Cirrus Logic Lochnagar Audio Development Board
8
9 maintainers:
10   - patches@opensource.cirrus.com
11
12 description: |
13   Lochnagar is an evaluation and development board for Cirrus Logic
14   Smart CODEC and Amp devices. It allows the connection of most Cirrus
15   Logic devices on mini-cards, as well as allowing connection of
16   various application processor systems to provide a full evaluation
17   platform.  Audio system topology, clocking and power can all be
18   controlled through the Lochnagar, allowing the device under test
19   to be used in a variety of possible use cases.
20
21   Also see these documents for generic binding information:
22     [1] GPIO : ../gpio/gpio.txt
23
24   And these for relevant defines:
25     [2] include/dt-bindings/pinctrl/lochnagar.h
26     [3] include/dt-bindings/clock/lochnagar.h
27
28   And these documents for the required sub-node binding details:
29     [4] Clock: ../clock/cirrus,lochnagar.yaml
30     [5] Pinctrl: ../pinctrl/cirrus,lochnagar.yaml
31     [6] Sound: ../sound/cirrus,lochnagar.yaml
32     [7] Hardware Monitor: ../hwmon/cirrus,lochnagar.yaml
33
34 allOf:
35   - if:
36       properties:
37         compatible:
38           enum:
39             - cirrus,lochnagar2
40     then:
41       properties:
42         lochnagar-hwmon:
43           type: object
44           $ref: /schemas/hwmon/cirrus,lochnagar.yaml#
45
46         lochnagar-sc:
47           type: object
48           $ref: /schemas/sound/cirrus,lochnagar.yaml#
49
50 properties:
51   compatible:
52     enum:
53       - cirrus,lochnagar1
54       - cirrus,lochnagar2
55
56   reg:
57     const: 0x22
58
59   reset-gpios:
60     maxItems: 1
61
62   present-gpios:
63     description: |
64       Host present line, indicating the presence of a
65       host system, see [1]. This can be omitted if the present line is
66       tied in hardware.
67     maxItems: 1
68
69   lochnagar-clk:
70     type: object
71     $ref: /schemas/clock/cirrus,lochnagar.yaml#
72
73   lochnagar-pmic32k:
74     type: object
75     $ref: /schemas/clock/fixed-clock.yaml#
76     properties:
77       clock-frequency:
78         const: 32768
79
80   lochnagar-clk12m:
81     type: object
82     $ref: /schemas/clock/fixed-clock.yaml#
83     properties:
84       clock-frequency:
85         const: 12288000
86
87   lochnagar-clk11m:
88     type: object
89     $ref: /schemas/clock/fixed-clock.yaml#
90     properties:
91       clock-frequency:
92         const: 11298600
93
94   lochnagar-clk24m:
95     type: object
96     $ref: /schemas/clock/fixed-clock.yaml#
97     properties:
98       clock-frequency:
99         const: 24576000
100
101   lochnagar-clk22m:
102     type: object
103     $ref: /schemas/clock/fixed-clock.yaml#
104     properties:
105       clock-frequency:
106         const: 22579200
107
108   lochnagar-clk8m:
109     type: object
110     $ref: /schemas/clock/fixed-clock.yaml#
111     properties:
112       clock-frequency:
113         const: 8192000
114
115   lochnagar-usb24m:
116     type: object
117     $ref: /schemas/clock/fixed-clock.yaml#
118     properties:
119       clock-frequency:
120         const: 24576000
121
122   lochnagar-usb12m:
123     type: object
124     $ref: /schemas/clock/fixed-clock.yaml#
125     properties:
126       clock-frequency:
127         const: 12288000
128
129   lochnagar-pinctrl:
130     type: object
131     $ref: /schemas/pinctrl/cirrus,lochnagar.yaml#
132
133   VDDCORE:
134     description:
135       Initialisation data for the VDDCORE regulator, which supplies the
136       CODECs digital core if not being provided by an internal regulator.
137     type: object
138     $ref: /schemas/regulator/regulator.yaml#
139     properties:
140       compatible:
141         enum:
142           - cirrus,lochnagar2-vddcore
143
144       SYSVDD-supply:
145         description:
146           Primary power supply for the Lochnagar.
147     required:
148       - compatible
149
150   MICVDD:
151     description:
152       Initialisation data for the MICVDD regulator, which supplies the
153       CODECs MICVDD.
154     type: object
155     $ref: /schemas/regulator/regulator.yaml#
156     properties:
157       compatible:
158         enum:
159           - cirrus,lochnagar2-micvdd
160
161       SYSVDD-supply:
162         description:
163           Primary power supply for the Lochnagar.
164     required:
165       - compatible
166
167   MIC1VDD:
168     description:
169       Initialisation data for the MIC1VDD supplies.
170     type: object
171     $ref: /schemas/regulator/regulator.yaml#
172     properties:
173       compatible:
174         enum:
175           - cirrus,lochnagar2-mic1vdd
176
177       cirrus,micbias-input:
178         description:
179           A property selecting which of the CODEC minicard micbias outputs
180           should be used.
181         $ref: /schemas/types.yaml#/definitions/uint32
182         minimum: 1
183         maximum: 4
184
185       MICBIAS1-supply:
186         description:
187           Regulator supplies for the MIC1VDD outputs, supplying the digital
188           microphones, normally supplied from the attached CODEC.
189     required:
190       - compatible
191
192   MIC2VDD:
193     description:
194       Initialisation data for the MIC2VDD supplies.
195     type: object
196     $ref: /schemas/regulator/regulator.yaml#
197     properties:
198       compatible:
199         enum:
200           - cirrus,lochnagar2-mic2vdd
201
202       cirrus,micbias-input:
203         description:
204           A property selecting which of the CODEC minicard micbias outputs
205           should be used.
206         $ref: /schemas/types.yaml#/definitions/uint32
207         minimum: 1
208         maximum: 4
209
210       MICBIAS2-supply:
211         description:
212           Regulator supplies for the MIC2VDD outputs, supplying the digital
213           microphones, normally supplied from the attached CODEC.
214     required:
215       - compatible
216
217   VDD1V8:
218     description:
219       Recommended fixed regulator for the VDD1V8 regulator, which supplies
220       the CODECs analog and 1.8V digital supplies.
221     type: object
222     $ref: /schemas/regulator/regulator.yaml#
223     properties:
224       compatible:
225         enum:
226           - regulator-fixed
227
228       regulator-min-microvolt:
229         const: 1800000
230
231       regulator-max-microvolt:
232         const: 1800000
233
234       vin-supply:
235         description:
236           Should be set to same supply as SYSVDD
237     required:
238       - compatible
239       - regulator-min-microvolt
240       - regulator-max-microvolt
241       - regulator-boot-on
242       - regulator-always-on
243       - vin-supply
244
245 required:
246   - compatible
247   - reg
248   - reset-gpios
249   - lochnagar-clk
250   - lochnagar-pinctrl
251
252 unevaluatedProperties: false
253
254 examples:
255   - |
256     #include <dt-bindings/clk/lochnagar.h>
257     #include <dt-bindings/pinctrl/lochnagar.h>
258     i2c@e0004000 {
259         #address-cells = <1>;
260         #size-cells = <0>;
261         reg = <0xe0004000 0x1000>;
262
263         lochnagar: lochnagar@22 {
264             compatible = "cirrus,lochnagar2";
265             reg = <0x22>;
266
267             reset-gpios = <&gpio0 55 0>;
268             present-gpios = <&gpio0 60 0>;
269
270             lochnagarclk: lochnagar-clk {
271                 compatible = "cirrus,lochnagar2-clk";
272
273                 #clock-cells = <1>;
274                 clocks = <&clkaudio>, <&clkpmic>;
275                 clock-names = "ln-gf-mclk2", "ln-pmic-32k";
276
277                 assigned-clocks = <&lochnagarclk LOCHNAGAR_CDC_MCLK1>,
278                                   <&lochnagarclk LOCHNAGAR_CDC_MCLK2>;
279                 assigned-clock-parents = <&clkaudio>, <&clkpmic>;
280             };
281
282             clkpmic: lochnagar-pmic32k {
283                 compatible = "fixed-clock";
284                 #clock-cells = <0>;
285                 clock-frequency = <32768>;
286             };
287
288             lochnagar-pinctrl {
289                 compatible = "cirrus,lochnagar-pinctrl";
290
291                 gpio-controller;
292                 #gpio-cells = <2>;
293                 gpio-ranges = <&lochnagar 0 0 LOCHNAGAR2_PIN_NUM_GPIOS>;
294
295                 pinctrl-names = "default";
296                 pinctrl-0 = <&pinsettings>;
297
298                 pinsettings: pin-settings {
299                     ap2aif-pins {
300                         input-enable;
301                         groups = "gf-aif1";
302                         function = "codec-aif3";
303                     };
304                     codec2aif-pins {
305                         output-enable;
306                         groups = "codec-aif3";
307                         function = "gf-aif1";
308                     };
309                 };
310             };
311
312             lochnagar-sc {
313                 compatible = "cirrus,lochnagar2-soundcard";
314
315                 #sound-dai-cells = <1>;
316
317                 clocks = <&lochnagarclk LOCHNAGAR_SOUNDCARD_MCLK>;
318                 clock-names = "mclk";
319             };
320
321             lochnagar-hwmon {
322                 compatible = "cirrus,lochnagar2-hwmon";
323             };
324
325             MIC1VDD {
326                 compatible = "cirrus,lochnagar2-mic1vdd";
327
328                 cirrus,micbias-input = <3>;
329             };
330
331             MICVDD {
332                 compatible = "cirrus,lochnagar2-micvdd";
333
334                 SYSVDD-supply = <&wallvdd>;
335
336                 regulator-min-microvolt = <3300000>;
337                 regulator-max-microvolt = <3300000>;
338             };
339
340             VDD1V8 {
341                 compatible = "regulator-fixed";
342
343                 regulator-name = "VDD1V8";
344                 regulator-min-microvolt = <1800000>;
345                 regulator-max-microvolt = <1800000>;
346                 regulator-boot-on;
347                 regulator-always-on;
348
349                 vin-supply = <&wallvdd>;
350             };
351         };
352     };