Skip to content

Commit 5a50483

Browse files
AngeloGioacchino Del Regnobroonie
authored andcommitted
ASoC: dt-bindings: mt8192: 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 the driver's partially 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-16-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent dc7a313 commit 5a50483

1 file changed

Lines changed: 129 additions & 10 deletions

File tree

Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml

Lines changed: 129 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,54 @@ maintainers:
1313
description:
1414
This binding describes the MT8192 sound card.
1515

16+
allOf:
17+
- $ref: sound-card-common.yaml#
18+
1619
properties:
1720
compatible:
1821
enum:
1922
- mediatek,mt8192_mt6359_rt1015_rt5682
2023
- mediatek,mt8192_mt6359_rt1015p_rt5682
2124
- mediatek,mt8192_mt6359_rt1015p_rt5682s
2225

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

2755
mediatek,hdmi-codec:
2856
$ref: /schemas/types.yaml#/definitions/phandle
2957
description: The phandle of HDMI codec.
58+
deprecated: true
3059

3160
headset-codec:
3261
type: object
3362
additionalProperties: false
63+
deprecated: true
3464

3565
properties:
3666
sound-dai:
@@ -41,6 +71,7 @@ properties:
4171
speaker-codecs:
4272
type: object
4373
additionalProperties: false
74+
deprecated: true
4475

4576
properties:
4677
sound-dai:
@@ -51,33 +82,121 @@ properties:
5182
required:
5283
- sound-dai
5384

54-
additionalProperties: false
85+
patternProperties:
86+
".*-dai-link$":
87+
type: object
88+
additionalProperties: false
89+
90+
description:
91+
Container for dai-link level properties and CODEC sub-nodes.
92+
93+
properties:
94+
link-name:
95+
description: Indicates dai-link name and PCM stream name
96+
enum:
97+
- I2S0
98+
- I2S1
99+
- I2S2
100+
- I2S3
101+
- I2S4
102+
- I2S5
103+
- I2S6
104+
- I2S7
105+
- I2S8
106+
- I2S9
107+
- TDM
108+
109+
codec:
110+
description: Holds subnode which indicates codec dai.
111+
type: object
112+
additionalProperties: false
113+
properties:
114+
sound-dai:
115+
minItems: 1
116+
maxItems: 2
117+
required:
118+
- sound-dai
119+
120+
dai-format:
121+
description: audio format
122+
enum: [ i2s, right_j, left_j, dsp_a, dsp_b ]
123+
124+
mediatek,clk-provider:
125+
$ref: /schemas/types.yaml#/definitions/string
126+
description: Indicates dai-link clock master.
127+
enum: [ cpu, codec ]
128+
129+
required:
130+
- link-name
131+
132+
unevaluatedProperties: false
55133

56134
required:
57135
- compatible
58136
- mediatek,platform
59-
- headset-codec
60-
- speaker-codecs
137+
138+
# Disallow legacy properties if xxx-dai-link nodes are specified
139+
if:
140+
not:
141+
patternProperties:
142+
".*-dai-link$": false
143+
then:
144+
properties:
145+
headset-codec: false
146+
speaker-codecs: false
147+
mediatek,hdmi-codec: false
61148

62149
examples:
63150
- |
64151
65152
sound: mt8192-sound {
66153
compatible = "mediatek,mt8192_mt6359_rt1015_rt5682";
67-
mediatek,platform = <&afe>;
68-
mediatek,hdmi-codec = <&anx_bridge_dp>;
154+
model = "mt8192_mt6359_rt1015_rt5682";
69155
pinctrl-names = "aud_clk_mosi_off",
70156
"aud_clk_mosi_on";
71157
pinctrl-0 = <&aud_clk_mosi_off>;
72158
pinctrl-1 = <&aud_clk_mosi_on>;
159+
mediatek,platform = <&afe>;
160+
161+
audio-routing =
162+
"Headphone Jack", "HPOL",
163+
"Headphone Jack", "HPOR",
164+
"IN1P", "Headset Mic",
165+
"Speakers", "Speaker";
166+
167+
spk-playback-dai-link {
168+
link-name = "I2S3";
169+
dai-format = "i2s";
170+
mediatek,clk-provider = "cpu";
171+
codec {
172+
sound-dai = <&rt1015p>;
173+
};
174+
};
175+
176+
hs-playback-dai-link {
177+
link-name = "I2S8";
178+
dai-format = "i2s";
179+
mediatek,clk-provider = "cpu";
180+
codec {
181+
sound-dai = <&rt5682 0>;
182+
};
183+
};
73184
74-
headset-codec {
75-
sound-dai = <&rt5682>;
185+
hs-capture-dai-link {
186+
link-name = "I2S9";
187+
dai-format = "i2s";
188+
mediatek,clk-provider = "cpu";
189+
codec {
190+
sound-dai = <&rt5682 0>;
191+
};
76192
};
77193
78-
speaker-codecs {
79-
sound-dai = <&rt1015_l>,
80-
<&rt1015_r>;
194+
displayport-dai-link {
195+
link-name = "TDM";
196+
dai-format = "dsp_a";
197+
codec {
198+
sound-dai = <&anx_bridge_dp>;
199+
};
81200
};
82201
};
83202

0 commit comments

Comments
 (0)