Skip to content

Commit

Permalink
arm64: dts: qcom: xiaomi-davinci: Add amplifier node
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Reidel <[email protected]>
  • Loading branch information
Gelbpunkt committed Feb 12, 2024
1 parent 9a579c5 commit 38d3471
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 1 deletion.
34 changes: 34 additions & 0 deletions arch/arm64/boot/dts/qcom/sm7150-xiaomi-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
73 changes: 72 additions & 1 deletion arch/arm64/boot/dts/qcom/sm7150-xiaomi-davinci.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/dts-v1/;

#include <dt-bindings/sound/qcom,q6asm.h>

#include "sm7150-xiaomi-common.dtsi"

/delete-node/ &wlan_msa_mem;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -210,6 +226,32 @@
};
};

&q6afedai {
qi2s@16 {
reg = <PRIMARY_MI2S_RX>;
qcom,sd-lines = <0>;
};

/*
qi2s@17 {
reg = <PRIMARY_MI2S_TX>;
qcom,sd-lines = <1>;
};
*/
};

&q6asmdai {
dai@0 {
reg = <0>;
};

/*
dai@1 {
reg = <1>;
};
*/
};

&remoteproc_adsp {
firmware-name = "qcom/sm7150/davinci/adsp.mbn";
status = "okay";
Expand All @@ -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";
Expand Down

0 comments on commit 38d3471

Please sign in to comment.