summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/mfd/cirrus,lochnagar.yaml
blob: c00ad3e21c21c1c4efc1dfeeae6ec7c6e8f50bec (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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/cirrus,lochnagar.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic Lochnagar Audio Development Board

maintainers:
  - patches@opensource.cirrus.com

description: |
  Lochnagar is an evaluation and development board for Cirrus Logic
  Smart CODEC and Amp devices. It allows the connection of most Cirrus
  Logic devices on mini-cards, as well as allowing connection of
  various application processor systems to provide a full evaluation
  platform.  Audio system topology, clocking and power can all be
  controlled through the Lochnagar, allowing the device under test
  to be used in a variety of possible use cases.

  Also see these documents for generic binding information:
    [1] GPIO : ../gpio/gpio.txt

  And these for relevant defines:
    [2] include/dt-bindings/pinctrl/lochnagar.h
    [3] include/dt-bindings/clock/lochnagar.h

  And these documents for the required sub-node binding details:
    [4] Clock: ../clock/cirrus,lochnagar.yaml
    [5] Pinctrl: ../pinctrl/cirrus,lochnagar.yaml
    [6] Sound: ../sound/cirrus,lochnagar.yaml
    [7] Hardware Monitor: ../hwmon/cirrus,lochnagar.yaml

allOf:
  - if:
      properties:
        compatible:
          enum:
            - cirrus,lochnagar2
    then:
      properties:
        lochnagar-hwmon:
          type: object
          $ref: /schemas/hwmon/cirrus,lochnagar.yaml#

        lochnagar-sc:
          type: object
          $ref: /schemas/sound/cirrus,lochnagar.yaml#

properties:
  compatible:
    enum:
      - cirrus,lochnagar1
      - cirrus,lochnagar2

  reg:
    const: 0x22

  reset-gpios:
    maxItems: 1

  present-gpios:
    description: |
      Host present line, indicating the presence of a
      host system, see [1]. This can be omitted if the present line is
      tied in hardware.
    maxItems: 1

  lochnagar-clk:
    type: object
    $ref: /schemas/clock/cirrus,lochnagar.yaml#

  lochnagar-pmic32k:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 32768

  lochnagar-clk12m:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 12288000

  lochnagar-clk11m:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 11298600

  lochnagar-clk24m:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 24576000

  lochnagar-clk22m:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 22579200

  lochnagar-clk8m:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 8192000

  lochnagar-usb24m:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 24576000

  lochnagar-usb12m:
    type: object
    $ref: /schemas/clock/fixed-clock.yaml#
    properties:
      clock-frequency:
        const: 12288000

  lochnagar-pinctrl:
    type: object
    $ref: /schemas/pinctrl/cirrus,lochnagar.yaml#

  lochnagar-hwmon:
    type: object
    $ref: /schemas/hwmon/cirrus,lochnagar.yaml#

  lochnagar-sc:
    type: object
    $ref: /schemas/sound/cirrus,lochnagar.yaml#

  VDDCORE:
    description:
      Initialisation data for the VDDCORE regulator, which supplies the
      CODECs digital core if not being provided by an internal regulator.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    properties:
      compatible:
        enum:
          - cirrus,lochnagar2-vddcore

      SYSVDD-supply:
        description:
          Primary power supply for the Lochnagar.
    required:
      - compatible

  MICVDD:
    description:
      Initialisation data for the MICVDD regulator, which supplies the
      CODECs MICVDD.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    properties:
      compatible:
        enum:
          - cirrus,lochnagar2-micvdd

      SYSVDD-supply:
        description:
          Primary power supply for the Lochnagar.
    required:
      - compatible

  MIC1VDD:
    description:
      Initialisation data for the MIC1VDD supplies.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    properties:
      compatible:
        enum:
          - cirrus,lochnagar2-mic1vdd

      cirrus,micbias-input:
        description:
          A property selecting which of the CODEC minicard micbias outputs
          should be used.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 1
        maximum: 4

      MICBIAS1-supply:
        description:
          Regulator supplies for the MIC1VDD outputs, supplying the digital
          microphones, normally supplied from the attached CODEC.
    required:
      - compatible

  MIC2VDD:
    description:
      Initialisation data for the MIC2VDD supplies.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    properties:
      compatible:
        enum:
          - cirrus,lochnagar2-mic2vdd

      cirrus,micbias-input:
        description:
          A property selecting which of the CODEC minicard micbias outputs
          should be used.
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 1
        maximum: 4

      MICBIAS2-supply:
        description:
          Regulator supplies for the MIC2VDD outputs, supplying the digital
          microphones, normally supplied from the attached CODEC.
    required:
      - compatible

  VDD1V8:
    description:
      Recommended fixed regulator for the VDD1V8 regulator, which supplies
      the CODECs analog and 1.8V digital supplies.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    properties:
      compatible:
        enum:
          - regulator-fixed

      regulator-min-microvolt:
        const: 1800000

      regulator-max-microvolt:
        const: 1800000

      vin-supply:
        description:
          Should be set to same supply as SYSVDD
    required:
      - compatible
      - regulator-min-microvolt
      - regulator-max-microvolt
      - regulator-boot-on
      - regulator-always-on
      - vin-supply

required:
  - compatible
  - reg
  - reset-gpios
  - lochnagar-clk
  - lochnagar-pinctrl

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clk/lochnagar.h>
    #include <dt-bindings/pinctrl/lochnagar.h>
    i2c@e0004000 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0xe0004000 0x1000>;

        lochnagar: lochnagar@22 {
            compatible = "cirrus,lochnagar2";
            reg = <0x22>;

            reset-gpios = <&gpio0 55 0>;
            present-gpios = <&gpio0 60 0>;

            lochnagarclk: lochnagar-clk {
                compatible = "cirrus,lochnagar2-clk";

                #clock-cells = <1>;
                clocks = <&clkaudio>, <&clkpmic>;
                clock-names = "ln-gf-mclk2", "ln-pmic-32k";

                assigned-clocks = <&lochnagarclk LOCHNAGAR_CDC_MCLK1>,
                                  <&lochnagarclk LOCHNAGAR_CDC_MCLK2>;
                assigned-clock-parents = <&clkaudio>, <&clkpmic>;
            };

            clkpmic: lochnagar-pmic32k {
                compatible = "fixed-clock";
                #clock-cells = <0>;
                clock-frequency = <32768>;
            };

            lochnagar-pinctrl {
                compatible = "cirrus,lochnagar-pinctrl";

                gpio-controller;
                #gpio-cells = <2>;
                gpio-ranges = <&lochnagar 0 0 LOCHNAGAR2_PIN_NUM_GPIOS>;

                pinctrl-names = "default";
                pinctrl-0 = <&pinsettings>;

                pinsettings: pin-settings {
                    ap2aif-pins {
                        input-enable;
                        groups = "gf-aif1";
                        function = "codec-aif3";
                    };
                    codec2aif-pins {
                        output-enable;
                        groups = "codec-aif3";
                        function = "gf-aif1";
                    };
                };
            };

            lochnagar-sc {
                compatible = "cirrus,lochnagar2-soundcard";

                #sound-dai-cells = <1>;

                clocks = <&lochnagarclk LOCHNAGAR_SOUNDCARD_MCLK>;
                clock-names = "mclk";
            };

            lochnagar-hwmon {
                compatible = "cirrus,lochnagar2-hwmon";
            };

            MIC1VDD {
                compatible = "cirrus,lochnagar2-mic1vdd";

                cirrus,micbias-input = <3>;
            };

            MICVDD {
                compatible = "cirrus,lochnagar2-micvdd";

                SYSVDD-supply = <&wallvdd>;

                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
            };

            VDD1V8 {
                compatible = "regulator-fixed";

                regulator-name = "VDD1V8";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
                regulator-boot-on;
                regulator-always-on;

                vin-supply = <&wallvdd>;
            };
        };
    };