Speakers for Pixel 3 / 3 XL
v7 cover Speakers for Pixel 3 / 3 XL
This series address:
--- merged
0. demistify the hex to BIT() macro and add left/right rx spk
1. most likely wrongly set DSP_B in sdm845.c
my guess this is because TDM was never used in the mainline with sdm845
2. applying correct mask to left/right speaker for the TDM in sdm845.c, so both speakers can work simultaneusly
3. setting sysclk at startups, which some codecs need (such as cs35l36)
4. setting proper tdm slot in the cs35l36 driver
--- remains:
5. device-tree wiring for Pixel 3 / 3 XL speakers
6. same for microphone.
As per previous discussion not seding patch removing the "Input Mux" which now interferes with TDM callback. If wanted, I can send it as a follow-up.
---
Changes in v7:
- Edited swm node disable comment.
- Rebased on top of next-20261110 (small conflict resolved).
- Link to v6: https://patch.msgid.link/[email protected]
Changes in v6:
- Everything expect device-tree changes got merged. Rebased on top of latest next-20261016.
- Link to v5: https://patch.msgid.link/[email protected]
Changes in v5:
- Dropped
slimbus: qcom-ngd-ctrl: Remove data channels on stream disable
in favor of now merged
slimbus: qcom-ngd-ctrl: Implement disable_stream callback
- Applied R-bs.
- Small clarifications in the commit messages and comments blocks.
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- Rebase on top of d4d1619ebd55 ("ASoC: codecs: cs35l*: use .auto_selectable_formats") (Mark)
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- De-RFC, applied Reviewed-by tag.
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- Device-tree name sorting, with exception keeping mm1-dai-link in it's place. (Konrad)
- Make set_tdm_slot cleaner and less leveled. (Konrad)
- Added TDM MIC defines in sdm845.c.
Should we in capture use speaker mask?
- Renamed model from 'Google Pixel 3' to 'blueline', I would love to
hear feedback on this one.
- Link to v1: https://lore.kernel.org/r/[email protected]
To: Srinivas Kandagatla <[email protected]>
To: Liam Girdwood <[email protected]>
To: Mark Brown <[email protected]>
To: Jaroslav Kysela <[email protected]>
To: Takashi Iwai <[email protected]>
To: David Rhodes <[email protected]>
To: Richard Fitzgerald <[email protected]>
To: Bjorn Andersson <[email protected]>
To: Konrad Dybcio <[email protected]>
To: Abel Vesa <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
David Heidelberg (2):
arm64: dts: qcom: sdm845-google: Add basic audio support
arm64: dts: qcom: sdm845-google: Add WCD9340 codec and microphone capture
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 188 ++++++++++++++++++++- 1 file changed, 186 insertions(+), 2 deletions(-)
---
base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
change-id: 20260613-pixel3-audio-bdbfb49e8037
Best regards,
Signature · 1 line
David Heidelberg <[email protected]>
PATCH v7 1/2 arm64: dts: qcom: sdm845-google: Add basic audio support
Introduce support for sound card and wire two CS35L36 audio codecs for top and bottom speakers.
Inspired by commit from Joel Selvaraj.
--- arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 132 ++++++++++++++++++++- 1 file changed, 130 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +130 -2
@@ -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 {
Signature · 1 line
2.55.0
Re: [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add basic audio support
Quoted 4 lines · On 11/11/26 6:41 PM, David Heidelberg via B4 Relay wrote:
From: David Heidelberg <[email protected]>
Introduce support for sound card and wire two CS35L36 audio codecs for top and bottom speakers.
[...]
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi &qup_uart9_rx { · line 552
Quoted 8 lines
+&sound {
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +7
-0+ 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 */
Could you try the patch in
https://lore.kernel.org/linux-arm-msm/[email protected]/
?
Konrad
Re: [PATCH v7 1/2] arm64: dts: qcom: sdm845-google: Add basic audio support
Quoted 19 lines · Konrad Dybcio
Quoted 4 lines · On 11/11/26 6:41 PM, David Heidelberg via B4 Relay wrote:
From: David Heidelberg <[email protected]>
Introduce support for sound card and wire two CS35L36 audio codecs for top and bottom speakers.
[...]
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi &qup_uart9_rx { · line 552
Quoted 8 lines
+&sound {
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +7
-0+ 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 */Could you try the patch in
Quoted 3 lines
https://lore.kernel.org/linux-arm-msm/[email protected]/
?
Sure, I'll test today.
Thou, changing this patch without precursor being merged would mean +- delaying patch inclusion at least by one merging window*.
I'm very much fine thou bind to this patch and when included send sorting for all sdm845-* devices.
*still having patches for Pixel 3 camera in my fork ~ 4 month from these patches has been reviewed and ready for merge, due to recommendation to use header which didn't got in Linux in time.
David
Quoted 2 lines
Konrad
PATCH v7 2/2 arm64: dts: qcom: sdm845-google: Add WCD9340 codec and microphone capture
In reply to David HeidelbergThe 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.
--- arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +56 -0
@@ -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;
Signature · 1 line
2.55.0