Skip to content

Commit 38d0b80

Browse files
alexVinarskisandersson
authored andcommitted
arm64: dts: qcom: x1-asus-zenbook: support sound
Works: * Both speakers * Both MICs * Headphones jack, L/R channels * Headphones jack, MIC Now working/untested: * Sound over DisplayPort * Sound over HDMI Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Aleksandrs Vinarskis <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 49918a1 commit 38d0b80

File tree

1 file changed

+194
-0
lines changed

1 file changed

+194
-0
lines changed

arch/arm64/boot/dts/qcom/x1-asus-zenbook-a14.dtsi

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,32 @@
2222
serial1 = &uart14;
2323
};
2424

25+
wcd938x: audio-codec {
26+
compatible = "qcom,wcd9385-codec";
27+
28+
pinctrl-0 = <&wcd_default>;
29+
pinctrl-names = "default";
30+
31+
qcom,micbias1-microvolt = <1800000>;
32+
qcom,micbias2-microvolt = <1800000>;
33+
qcom,micbias3-microvolt = <1800000>;
34+
qcom,micbias4-microvolt = <1800000>;
35+
qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>;
36+
qcom,mbhc-headset-vthreshold-microvolt = <1700000>;
37+
qcom,mbhc-headphone-vthreshold-microvolt = <50000>;
38+
qcom,rx-device = <&wcd_rx>;
39+
qcom,tx-device = <&wcd_tx>;
40+
41+
reset-gpios = <&tlmm 191 GPIO_ACTIVE_LOW>;
42+
43+
vdd-buck-supply = <&vreg_l15b_1p8>;
44+
vdd-rxtx-supply = <&vreg_l15b_1p8>;
45+
vdd-io-supply = <&vreg_l15b_1p8>;
46+
vdd-mic-bias-supply = <&vreg_bob1>;
47+
48+
#sound-dai-cells = <1>;
49+
};
50+
2551
gpio-keys {
2652
compatible = "gpio-keys";
2753

@@ -149,6 +175,88 @@
149175
};
150176
};
151177

178+
sound {
179+
compatible = "qcom,x1e80100-sndcard";
180+
model = "X1E80100-ASUS-Zenbook-A14";
181+
audio-routing = "SpkrLeft IN", "WSA WSA_SPK1 OUT",
182+
"SpkrRight IN", "WSA WSA_SPK2 OUT",
183+
"IN1_HPHL", "HPHL_OUT",
184+
"IN2_HPHR", "HPHR_OUT",
185+
"AMIC2", "MIC BIAS2",
186+
"VA DMIC0", "MIC BIAS1",
187+
"VA DMIC1", "MIC BIAS1",
188+
"VA DMIC0", "VA MIC BIAS1",
189+
"VA DMIC1", "VA MIC BIAS1",
190+
"TX SWR_INPUT1", "ADC2_OUTPUT";
191+
192+
va-dai-link {
193+
link-name = "VA Capture";
194+
195+
codec {
196+
sound-dai = <&lpass_vamacro 0>;
197+
};
198+
199+
cpu {
200+
sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
201+
};
202+
203+
platform {
204+
sound-dai = <&q6apm>;
205+
};
206+
};
207+
208+
wcd-capture-dai-link {
209+
link-name = "WCD Capture";
210+
211+
codec {
212+
sound-dai = <&wcd938x 1>, <&swr2 1>,
213+
<&lpass_txmacro 0>;
214+
};
215+
216+
cpu {
217+
sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
218+
};
219+
220+
platform {
221+
sound-dai = <&q6apm>;
222+
};
223+
};
224+
225+
wcd-playback-dai-link {
226+
link-name = "WCD Playback";
227+
228+
codec {
229+
sound-dai = <&wcd938x 0>, <&swr1 0>,
230+
<&lpass_rxmacro 0>;
231+
};
232+
233+
cpu {
234+
sound-dai = <&q6apmbedai RX_CODEC_DMA_RX_0>;
235+
};
236+
237+
platform {
238+
sound-dai = <&q6apm>;
239+
};
240+
};
241+
242+
wsa-dai-link {
243+
link-name = "WSA Playback";
244+
245+
codec {
246+
sound-dai = <&left_spkr>, <&right_spkr>,
247+
<&swr0 0>, <&lpass_wsamacro 0>;
248+
};
249+
250+
cpu {
251+
sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>;
252+
};
253+
254+
platform {
255+
sound-dai = <&q6apm>;
256+
};
257+
};
258+
};
259+
152260
vreg_edp_3p3: regulator-edp-3p3 {
153261
compatible = "regulator-fixed";
154262

@@ -372,6 +480,13 @@
372480
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
373481
};
374482

