* [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add basic audio support
2026-11-11 17:41 [PATCH v7 0/2] Speakers for Pixel 3 / 3 XL David Heidelberg via B4 Relay
@ 2026-11-11 17:41 ` David Heidelberg via B4 Relay
2026-11-11 17:41 ` [PATCH v7 2/2] arm64: dts: qcom: sdm845-google: Add WCD9340 codec and microphone capture David Heidelberg via B4 Relay
1 sibling, 0 replies; 3+ messages in thread
From: David Heidelberg via B4 Relay @ 2026-11-11 17:41 UTC (permalink / raw)
To: Srinivas Kandagatla, Srinivas Kandagatla, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, David Rhodes,
Richard Fitzgerald, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, David Rhodes, Conor Dooley, Abel Vesa
Cc: Viken Dadhaniya, linux-sound, linux-arm-msm, linux-kernel,
patches, devicetree, phone-devel, David Heidelberg
From: David Heidelberg <david@ixit.cz>
Introduce support for sound card and wire two CS35L36 audio codecs for
top and bottom speakers.
Inspired by commit from Joel Selvaraj.
Signed-off-by: David Heidelberg <david@ixit.cz>
---
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 132 ++++++++++++++++++++-
1 file changed, 130 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
index 3c9656b88b696..fa327ff156b86 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
@@ -2,16 +2,18 @@
/dts-v1/;
#include <dt-bindings/arm/qcom,ids.h>
#include <dt-bindings/dma/qcom-gpi.h>
#include <dt-bindings/input/linux-event-codes.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
#include "sdm845.dtsi"
#include "pm8998.dtsi"
#include "pmi8998.dtsi"
/delete-node/ &mpss_region;
/delete-node/ &venus_mem;
/delete-node/ &cdsp_mem;
@@ -406,19 +408,61 @@ nfc@28 {
firmware-gpios = <&tlmm 79 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&nfc_default>;
pinctrl-names = "default";
};
};
&i2c12 {
- /* Bottom spkr (right) CS35L36 @ 40 */
+ status = "okay";
+
+ cs35l36_bottom: audio-codec@40 {
+ compatible = "cirrus,cs35l36";
+ reg = <0x40>;
+ reset-gpios = <&tlmm 112 GPIO_ACTIVE_HIGH>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "Right"; /* Bottom */
+ VA-supply = <&vreg_s4a_1p8>;
+ interrupts-extended = <&tlmm 115 IRQ_TYPE_LEVEL_LOW>;
+
+ pinctrl-0 = <&cs35l36_bottom_default_state>;
+ pinctrl-names = "default";
+
+ cirrus,boost-ind-nanohenry = <1000>;
+ cirrus,boost-ctl-select = <1>;
+ cirrus,boost-ctl-millivolt = <10000>;
+ cirrus,boost-peak-milliamp = <3700>;
+ cirrus,temp-warn-threshold = <1>;
+ cirrus,multi-amp-mode;
+ cirrus,irq-drive-select = <0>;
+ cirrus,irq-gpio-select = <0>;
+ };
+
+ cs35l36_top: audio-codec@41 {
+ compatible = "cirrus,cs35l36";
+ reg = <0x41>;
+ reset-gpios = <&tlmm 75 GPIO_ACTIVE_HIGH>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "Left"; /* Top */
+ VA-supply = <&vreg_s4a_1p8>;
+ interrupts-extended = <&tlmm 40 IRQ_TYPE_LEVEL_LOW>;
- /* Top spkr (left) CS35L36 @ 41 */
+ pinctrl-0 = <&cs35l36_top_default_state>;
+ pinctrl-names = "default";
+
+ cirrus,boost-ind-nanohenry = <1000>;
+ cirrus,boost-ctl-select = <0x01>;
+ cirrus,boost-ctl-millivolt = <10000>;
+ cirrus,boost-peak-milliamp = <3700>;
+ cirrus,temp-warn-threshold = <1>;
+ cirrus,multi-amp-mode;
+ cirrus,irq-drive-select = <0>;
+ cirrus,irq-gpio-select = <0>;
+ };
};
&ipa {
firmware-name = "qcom/sdm845/Google/blueline/ipa_fws.mbn";
memory-region = <&ipa_fw_mem>;
status = "okay";
};
@@ -451,16 +495,35 @@ &pm8998_resin {
};
&pmi8998_charger {
monitored-battery = <&battery>;
status = "okay";
};
+&q6afedai {
+ dai@72 {
+ reg = <QUATERNARY_TDM_RX_0>;
+
+ qcom,tdm-sync-mode = <0>;
+ qcom,tdm-sync-src = <1>;
+ qcom,tdm-data-out = <0>;
+ qcom,tdm-invert-sync = <0>;
+ qcom,tdm-data-delay = <1>;
+ qcom,tdm-data-align = <0>;
+ };
+};
+
+&q6asmdai {
+ dai@0 {
+ reg = <MSM_FRONTEND_DAI_MULTIMEDIA1>;
+ };
+};
+
&qupv3_id_0 {
status = "okay";
};
&qupv3_id_1 {
status = "okay";
};
@@ -474,16 +537,49 @@ &qup_uart9_rx {
bias-pull-up;
};
&qup_uart9_tx {
drive-strength = <2>;
bias-disable;
};
+&sound {
+ compatible = "qcom,sdm845-sndcard";
+ model = "Pixel 3";
+ pinctrl-0 = <&quat_mi2s_active>, <&quat_mi2s_sd0_active>,
+ <&quat_mi2s_sd1_active>;
+ pinctrl-names = "default";
+
+ /* mm[0-9]-dai-link nodes must be positioned first regardless of sorting */
+ mm1-dai-link {
+ link-name = "MultiMedia1";
+
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
+ };
+ };
+
+ cs35l36-dai-link {
+ link-name = "Speaker Playback";
+
+ codec {
+ sound-dai = <&cs35l36_bottom>, <&cs35l36_top>;
+ };
+
+ cpu {
+ sound-dai = <&q6afedai QUATERNARY_TDM_RX_0>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ };
+};
+
&tlmm {
gpio-reserved-ranges = < 0 4>, /* SPI (Intel MNH Pixel Visual Core) */
<81 4>; /* SPI (most likely Fingerprint Cards FPC1075) */
panel_default: panel-default-state {
reset-pins {
pins = "gpio6";
function = "gpio";
@@ -531,16 +627,48 @@ touchscreen_reset: ts-reset-state {
};
touchscreen_pins: ts-pins-gpio-state {
pins = "gpio125";
function = "gpio";
drive-strength = <2>;
bias-disable;
};
+
+ cs35l36_bottom_default_state: cs35l36-bottom-default-state {
+ reset-pins {
+ pins = "gpio112";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ irq-pins {
+ pins = "gpio115";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+ };
+
+ cs35l36_top_default_state: cs35l36-top-default-state {
+ irq-pins {
+ pins = "gpio40";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+
+ reset-pins {
+ pins = "gpio75";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+ };
};
&uart6 {
pinctrl-0 = <&qup_uart6_4pin>;
status = "okay";
bluetooth {
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v7 2/2] arm64: dts: qcom: sdm845-google: Add WCD9340 codec and microphone capture
2026-11-11 17:41 [PATCH v7 0/2] Speakers for Pixel 3 / 3 XL David Heidelberg via B4 Relay
2026-11-11 17:41 ` [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add basic audio support David Heidelberg via B4 Relay
@ 2026-11-11 17:41 ` David Heidelberg via B4 Relay
1 sibling, 0 replies; 3+ messages in thread
From: David Heidelberg via B4 Relay @ 2026-11-11 17:41 UTC (permalink / raw)
To: Srinivas Kandagatla, Srinivas Kandagatla, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, David Rhodes,
Richard Fitzgerald, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, David Rhodes, Conor Dooley, Abel Vesa
Cc: Viken Dadhaniya, linux-sound, linux-arm-msm, linux-kernel,
patches, devicetree, phone-devel, David Heidelberg
From: David Heidelberg <david@ixit.cz>
The Pixel 3 sound card so far only drove the two CS35L36 speaker
amplifiers. Wire in the WCD9340 codec, add a SLIMbus capture link
for it and route the three digital microphones
Based on work done by Casey Tunturi.
Signed-off-by: David Heidelberg <david@ixit.cz>
---
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 56 ++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
index fa327ff156b86..7020bbddbcff2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
@@ -4,18 +4,20 @@
#include <dt-bindings/arm/qcom,ids.h>
#include <dt-bindings/dma/qcom-gpi.h>
#include <dt-bindings/input/linux-event-codes.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
+#include <dt-bindings/sound/qcom,wcd934x.h>
#include "sdm845.dtsi"
+#include "sdm845-wcd9340.dtsi"
#include "pm8998.dtsi"
#include "pmi8998.dtsi"
/delete-node/ &mpss_region;
/delete-node/ &venus_mem;
/delete-node/ &cdsp_mem;
/delete-node/ &mba_region;
/delete-node/ &slpi_mem;
@@ -512,16 +514,20 @@ dai@72 {
qcom,tdm-data-align = <0>;
};
};
&q6asmdai {
dai@0 {
reg = <MSM_FRONTEND_DAI_MULTIMEDIA1>;
};
+
+ dai@1 {
+ reg = <MSM_FRONTEND_DAI_MULTIMEDIA2>;
+ };
};
&qupv3_id_0 {
status = "okay";
};
&qupv3_id_1 {
status = "okay";
@@ -544,40 +550,79 @@ &qup_uart9_tx {
&sound {
compatible = "qcom,sdm845-sndcard";
model = "Pixel 3";
pinctrl-0 = <&quat_mi2s_active>, <&quat_mi2s_sd0_active>,
<&quat_mi2s_sd1_active>;
pinctrl-names = "default";
+ audio-routing = "DMIC0", "MCLK", /* Top mic */
+ "DMIC0", "MIC BIAS1",
+ "DMIC3", "MCLK", /* Top-edge mic */
+ "DMIC3", "MIC BIAS3",
+ "DMIC4", "MCLK", /* Bottom mic */
+ "DMIC4", "MIC BIAS4";
+
/* mm[0-9]-dai-link nodes must be positioned first regardless of sorting */
mm1-dai-link {
link-name = "MultiMedia1";
cpu {
sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
};
};
+ mm2-dai-link {
+ link-name = "MultiMedia2";
+
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
+ };
+ };
+
cs35l36-dai-link {
link-name = "Speaker Playback";
codec {
sound-dai = <&cs35l36_bottom>, <&cs35l36_top>;
};
cpu {
sound-dai = <&q6afedai QUATERNARY_TDM_RX_0>;
};
platform {
sound-dai = <&q6routing>;
};
};
+
+ slimcap-dai-link {
+ link-name = "SLIM Capture 1";
+
+ codec {
+ sound-dai = <&wcd9340 AIF1_CAP>;
+ };
+
+ cpu {
+ sound-dai = <&q6afedai SLIMBUS_0_TX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ };
+};
+
+&swm {
+ /*
+ * Nothing hangs off the codec's SoundWire bus on this board: the
+ * speakers are CS35L36 amplifiers on QUAT_TDM.
+ */
+ status = "disabled";
};
&tlmm {
gpio-reserved-ranges = < 0 4>, /* SPI (Intel MNH Pixel Visual Core) */
<81 4>; /* SPI (most likely Fingerprint Cards FPC1075) */
panel_default: panel-default-state {
reset-pins {
@@ -732,16 +777,27 @@ &usb_1_qmpphy {
};
&venus {
firmware-name = "qcom/sdm845/Google/blueline/venus.mbn";
status = "okay";
};
+&wcd9340 {
+ /* PM8998 LN_BB_CLK2 feeds the Pixel Visual Core on this board */
+ clocks = <&rpmhcc RPMH_LN_BB_CLK3>;
+ reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
+ vdd-buck-supply = <&vreg_s4a_1p8>;
+ vdd-buck-sido-supply = <&vreg_s4a_1p8>;
+ vdd-tx-supply = <&vreg_s4a_1p8>;
+ vdd-rx-supply = <&vreg_s4a_1p8>;
+ vdd-io-supply = <&vreg_s4a_1p8>;
+};
+
&wifi {
vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
vdd-1.8-xo-supply = <&vreg_pmu_xo>;
vdd-1.3-rfa-supply = <&vreg_pmu_rf>;
vdd-3.3-ch0-supply = <&vreg_pmu_ch0>;
qcom,snoc-host-cap-8bit-quirk;
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread