From 38d3471c450e4e7bb7e40bf98c21e260284662bd Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Tue, 26 Sep 2023 09:58:57 +0200 Subject: [PATCH] arm64: dts: qcom: xiaomi-davinci: Add amplifier node Signed-off-by: Jens Reidel --- .../boot/dts/qcom/sm7150-xiaomi-common.dtsi | 34 +++++++++ .../boot/dts/qcom/sm7150-xiaomi-davinci.dts | 73 ++++++++++++++++++- 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sm7150-xiaomi-common.dtsi b/arch/arm64/boot/dts/qcom/sm7150-xiaomi-common.dtsi index ddd868b3def0aa..7309de9f581020 100644 --- a/arch/arm64/boot/dts/qcom/sm7150-xiaomi-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sm7150-xiaomi-common.dtsi @@ -686,6 +686,40 @@ drive-strength = <2>; }; }; + + smartpa_int_active: smartpa_int_active { + pins = "gpio56"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + input-enable; + }; + + smartpa_int_suspend: smartpa_int_suspend { + pins = "gpio56"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + input-enable; + }; + + smartpa_enable_active: smartpa_enable_active { + pins = "gpio12"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + bias-pull-down; + output-low; + }; + + smartpa_enable_suspend: smartpa_enable_suspend { + pins = "gpio12"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + bias-pull-down; + output-low; + }; }; &uart3 { diff --git a/arch/arm64/boot/dts/qcom/sm7150-xiaomi-davinci.dts b/arch/arm64/boot/dts/qcom/sm7150-xiaomi-davinci.dts index 1d73c716a42fdc..72ed84c16440a8 100644 --- a/arch/arm64/boot/dts/qcom/sm7150-xiaomi-davinci.dts +++ b/arch/arm64/boot/dts/qcom/sm7150-xiaomi-davinci.dts @@ -8,6 +8,8 @@ /dts-v1/; +#include + #include "sm7150-xiaomi-common.dtsi" /delete-node/ &wlan_msa_mem; @@ -113,7 +115,21 @@ clock-frequency = <100000>; status = "okay"; - /* nxp,tfa9874 (speaker amplifier) @ 34 */ + tfa9874: tfa9874@34 { + compatible = "nxp,tfa9874"; + reg = <0x34>; + status = "okay"; + reset-gpio = <&tlmm 12 GPIO_ACTIVE_HIGH>; + irq-gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&tlmm>; + interrupts = <56 0>; + interrupt-names = "smartpa_irq"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&smartpa_int_active &smartpa_enable_active>; + pinctrl-1 = <&smartpa_int_suspend &smartpa_enable_suspend>; + sound-name-prefix = "Speaker"; + #sound-dai-cells = <0>; + }; }; &i2c7 { @@ -210,6 +226,32 @@ }; }; +&q6afedai { + qi2s@16 { + reg = ; + qcom,sd-lines = <0>; + }; + + /* + qi2s@17 { + reg = ; + qcom,sd-lines = <1>; + }; + */ +}; + +&q6asmdai { + dai@0 { + reg = <0>; + }; + + /* + dai@1 { + reg = <1>; + }; + */ +}; + &remoteproc_adsp { firmware-name = "qcom/sm7150/davinci/adsp.mbn"; status = "okay"; @@ -225,6 +267,35 @@ status = "okay"; }; +&sound { + compatible = "qcom,sm8250-sndcard"; + pinctrl-0 = <&pri_mi2s_active &pri_mi2s_ws_active>; + pinctrl-names = "default"; + model = "Xiaomi Mi 9T / Redmi K20"; + + mm1-dai-link { + link-name = "MultiMedia1"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; + }; + }; + + speaker_playback_dai { + link-name = "Primary Spkr Playback"; + cpu { + sound-dai = <&q6afedai PRIMARY_MI2S_RX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + + codec { + sound-dai = <&tfa9874>; + }; + }; +}; + &venus { firmware-name = "qcom/sm7150/davinci/venus.mbn"; status = "okay";