483+
vreg_l1b_1p8: ldo1 {
484+
regulator-name = "vreg_l1b_1p8";
485+
regulator-min-microvolt = <1800000>;
486+
regulator-max-microvolt = <1800000>;
487+
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
488+
};
489+
375490
vreg_l2b_3p0: ldo2 {
376491
regulator-name = "vreg_l2b_3p0";
377492
regulator-min-microvolt = <3072000>;
@@ -843,6 +958,24 @@
843958
};
844959
};
845960

961+
&lpass_tlmm {
962+
spkr_01_sd_n_active: spkr-01-sd-n-active-state {
963+
pins = "gpio12";
964+
function = "gpio";
965+
drive-strength = <16>;
966+
bias-disable;
967+
output-low;
968+
};
969+
};
970+
971+
&lpass_vamacro {
972+
pinctrl-0 = <&dmic01_default>;
973+
pinctrl-names = "default";
974+
975+
vdd-micb-supply = <&vreg_l1b_1p8>;
976+
qcom,dmic-sample-rate = <4800000>;
977+
};
978+
846979
&mdss {
847980
status = "okay";
848981
};
@@ -1045,6 +1178,59 @@
10451178
/* Unknown device */
10461179
};
10471180

1181+
&swr0 {
1182+
status = "okay";
1183+
1184+
pinctrl-0 = <&wsa_swr_active>, <&spkr_01_sd_n_active>;
1185+
pinctrl-names = "default";
1186+
1187+
/* WSA8845, Left Speaker */
1188+
left_spkr: speaker@0,0 {
1189+
compatible = "sdw20217020400";
1190+
reg = <0 0>;
1191+
reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>;
1192+
#sound-dai-cells = <0>;
1193+
sound-name-prefix = "SpkrLeft";
1194+
vdd-1p8-supply = <&vreg_l15b_1p8>;
1195+
vdd-io-supply = <&vreg_l12b_1p2>;
1196+
qcom,port-mapping = <1 2 3 7 10 13>;
1197+
};
1198+
1199+
/* WSA8845, Right Speaker */
1200+
right_spkr: speaker@0,1 {
1201+
compatible = "sdw20217020400";
1202+
reg = <0 1>;
1203+
reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>;
1204+
#sound-dai-cells = <0>;
1205+
sound-name-prefix = "SpkrRight";
1206+
vdd-1p8-supply = <&vreg_l15b_1p8>;
1207+
vdd-io-supply = <&vreg_l12b_1p2>;
1208+
qcom,port-mapping = <4 5 6 7 11 13>;
1209+
};
1210+
};
1211+
1212+
&swr1 {
1213+
status = "okay";
1214+
1215+
/* WCD9385 RX */
1216+
wcd_rx: codec@0,4 {
1217+
compatible = "sdw20217010d00";
1218+
reg = <0 4>;
1219+
qcom,rx-port-mapping = <1 2 3 4 5>;
1220+
};
1221+
};
1222+
1223+
&swr2 {
1224+
status = "okay";
1225+
1226+
/* WCD9385 TX */
1227+
wcd_tx: codec@0,3 {
1228+
compatible = "sdw20217010d00";
1229+
reg = <0 3>;
1230+
qcom,tx-port-mapping = <2 2 3 4>;
1231+
};
1232+
};
1233+
10481234
&tlmm {
10491235
gpio-reserved-ranges = <44 4>, /* SPI11, TZ Protected */
10501236
<90 1>; /* Unknown, TZ Protected */
@@ -1175,6 +1361,14 @@
11751361
bias-disable;
11761362
};
11771363

1364+
wcd_default: wcd-reset-n-active-state {
1365+
pins = "gpio191";
1366+
function = "gpio";
1367+
drive-strength = <16>;
1368+
bias-disable;
1369+
output-low;
1370+
};
1371+
11781372
wcn_bt_en: wcn-bt-en-state {
11791373
pins = "gpio116";
11801374
function = "gpio";

0 commit comments

Comments
 (0)