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
7title: Cirrus Logic Lochnagar Audio Development Board
8
9maintainers:
10  - patches@opensource.cirrus.com
11
12description: |
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
34allOf:
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
50properties:
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  lochnagar-hwmon:
134    type: object
135    $ref: /schemas/hwmon/cirrus,lochnagar.yaml#
136
137  lochnagar-sc:
138    type: object
139    $ref: /schemas/sound/cirrus,lochnagar.yaml#
140
141  VDDCORE:
142    description:
143      Initialisation data for the VDDCORE regulator, which supplies the
144      CODECs digital core if not being provided by an internal regulator.
145    type: object
146    $ref: /schemas/regulator/regulator.yaml#
147    properties:
148      compatible:
149        enum:
150          - cirrus,lochnagar2-vddcore
151
152      SYSVDD-supply:
153        description:
154          Primary power supply for the Lochnagar.
155    required:
156      - compatible
157
158  MICVDD:
159    description:
160      Initialisation data for the MICVDD regulator, which supplies the
161      CODECs MICVDD.
162    type: object
163    $ref: /schemas/regulator/regulator.yaml#
164    properties:
165      compatible:
166        enum:
167          - cirrus,lochnagar2-micvdd
168
169      SYSVDD-supply:
170        description:
171          Primary power supply for the Lochnagar.
172    required:
173      - compatible
174
175  MIC1VDD:
176    description:
177      Initialisation data for the MIC1VDD supplies.
178    type: object
179    $ref: /schemas/regulator/regulator.yaml#
180    properties:
181      compatible:
182        enum:
183          - cirrus,lochnagar2-mic1vdd
184
185      cirrus,micbias-input:
186        description:
187          A property selecting which of the CODEC minicard micbias outputs
188          should be used.
189        $ref: /schemas/types.yaml#/definitions/uint32
190        minimum: 1
191        maximum: 4
192
193      MICBIAS1-supply:
194        description:
195          Regulator supplies for the MIC1VDD outputs, supplying the digital
196          microphones, normally supplied from the attached CODEC.
197    required:
198      - compatible
199
200  MIC2VDD:
201    description:
202      Initialisation data for the MIC2VDD supplies.
203    type: object
204    $ref: /schemas/regulator/regulator.yaml#
205    properties:
206      compatible:
207        enum:
208          - cirrus,lochnagar2-mic2vdd
209
210      cirrus,micbias-input:
211        description:
212          A property selecting which of the CODEC minicard micbias outputs
213          should be used.
214        $ref: /schemas/types.yaml#/definitions/uint32
215        minimum: 1
216        maximum: 4
217
218      MICBIAS2-supply:
219        description:
220          Regulator supplies for the MIC2VDD outputs, supplying the digital
221          microphones, normally supplied from the attached CODEC.
222    required:
223      - compatible
224
225  VDD1V8:
226    description:
227      Recommended fixed regulator for the VDD1V8 regulator, which supplies
228      the CODECs analog and 1.8V digital supplies.
229    type: object
230    $ref: /schemas/regulator/regulator.yaml#
231    properties:
232      compatible:
233        enum:
234          - regulator-fixed
235
236      regulator-min-microvolt:
237        const: 1800000
238
239      regulator-max-microvolt:
240        const: 1800000
241
242      vin-supply:
243        description:
244          Should be set to same supply as SYSVDD
245    required:
246      - compatible
247      - regulator-min-microvolt
248      - regulator-max-microvolt
249      - regulator-boot-on
250      - regulator-always-on
251      - vin-supply
252
253required:
254  - compatible
255  - reg
256  - reset-gpios
257  - lochnagar-clk
258  - lochnagar-pinctrl
259
260additionalProperties: false
261
262examples:
263  - |
264    #include <dt-bindings/clk/lochnagar.h>
265    #include <dt-bindings/pinctrl/lochnagar.h>
266    i2c@e0004000 {
267        #address-cells = <1>;
268        #size-cells = <0>;
269        reg = <0xe0004000 0x1000>;
270
271        lochnagar: lochnagar@22 {
272            compatible = "cirrus,lochnagar2";
273            reg = <0x22>;
274
275            reset-gpios = <&gpio0 55 0>;
276            present-gpios = <&gpio0 60 0>;
277
278            lochnagarclk: lochnagar-clk {
279                compatible = "cirrus,lochnagar2-clk";
280
281                #clock-cells = <1>;
282                clocks = <&clkaudio>, <&clkpmic>;
283                clock-names = "ln-gf-mclk2", "ln-pmic-32k";
284
285                assigned-clocks = <&lochnagarclk LOCHNAGAR_CDC_MCLK1>,
286                                  <&lochnagarclk LOCHNAGAR_CDC_MCLK2>;
287                assigned-clock-parents = <&clkaudio>, <&clkpmic>;
288            };
289
290            clkpmic: lochnagar-pmic32k {
291                compatible = "fixed-clock";
292                #clock-cells = <0>;
293                clock-frequency = <32768>;
294            };
295
296            lochnagar-pinctrl {
297                compatible = "cirrus,lochnagar-pinctrl";
298
299                gpio-controller;
300                #gpio-cells = <2>;
301                gpio-ranges = <&lochnagar 0 0 LOCHNAGAR2_PIN_NUM_GPIOS>;
302
303                pinctrl-names = "default";
304                pinctrl-0 = <&pinsettings>;
305
306                pinsettings: pin-settings {
307                    ap2aif-pins {
308                        input-enable;
309                        groups = "gf-aif1";
310                        function = "codec-aif3";
311                    };
312                    codec2aif-pins {
313                        output-enable;
314                        groups = "codec-aif3";
315                        function = "gf-aif1";
316                    };
317                };
318            };
319
320            lochnagar-sc {
321                compatible = "cirrus,lochnagar2-soundcard";
322
323                #sound-dai-cells = <1>;
324
325                clocks = <&lochnagarclk LOCHNAGAR_SOUNDCARD_MCLK>;
326                clock-names = "mclk";
327            };
328
329            lochnagar-hwmon {
330                compatible = "cirrus,lochnagar2-hwmon";
331            };
332
333            MIC1VDD {
334                compatible = "cirrus,lochnagar2-mic1vdd";
335
336                cirrus,micbias-input = <3>;
337            };
338
339            MICVDD {
340                compatible = "cirrus,lochnagar2-micvdd";
341
342                SYSVDD-supply = <&wallvdd>;
343
344                regulator-min-microvolt = <3300000>;
345                regulator-max-microvolt = <3300000>;
346            };
347
348            VDD1V8 {
349                compatible = "regulator-fixed";
350
351                regulator-name = "VDD1V8";
352                regulator-min-microvolt = <1800000>;
353                regulator-max-microvolt = <1800000>;
354                regulator-boot-on;
355                regulator-always-on;
356
357                vin-supply = <&wallvdd>;
358            };
359        };
360    };
361