xref: /freebsd/sys/contrib/device-tree/Bindings/sound/mt8195-mt6359.yaml (revision 9978553d0199e7ec0bdd1c44fc7f6c7b0c11e43b)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/mt8195-mt6359.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: MediaTek MT8195 ASoC sound card driver
8
9maintainers:
10  - Trevor Wu <trevor.wu@mediatek.com>
11
12description:
13  This binding describes the MT8195 sound card.
14
15allOf:
16  - $ref: sound-card-common.yaml#
17
18properties:
19  compatible:
20    enum:
21      - mediatek,mt8195_mt6359_rt1019_rt5682
22      - mediatek,mt8195_mt6359_rt1011_rt5682
23      - mediatek,mt8195_mt6359_max98390_rt5682
24      - mediatek,mt8195_mt6359
25
26  model:
27    $ref: /schemas/types.yaml#/definitions/string
28    description: User specified audio sound card name
29
30  audio-routing:
31    description:
32      A list of the connections between audio components. Each entry is a
33      pair of strings, the first being the connection's sink, the second
34      being the connection's source.
35      Valid names could be the input or output widgets of audio components,
36      power supplies, MicBias of codec and the software switch.
37    minItems: 2
38    items:
39      enum:
40        # Sinks
41        - Ext Spk
42        - Headphone
43        - IN1P
44        - Left Spk
45        - Right Spk
46
47        # Sources
48        - Headphone L
49        - Headphone R
50        - Headset Mic
51        - HPOL
52        - HPOR
53        - Left BE_OUT
54        - Left SPO
55        - Right BE_OUT
56        - Right SPO
57        - Speaker
58
59  mediatek,platform:
60    $ref: /schemas/types.yaml#/definitions/phandle
61    description: The phandle of MT8195 ASoC platform.
62
63  mediatek,dptx-codec:
64    $ref: /schemas/types.yaml#/definitions/phandle
65    description: The phandle of MT8195 Display Port Tx codec node.
66    deprecated: true
67
68  mediatek,hdmi-codec:
69    $ref: /schemas/types.yaml#/definitions/phandle
70    description: The phandle of MT8195 HDMI codec node.
71    deprecated: true
72
73  mediatek,adsp:
74    $ref: /schemas/types.yaml#/definitions/phandle
75    description: The phandle of MT8195 ADSP platform.
76
77  mediatek,dai-link:
78    $ref: /schemas/types.yaml#/definitions/string-array
79    description:
80      A list of the desired dai-links in the sound card. Each entry is a
81      name defined in the machine driver.
82
83patternProperties:
84  ".*-dai-link$":
85    type: object
86    additionalProperties: false
87    description:
88      Container for dai-link level properties and CODEC sub-nodes.
89
90    properties:
91      link-name:
92        description: Indicates dai-link name and PCM stream name
93        enum:
94          - DL_SRC_BE
95          - DPTX_BE
96          - ETDM1_IN_BE
97          - ETDM2_IN_BE
98          - ETDM1_OUT_BE
99          - ETDM2_OUT_BE
100          - ETDM3_OUT_BE
101          - PCM1_BE
102
103      codec:
104        description: Holds subnode which indicates codec dai.
105        type: object
106        additionalProperties: false
107        properties:
108          sound-dai:
109            minItems: 1
110            maxItems: 2
111        required:
112          - sound-dai
113
114      dai-format:
115        description: audio format
116        enum: [ i2s, right_j, left_j, dsp_a, dsp_b ]
117
118      mediatek,clk-provider:
119        $ref: /schemas/types.yaml#/definitions/string
120        description: Indicates dai-link clock master.
121        enum: [ cpu, codec ]
122
123    required:
124      - link-name
125
126additionalProperties: false
127
128required:
129  - compatible
130  - mediatek,platform
131
132# Disallow legacy properties if xxx-dai-link nodes are specified
133if:
134  not:
135    patternProperties:
136      ".*-dai-link$": false
137then:
138  properties:
139    mediatek,dptx-codec: false
140    mediatek,hdmi-codec: false
141
142examples:
143  - |
144
145    sound: mt8195-sound {
146        compatible = "mediatek,mt8195_mt6359_rt1019_rt5682";
147        model = "mt8195_r1019_5682";
148        mediatek,platform = <&afe>;
149        pinctrl-names = "default";
150        pinctrl-0 = <&aud_pins_default>;
151
152        audio-routing =
153                "Headphone", "HPOL",
154                "Headphone", "HPOR",
155                "IN1P", "Headset Mic",
156                "Ext Spk", "Speaker";
157
158        mm-dai-link {
159                link-name = "ETDM1_IN_BE";
160                mediatek,clk-provider = "cpu";
161        };
162
163        hs-playback-dai-link {
164                link-name = "ETDM1_OUT_BE";
165                mediatek,clk-provider = "cpu";
166                codec {
167                        sound-dai = <&headset_codec>;
168                };
169        };
170
171        hs-capture-dai-link {
172                link-name = "ETDM2_IN_BE";
173                mediatek,clk-provider = "cpu";
174                codec {
175                        sound-dai = <&headset_codec>;
176                };
177        };
178
179        spk-playback-dai-link {
180                link-name = "ETDM2_OUT_BE";
181                mediatek,clk-provider = "cpu";
182                codec {
183                        sound-dai = <&spk_amplifier>;
184                };
185        };
186
187        hdmi-dai-link {
188                link-name = "ETDM3_OUT_BE";
189                codec {
190                        sound-dai = <&hdmi_tx>;
191                };
192        };
193
194        displayport-dai-link {
195                link-name = "DPTX_BE";
196                codec {
197                        sound-dai = <&dp_tx>;
198                };
199        };
200    };
201
202...
203