Message ID | 20250527111227.2318021-8-quic_pkumpatl@quicinc.com |
---|---|
State | New |
Headers | show |
Series | Enable audio on qcs6490-RB3Gen2 and qcm6490-idp boards | expand |
On Tue May 27, 2025 at 12:12 PM BST, Prasad Kumpatla wrote: > From: Mohammad Rafi Shaik <quic_mohs@quicinc.com> > > Add nodes for WSA8830 speakers and WCD9370 headset codec > on qcm6490-idp board. > > Enable lpass macros along with audio support pin controls. > > Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com> > Co-developed-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com> > Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com> > --- > arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 96 +++++++++++++++++++ > .../boot/dts/qcom/qcs6490-audioreach.dtsi | 24 +++++ > 2 files changed, 120 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts > index 7a155ef6492e..884abbda74fd 100644 > --- a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts > +++ b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts > @@ -18,6 +18,7 @@ > #include "pm7325.dtsi" [..] > +&swr0 { > + status = "okay"; > + > + wcd937x_rx: codec@0,4 { > + compatible = "sdw20217010a00"; > + reg = <0 4>; > + qcom,rx-port-mapping = <1 2 3 4 5>; > + qcom,rx-channel-mapping = /bits/ 8 <1 2 1 1 2 1 1 2>; > + }; > +}; > + > +&swr1 { > + status = "okay"; > + > + wcd937x_tx: codec@0,3 { > + compatible = "sdw20217010a00"; > + reg = <0 3>; > + qcom,tx-port-mapping = <1 1 2 3>; > + qcom,tx-channel-mapping = /bits/ 8 <1 2 1 1 2 3 3 4 1 2 3 4>; It will be tremendously useful to add comments that elaborate the {rx,tx}-channel-mapping (and port mapping for what it's worth) here like it is done in other dt files. For example in the same way as it is done in sm8650-qrd.dts or like here: https://lore.kernel.org/linux-arm-msm/20250526-sm8750-audio-part-2-v3-3-74429c686bb1@linaro.org/ Best regards, Alexey
On 5/27/25 1:12 PM, Prasad Kumpatla wrote: > From: Mohammad Rafi Shaik <quic_mohs@quicinc.com> > > Add nodes for WSA8830 speakers and WCD9370 headset codec > on qcm6490-idp board. > > Enable lpass macros along with audio support pin controls. > > Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com> > Co-developed-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com> > Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com> > --- [...] > &uart5 { > diff --git a/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi b/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi > index 542a39ca72bb..2e75e7706fb4 100644 > --- a/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi > +++ b/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi > @@ -29,6 +29,30 @@ &lpass_dmic23_data { > bias-pull-down; > }; > > +&lpass_rx_swr_clk { > + drive-strength = <2>; > + slew-rate = <1>; > + bias-disable; > +}; > + > +&lpass_rx_swr_data { > + drive-strength = <2>; > + slew-rate = <1>; > + bias-bus-hold; > +}; > + > +&lpass_tx_swr_clk { > + drive-strength = <2>; > + slew-rate = <1>; > + bias-disable; > +}; > + > +&lpass_tx_swr_data { > + drive-strength = <2>; > + slew-rate = <1>; > + bias-bus-hold; > +}; All other DTs that overwrite these pins seem to be setting the exact same settings.. And given this pin is connected to an on-SoC peripheral, I think it would make sense to consolidate these in sc7280.dtsi Konrad
On 5/31/2025 6:05 PM, Konrad Dybcio wrote: > On 5/27/25 1:12 PM, Prasad Kumpatla wrote: >> From: Mohammad Rafi Shaik <quic_mohs@quicinc.com> >> >> Add nodes for WSA8830 speakers and WCD9370 headset codec >> on qcm6490-idp board. >> >> Enable lpass macros along with audio support pin controls. >> >> Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com> >> Co-developed-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com> >> Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com> >> --- > > [...] > >> &uart5 { >> diff --git a/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi b/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi >> index 542a39ca72bb..2e75e7706fb4 100644 >> --- a/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi >> +++ b/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi >> @@ -29,6 +29,30 @@ &lpass_dmic23_data { >> bias-pull-down; >> }; >> >> +&lpass_rx_swr_clk { >> + drive-strength = <2>; >> + slew-rate = <1>; >> + bias-disable; >> +}; >> + >> +&lpass_rx_swr_data { >> + drive-strength = <2>; >> + slew-rate = <1>; >> + bias-bus-hold; >> +}; >> + >> +&lpass_tx_swr_clk { >> + drive-strength = <2>; >> + slew-rate = <1>; >> + bias-disable; >> +}; >> + >> +&lpass_tx_swr_data { >> + drive-strength = <2>; >> + slew-rate = <1>; >> + bias-bus-hold; >> +}; > > All other DTs that overwrite these pins seem to be setting the > exact same settings.. And given this pin is connected to an on-SoC > peripheral, I think it would make sense to consolidate these in > sc7280.dtsi Ack Thanks, Prasad > > Konrad
diff --git a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts index 7a155ef6492e..884abbda74fd 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts @@ -18,6 +18,7 @@ #include "pm7325.dtsi" #include "pm8350c.dtsi" #include "pmk8350.dtsi" +#include "qcs6490-audioreach.dtsi" /delete-node/ &ipa_fw_mem; /delete-node/ &rmtfs_mem; @@ -169,6 +170,30 @@ vph_pwr: vph-pwr-regulator { regulator-min-microvolt = <3700000>; regulator-max-microvolt = <3700000>; }; + + wcd9370: audio-codec-0 { + compatible = "qcom,wcd9370-codec"; + + pinctrl-0 = <&wcd_default>; + pinctrl-names = "default"; + + reset-gpios = <&tlmm 83 GPIO_ACTIVE_HIGH>; + + vdd-buck-supply = <&vreg_l17b_1p7>; + vdd-rxtx-supply = <&vreg_l18b_1p8>; + vdd-px-supply = <&vreg_l18b_1p8>; + vdd-mic-bias-supply = <&vreg_bob_3p296>; + + qcom,micbias1-microvolt = <1800000>; + qcom,micbias2-microvolt = <1800000>; + qcom,micbias3-microvolt = <1800000>; + qcom,micbias4-microvolt = <1800000>; + + qcom,rx-device = <&wcd937x_rx>; + qcom,tx-device = <&wcd937x_tx>; + + #sound-dai-cells = <1>; + }; }; &apps_rsc { @@ -536,6 +561,22 @@ &gpu_zap_shader { firmware-name = "qcom/qcm6490/a660_zap.mbn"; }; +&lpass_rx_macro { + status = "okay"; +}; + +&lpass_tx_macro { + status = "okay"; +}; + +&lpass_va_macro { + status = "okay"; +}; + +&lpass_wsa_macro { + status = "okay"; +}; + &mdss { status = "okay"; }; @@ -716,6 +757,54 @@ &sdhc_2 { cd-gpios = <&tlmm 91 GPIO_ACTIVE_LOW>; }; +&swr0 { + status = "okay"; + + wcd937x_rx: codec@0,4 { + compatible = "sdw20217010a00"; + reg = <0 4>; + qcom,rx-port-mapping = <1 2 3 4 5>; + qcom,rx-channel-mapping = /bits/ 8 <1 2 1 1 2 1 1 2>; + }; +}; + +&swr1 { + status = "okay"; + + wcd937x_tx: codec@0,3 { + compatible = "sdw20217010a00"; + reg = <0 3>; + qcom,tx-port-mapping = <1 1 2 3>; + qcom,tx-channel-mapping = /bits/ 8 <1 2 1 1 2 3 3 4 1 2 3 4>; + }; +}; + +&swr2 { + status = "okay"; + + left_spkr: speaker@0,1 { + compatible = "sdw10217020200"; + reg = <0 1>; + powerdown-gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + #sound-dai-cells = <0>; + sound-name-prefix = "SpkrLeft"; + #thermal-sensor-cells = <0>; + vdd-supply = <&vreg_l18b_1p8>; + qcom,port-mapping = <1 2 3 7>; + }; + + right_spkr: speaker@0,2 { + compatible = "sdw10217020200"; + reg = <0 2>; + powerdown-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>; + #sound-dai-cells = <0>; + sound-name-prefix = "SpkrRight"; + #thermal-sensor-cells = <0>; + vdd-supply = <&vreg_l18b_1p8>; + qcom,port-mapping = <4 5 6 8>; + }; +}; + &tlmm { gpio-reserved-ranges = <32 2>, /* ADSP */ <48 4>; /* NFC */ @@ -725,6 +814,13 @@ sd_cd: sd-cd-state { function = "gpio"; bias-pull-up; }; + + wcd_default: wcd-reset-n-active-state { + pins = "gpio83"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + }; }; &uart5 { diff --git a/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi b/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi index 542a39ca72bb..2e75e7706fb4 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs6490-audioreach.dtsi @@ -29,6 +29,30 @@ &lpass_dmic23_data { bias-pull-down; }; +&lpass_rx_swr_clk { + drive-strength = <2>; + slew-rate = <1>; + bias-disable; +}; + +&lpass_rx_swr_data { + drive-strength = <2>; + slew-rate = <1>; + bias-bus-hold; +}; + +&lpass_tx_swr_clk { + drive-strength = <2>; + slew-rate = <1>; + bias-disable; +}; + +&lpass_tx_swr_data { + drive-strength = <2>; + slew-rate = <1>; + bias-bus-hold; +}; + &lpass_rx_macro { /delete-property/ power-domains; /delete-property/ power-domain-names;