Skip to contentSkip to conversation

Qualcomm's lpass device tree changes for I2s dai

PATCH Superseded Srinivasa Rao Mandadapu 2 participants 7 messages Mar 12, 2021 – Mar 13, 2021

Subsystems (4)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover Qualcomm's lpass device tree changes for I2s dai

These patches are device tree changes to support audio over I2S.

Changes Since v4:
-- Removed duplication of dai-link in sound node.
-- Replaced reg values with common dt-bindings macros in coachz dtsi -- Included sc7180-lpass.h instead of qcom,lpass.h
-- Sound node placement change in coachz dtsi.
Changes Since v3:
-- Compatible name changed as per trogdor
Changes Since v2:
-- sound node variable is added in sc7180-trogdor-coachz.dtsi. -- Audio-jack property is removed, as it may create conflicts with the boards
having different codecs.
-- Replaced reg values with common dt-bindings macros
Changes Since v1:
-- Ajith's Certification is added.
-- Alias name added for sound dai link node

Ajit Pandey (1):
arm64: dts: qcom: sc7180-trogdor: Add lpass dai link for I2S driver

Srinivasa Rao Mandadapu (1):
arm64: dts: qcom: Add sound node for sc7180-trogdor-coachz

 .../boot/dts/qcom/sc7180-trogdor-coachz.dtsi  | 10 ++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi  | 58 +++++++++++++++++++
 2 files changed, 68 insertions(+)
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#1 lore raw

PATCH v5 1/2 arm64: dts: qcom: sc7180-trogdor: Add lpass dai link for I2S driver

From: Ajit Pandey <[email protected]>

Add dai link for supporting lpass I2S driver, which is used for audio capture and playback.
Add lpass-cpu node with pin controls and i2s primary and secondary dai-links

---
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 58 ++++++++++++++++++++
 1 file changed, 58 insertions(+)
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +58 -0
index 436582279dad..397b564964d5 100644
@@ -9,6 +9,7 @@
 #include <dt-bindings/input/gpio-keys.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/sc7180-lpass.h>
 
 /* PMICs depend on spmi_bus label and so must come after SoC */
 #include "pm6150.dtsi"
@@ -283,6 +284,42 @@ keyboard_backlight: keyboard-backlight {
 			max-brightness = <1023>;
 		};
 	};
