1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/amlogic,gx-sound-card.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Amlogic GX sound card
8
9maintainers:
10  - Jerome Brunet <jbrunet@baylibre.com>
11
12properties:
13  compatible:
14    items:
15      - const: amlogic,gx-sound-card
16
17  audio-aux-devs:
18    $ref: /schemas/types.yaml#/definitions/phandle-array
19    description: list of auxiliary devices
20
21  audio-routing:
22    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
23    minItems: 2
24    description: |-
25      A list of the connections between audio components. Each entry is a
26      pair of strings, the first being the connection's sink, the second
27      being the connection's source.
28
29  audio-widgets:
30    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
31    minItems: 2
32    description: |-
33      A list off component DAPM widget. Each entry is a pair of strings,
34      the first being the widget type, the second being the widget name
35
36  model:
37    $ref: /schemas/types.yaml#/definitions/string
38    description: User specified audio sound card name
39
40patternProperties:
41  "^dai-link-[0-9]+$":
42    type: object
43    additionalProperties: false
44    description: |-
45      dai-link child nodes:
46        Container for dai-link level properties and the CODEC sub-nodes.
47        There should be at least one (and probably more) subnode of this type
48
49    properties:
50      dai-format:
51        $ref: /schemas/types.yaml#/definitions/string
52        enum: [ i2s, left-j, dsp_a ]
53
54      mclk-fs:
55        $ref: /schemas/types.yaml#/definitions/uint32
56        description: |-
57          Multiplication factor between the frame rate and master clock
58          rate
59
60      sound-dai:
61        maxItems: 1
62        description: phandle of the CPU DAI
63
64    patternProperties:
65      "^codec-[0-9]+$":
66        type: object
67        additionalProperties: false
68        description: |-
69          Codecs:
70          dai-link representing backend links should have at least one subnode.
71          One subnode for each codec of the dai-link. dai-link representing
72          frontend links have no codec, therefore have no subnodes
73
74        properties:
75          sound-dai:
76            maxItems: 1
77            description: phandle of the codec DAI
78
79        required:
80          - sound-dai
81
82    required:
83      - sound-dai
84
85required:
86  - model
87  - dai-link-0
88
89additionalProperties: false
90
91examples:
92  - |
93    sound {
94        compatible = "amlogic,gx-sound-card";
95        model = "GXL-ACME-S905X-FOO";
96        audio-aux-devs = <&amp>;
97        audio-routing = "I2S ENCODER I2S IN", "I2S FIFO Playback";
98
99        dai-link-0 {
100               sound-dai = <&i2s_fifo>;
101        };
102
103        dai-link-1 {
104                sound-dai = <&i2s_encoder>;
105                dai-format = "i2s";
106                mclk-fs = <256>;
107
108                codec-0 {
109                        sound-dai = <&codec0>;
110                };
111
112                codec-1 {
113                        sound-dai = <&codec1>;
114                };
115        };
116    };
117