Skip to content

Commit dc7a313

Browse files
AngeloGioacchino Del Regnobroonie
authored andcommitted
ASoC: dt-bindings: mt8195: Document audio-routing and dai-link subnode
Document the dai-link subnodes and the audio-routing property, allowing to describe machine specific audio hardware and links in device tree. While at it, also deprecate the old properties which were previously used with driver hardcoded configuration. Also, since describing machine specific audio hardware and links replaces the now deprecated old logic doing the same in a driver hardcoded fashion, it is not allowed to have both the old and new properties together. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20240416071410.75620-15-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6ed619b commit dc7a313

1 file changed

Lines changed: 134 additions & 0 deletions

File tree

Documentation/devicetree/bindings/sound/mt8195-mt6359.yaml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ maintainers:
1212
description:
1313
This binding describes the MT8195 sound card.
1414

15+
allOf:
16+
- $ref: sound-card-common.yaml#
17+
1518
properties:
1619
compatible:
1720
enum:
@@ -23,17 +26,46 @@ properties:
2326
$ref: /schemas/types.yaml#/definitions/string
2427
description: User specified audio sound card name
2528

29+
audio-routing:
30+
description:
31+
A list of the connections between audio components. Each entry is a
32+
pair of strings, the first being the connection's sink, the second
33+
being the connection's source.
34+
Valid names could be the input or output widgets of audio components,
35+
power supplies, MicBias of codec and the software switch.
36+
minItems: 2
37+
items:
38+
enum:
39+
# Sinks
40+
- Ext Spk
41+
- Headphone
42+
- IN1P
43+
- Left Spk
44+
- Right Spk
45+
46+
# Sources
47+
- Headset Mic
48+
- HPOL
49+
- HPOR
50+
- Left BE_OUT
51+
- Left SPO
52+
- Right BE_OUT
53+
- Right SPO
54+
- Speaker
55+
2656
mediatek,platform:
2757
$ref: /schemas/types.yaml#/definitions/phandle
2858
description: The phandle of MT8195 ASoC platform.
2959

3060
mediatek,dptx-codec:
3161
$ref: /schemas/types.yaml#/definitions/phandle
3262
description: The phandle of MT8195 Display Port Tx codec node.
63+
deprecated: true
3364

3465
mediatek,hdmi-codec:
3566
$ref: /schemas/types.yaml#/definitions/phandle
3667
description: The phandle of MT8195 HDMI codec node.
68+
deprecated: true
3769

3870
mediatek,adsp:
3971
$ref: /schemas/types.yaml#/definitions/phandle
@@ -45,20 +77,122 @@ properties:
4577
A list of the desired dai-links in the sound card. Each entry is a
4678
name defined in the machine driver.
4779

80+
patternProperties:
81+
".*-dai-link$":
82+
type: object
83+
additionalProperties: false
84+
description:
85+
Container for dai-link level properties and CODEC sub-nodes.
86+
87+
properties:
88+
link-name:
89+
description: Indicates dai-link name and PCM stream name
90+
enum:
91+
- DPTX_BE
92+
- ETDM1_IN_BE
93+
- ETDM2_IN_BE
94+
- ETDM1_OUT_BE
95+
- ETDM2_OUT_BE
96+
- ETDM3_OUT_BE
97+
- PCM1_BE
98+
99+
codec:
100+
description: Holds subnode which indicates codec dai.
101+
type: object
102+
additionalProperties: false
103+
properties:
104+
sound-dai:
105+
minItems: 1
106+
maxItems: 2
107+
required:
108+
- sound-dai
109+
110+
dai-format:
111+
description: audio format
112+
enum: [ i2s, right_j, left_j, dsp_a, dsp_b ]
113+
114+
mediatek,clk-provider:
115+
$ref: /schemas/types.yaml#/definitions/string
116+
description: Indicates dai-link clock master.
117+
enum: [ cpu, codec ]
118+
119+
required:
120+
- link-name
121+
48122
additionalProperties: false
49123

50124
required:
51125
- compatible
52126
- mediatek,platform
53127

128+
# Disallow legacy properties if xxx-dai-link nodes are specified
129+
if:
130+
not:
131+
patternProperties:
132+
".*-dai-link$": false
133+
then:
134+
properties:
135+
mediatek,dptx-codec: false
136+
mediatek,hdmi-codec: false
137+
54138
examples:
55139
- |
56140
57141
sound: mt8195-sound {
58142
compatible = "mediatek,mt8195_mt6359_rt1019_rt5682";
143+
model = "mt8195_r1019_5682";
59144
mediatek,platform = <&afe>;
60145
pinctrl-names = "default";
61146
pinctrl-0 = <&aud_pins_default>;
147+
148+
audio-routing =
149+
"Headphone", "HPOL",
150+
"Headphone", "HPOR",
151+
"IN1P", "Headset Mic",
152+
"Ext Spk", "Speaker";
153+
154+
mm-dai-link {
155+
link-name = "ETDM1_IN_BE";
156+
mediatek,clk-provider = "cpu";
157+
};
158+
159+
hs-playback-dai-link {
160+
link-name = "ETDM1_OUT_BE";
161+
mediatek,clk-provider = "cpu";
162+
codec {
163+
sound-dai = <&headset_codec>;
164+
};
165+
};
166+
167+
hs-capture-dai-link {
168+
link-name = "ETDM2_IN_BE";
169+
mediatek,clk-provider = "cpu";
170+
codec {
171+
sound-dai = <&headset_codec>;
172+
};
173+
};
174+
175+
spk-playback-dai-link {
176+
link-name = "ETDM2_OUT_BE";
177+
mediatek,clk-provider = "cpu";
178+
codec {
179+
sound-dai = <&spk_amplifier>;
180+
};
181+
};
182+
183+
hdmi-dai-link {
184+
link-name = "ETDM3_OUT_BE";
185+
codec {
186+
sound-dai = <&hdmi_tx>;
187+
};
188+
};
189+
190+
displayport-dai-link {
191+
link-name = "DPTX_BE";
192+
codec {
193+
sound-dai = <&dp_tx>;
194+
};
195+
};
62196
};
63197
64198
...

0 commit comments

Comments
 (0)