+
+	sound: sound {
+		compatible = "google,sc7180-trogdor";
+		model = "sc7180-rt5682-max98357a-1mic";
+
+		audio-routing =
+			"Headphone Jack", "HPOL",
+			"Headphone Jack", "HPOR";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		dai-link@0 {
+			link-name = "MultiMedia0";
+			reg = <MI2S_PRIMARY>;
+			cpu {
+				sound-dai = <&lpass_cpu MI2S_PRIMARY>;
+			};
+
+			multimedia0_codec: codec {
+				sound-dai = <&alc5682 MI2S_PRIMARY>;
+			};
+		};
+
+		dai-link@1 {
+			link-name = "MultiMedia1";
+			reg = <MI2S_SECONDARY>;
+			cpu {
+				sound-dai = <&lpass_cpu MI2S_SECONDARY>;
+			};
+
+			multimedia1_codec: codec {
+				sound-dai = <&max98357a>;
+			};
+		};
+	};
 };
 
 &qfprom {
@@ -720,6 +757,27 @@ &ipa {
 	modem-init;
 };
 
+&lpass_cpu {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&sec_mi2s_active &pri_mi2s_active &pri_mi2s_mclk_active>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	mi2s-primary@0 {
+		reg = <MI2S_PRIMARY>;
+		qcom,playback-sd-lines = <1>;
+		qcom,capture-sd-lines = <0>;
+	};
+
+	mi2s-secondary@1 {
+		reg = <MI2S_SECONDARY>;
+		qcom,playback-sd-lines = <0>;
+	};
+};
+
 &mdp {
 	status = "okay";
 };
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#2 lore raw

Re: [PATCH v5 1/2] arm64: dts: qcom: sc7180-trogdor: Add lpass dai link for I2S driver

Hi,

arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi keyboard_backlight: keyboard-backlight { · line 307

Quoted 10 lines · Srinivasa Rao Mandadapu
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +9 -0
+               dai-link@0 {
+                       link-name = "MultiMedia0";
+                       reg = <MI2S_PRIMARY>;
+                       cpu {
+                               sound-dai = <&lpass_cpu MI2S_PRIMARY>;
+                       };
+
+                       multimedia0_codec: codec {
+                               sound-dai = <&alc5682 MI2S_PRIMARY>;

Please change "MI2S_PRIMARY" to "0". "MI2S_PRIMARY" is a numbering system for "lpass_cpu" not for "alc5682". I'm not aware of symbolic names for the alc5682's DAIs.

From digging through the code and testing, it appears that for alc5682:
0 - aif1
1 - aif2

Thus you could be a little more documenting by doing:

sound-dai = <&alc5682 0 /*aif1*/>;

-Doug

#3 lore raw

Re: [PATCH v5 1/2] arm64: dts: qcom: sc7180-trogdor: Add lpass dai link for I2S driver

Hi Doug,

Thanks for your time and inputs!!!

Quoted 21 lines · Doug Anderson

Hi,

arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi keyboard_backlight: keyboard-backlight { · line 307

Quoted 9 lines · Srinivasa Rao Mandadapu
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +9 -0
+               dai-link@0 {
+                       link-name = "MultiMedia0";
+                       reg = <MI2S_PRIMARY>;
+                       cpu {
+                               sound-dai = <&lpass_cpu MI2S_PRIMARY>;
+                       };
+
+                       multimedia0_codec: codec {
+                               sound-dai = <&alc5682 MI2S_PRIMARY>;

Please change "MI2S_PRIMARY" to "0". "MI2S_PRIMARY" is a numbering system for "lpass_cpu" not for "alc5682". I'm not aware of symbolic names for the alc5682's DAIs.

From digging through the code and testing, it appears that for alc5682:
0 - aif1
1 - aif2

Quoted 5 lines

Thus you could be a little more documenting by doing:

sound-dai = <&alc5682 0 /*aif1*/>;

-Doug

Okay, I will change accordingly.

Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#4 lore raw

PATCH v5 2/2 arm64: dts: qcom: Add sound node for sc7180-trogdor-coachz

In reply to Srinivasa Rao Mandadapu

This is a trgodor variant, required to have sound node variable for coachz specific platform.

---
 arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +10 -0
index 4ad520f00485..7eaad739b6f9 100644
@@ -89,6 +89,16 @@ &sn65dsi86_out {
 	data-lanes = <0 1 2 3>;
 };
 
+&sound {
+	compatible = "google,sc7180-coachz";
+	model = "sc7180-adau7002-max98357a";
+	audio-routing = "PDM_DAT", "DMIC";
+};
+
+&multimedia0_codec {
+	sound-dai = <&adau7002>;
+};
+
 /* PINCTRL - modifications to sc7180-trogdor.dtsi */
 
 &en_pp3300_dx_edp {
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#5 lore raw

Re: [PATCH v5 2/2] arm64: dts: qcom: Add sound node for sc7180-trogdor-coachz

Hi,

Quoted 17 lines · Srinivasa Rao Mandadapu

This is a trgodor variant, required to have sound node variable for coachz specific platform.

---
 arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +0 -0
index 4ad520f00485..7eaad739b6f9 100644
@@ -89,6 +89,16 @@ &sn65dsi86_out {
        data-lanes = <0 1 2 3>;
 };
 

arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi &sn65dsi86_out { · line 101

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +10 -0
+&sound {
+       compatible = "google,sc7180-coachz";
+       model = "sc7180-adau7002-max98357a";
+       audio-routing = "PDM_DAT", "DMIC";
+};
+
+&multimedia0_codec {
+       sound-dai = <&adau7002>;
+};
+

Much nicer! The last nit is that "multimedia0_codec" is now sorted incorrectly. It starts with "m" so it shouldn't come after "s". Yes, I know that this rule means that these two things are no longer next to each other, but that's the rule we have right now.

If it's important for you for them to sort together, I suppose you could change the label to "sound_multimedia0_codec" though that's a bit of a mouthful. I'll leave it up to you whether to rename (and keep the current ordering) or keep the name (and move the node).

-Doug

#6 lore raw

Re: [PATCH v5 2/2] arm64: dts: qcom: Add sound node for sc7180-trogdor-coachz

Hi Doug,

Thanks for your time and inputs!!!

Quoted 35 lines · Doug Anderson

Hi,

Quoted 16 lines · Srinivasa Rao Mandadapu

This is a trgodor variant, required to have sound node variable for coachz specific platform.

---
  arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 10 ++++++++++
  1 file changed, 10 insertions(+)
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +0 -0
index 4ad520f00485..7eaad739b6f9 100644
@@ -89,6 +89,16 @@ &sn65dsi86_out {
         data-lanes = <0 1 2 3>;
  };
 

arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi &sn65dsi86_out { · line 101

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +10 -0
+&sound {
+       compatible = "google,sc7180-coachz";
+       model = "sc7180-adau7002-max98357a";
+       audio-routing = "PDM_DAT", "DMIC";
+};
+
+&multimedia0_codec {
+       sound-dai = <&adau7002>;
+};
+

Much nicer! The last nit is that "multimedia0_codec" is now sorted incorrectly. It starts with "m" so it shouldn't come after "s". Yes, I know that this rule means that these two things are no longer next to each other, but that's the rule we have right now.

Quoted 8 lines

If it's important for you for them to sort together, I suppose you could change the label to "sound_multimedia0_codec" though that's a bit of a mouthful. I'll leave it up to you whether to rename (and keep the current ordering) or keep the name (and move the node).

-Doug

I feel it's good to keep them together by changing name as you suggested.

I will change accordingly and re post it.

Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.