All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFT PATCH v2 1/6] arm64: dts: qcom: sdm845-db845c: add generic sound compatible
@ 2023-01-18 10:34 Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 2/6] arm64: dts: qcom: sdm845-xiaomi-beryllium: " Krzysztof Kozlowski
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 10:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Use generic sound card fallback compatible, because the device is
actually fully compatible with the generic one.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. New patch

Bindings: https://lore.kernel.org/alsa-devel/20230118101542.96705-1-krzysztof.kozlowski@linaro.org/T/#t
---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index 0d935c928148..4833e89affc2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -704,7 +704,7 @@ &sdhc_2 {
 };
 
 &sound {
-	compatible = "qcom,db845c-sndcard";
+	compatible = "qcom,db845c-sndcard", "qcom,sdm845-sndcard";
 	pinctrl-0 = <&quat_mi2s_active
 			 &quat_mi2s_sd0_active
 			 &quat_mi2s_sd1_active
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [RFT PATCH v2 2/6] arm64: dts: qcom: sdm845-xiaomi-beryllium: add generic sound compatible
  2023-01-18 10:34 [RFT PATCH v2 1/6] arm64: dts: qcom: sdm845-db845c: add generic sound compatible Krzysztof Kozlowski
@ 2023-01-18 10:34 ` Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 3/6] arm64: dts: qcom: sdm850-lenovo-yoga: correct " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 10:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Use generic sound card fallback compatible, because the device is
actually fully compatible with the generic one.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. New patch

Bindings: https://lore.kernel.org/alsa-devel/20230118101542.96705-1-krzysztof.kozlowski@linaro.org/T/#t
---
 arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
index 64de4ed9b0c8..5de8b4c372fc 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
@@ -374,7 +374,7 @@ &sdhc_2 {
 };
 
 &sound {
-	compatible = "qcom,db845c-sndcard";
+	compatible = "qcom,db845c-sndcard", "qcom,sdm845-sndcard";
 	pinctrl-0 = <&quat_mi2s_active
 			&quat_mi2s_sd0_active>;
 	pinctrl-names = "default";
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [RFT PATCH v2 3/6] arm64: dts: qcom: sdm850-lenovo-yoga: correct sound compatible
  2023-01-18 10:34 [RFT PATCH v2 1/6] arm64: dts: qcom: sdm845-db845c: add generic sound compatible Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 2/6] arm64: dts: qcom: sdm845-xiaomi-beryllium: " Krzysztof Kozlowski
@ 2023-01-18 10:34 ` Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 10:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

There is dedicated compatible for Lenovo Yoga C630 sound card
(documented in bindings and used by Linux driver), so use it along with
a generic sound card fallback. The device is actually fully compatible
with the generic one.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. New patch

Bindings: https://lore.kernel.org/alsa-devel/20230118101542.96705-1-krzysztof.kozlowski@linaro.org/T/#t
---
 arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index d9581f4440b3..d55ffd69155e 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -511,7 +511,7 @@ dai@2 {
 };
 
 &sound {
-	compatible = "qcom,db845c-sndcard";
+	compatible = "lenovo,yoga-c630-sndcard", "qcom,sdm845-sndcard";
 	model = "Lenovo-YOGA-C630-13Q50";
 
 	audio-routing =
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file
  2023-01-18 10:34 [RFT PATCH v2 1/6] arm64: dts: qcom: sdm845-db845c: add generic sound compatible Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 2/6] arm64: dts: qcom: sdm845-xiaomi-beryllium: " Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 3/6] arm64: dts: qcom: sdm850-lenovo-yoga: correct " Krzysztof Kozlowski
@ 2023-01-18 10:34 ` Krzysztof Kozlowski
  2023-01-19 23:24   ` Caleb Connolly
  2023-01-18 10:34 ` [RFT PATCH v2 5/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize pinctrl Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 6/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize clocks Krzysztof Kozlowski
  4 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 10:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Re-organize SDM845 sound components into separate, audio DTSI which
should be included and customized by the SDM845 boards wanting audio.
The DTSI includes:
1. WCD9340 codec node because it is not a property of the SoC, but board.
2. Common sound DAI links, shared with all sound cards.

The Xiaomi Polaris, although includes WCD9340 codec, it lacks sound
node, so it stays disabled.

On all others boards not using audio, keep the Slimbus node disabled as
it is empty.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes since v1:
1. Move also sound node.
2. Rewrite commit msg.

RFC - please kindly test the boards.
---
 .../boot/dts/qcom/sdm845-audio-wcd9340.dtsi   | 125 ++++++++++++++++++
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts    |  55 +-------
 .../qcom/sdm845-xiaomi-beryllium-common.dtsi  |  53 +-------
 .../boot/dts/qcom/sdm845-xiaomi-polaris.dts   |   1 +
 arch/arm64/boot/dts/qcom/sdm845.dtsi          |  60 +--------
 .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts |  59 ++-------
 .../boot/dts/qcom/sdm850-samsung-w737.dts     |  60 ++-------
 7 files changed, 151 insertions(+), 262 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi

diff --git a/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
new file mode 100644
index 000000000000..0a94fde6741d
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
@@ -0,0 +1,125 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SDM845 SoC device tree source
+ *
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ */
+
+&slim {
+	status = "okay";
+
+	slim@1 {
+		reg = <1>;
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		wcd9340_ifd: ifd@0,0 {
+			compatible = "slim217,250";
+			reg = <0 0>;
+		};
+
+		wcd9340: codec@1,0 {
+			compatible = "slim217,250";
+			reg = <1 0>;
+			slim-ifc-dev = <&wcd9340_ifd>;
+
+			#sound-dai-cells = <1>;
+
+			interrupts-extended = <&tlmm 54 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			#clock-cells = <0>;
+			clock-frequency = <9600000>;
+			clock-output-names = "mclk";
+			qcom,micbias1-microvolt = <1800000>;
+			qcom,micbias2-microvolt = <1800000>;
+			qcom,micbias3-microvolt = <1800000>;
+			qcom,micbias4-microvolt = <1800000>;
+
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			wcdgpio: gpio-controller@42 {
+				compatible = "qcom,wcd9340-gpio";
+				gpio-controller;
+				#gpio-cells = <2>;
+				reg = <0x42 0x2>;
+			};
+
+			swm: swm@c85 {
+				compatible = "qcom,soundwire-v1.3.0";
+				reg = <0xc85 0x40>;
+				interrupts-extended = <&wcd9340 20>;
+
+				qcom,dout-ports = <6>;
+				qcom,din-ports = <2>;
+				qcom,ports-sinterval-low = /bits/ 8  <0x07 0x1f 0x3f 0x7 0x1f 0x3f 0x0f 0x0f>;
+				qcom,ports-offset1 = /bits/ 8 <0x01 0x02 0x0c 0x6 0x12 0x0d 0x07 0x0a>;
+				qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x1f 0x00 0x00 0x1f 0x00 0x00>;
+
+				#sound-dai-cells = <1>;
+				clocks = <&wcd9340>;
+				clock-names = "iface";
+				#address-cells = <2>;
+				#size-cells = <0>;
+			};
+		};
+	};
+};
+
+&sound {
+	compatible = "qcom,sdm845-sndcard";
+	status = "disabled";
+
+	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>;
+		};
+	};
+
+	mm3-dai-link {
+		link-name = "MultiMedia3";
+		cpu {
+			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
+		};
+	};
+
+	sound_slim_dai_link: slim-dai-link {
+		link-name = "SLIM Playback";
+		cpu {
+			sound-dai = <&q6afedai SLIMBUS_0_RX>;
+		};
+
+		platform {
+			sound-dai = <&q6routing>;
+		};
+
+		codec {
+			sound-dai = <&wcd9340 0>;
+		};
+	};
+
+	slimcap-dai-link {
+		link-name = "SLIM Capture";
+		cpu {
+			sound-dai = <&q6afedai SLIMBUS_0_TX>;
+		};
+
+		platform {
+			sound-dai = <&q6routing>;
+		};
+
+		codec {
+			sound-dai = <&wcd9340 1>;
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index 4833e89affc2..11b0554a6aea 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -11,6 +11,7 @@
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm845.dtsi"
+#include "sdm845-audio-wcd9340.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
 
@@ -726,27 +727,7 @@ &quat_mi2s_sd2_active
 		"MM_DL2",  "MultiMedia2 Playback",
 		"MM_DL4",  "MultiMedia4 Playback",
 		"MultiMedia3 Capture", "MM_UL3";
-
-	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>;
-		};
-	};
-
-	mm3-dai-link {
-		link-name = "MultiMedia3";
-		cpu {
-			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
-		};
-	};
+	status = "okay";
 
 	mm4-dai-link {
 		link-name = "MultiMedia4";
@@ -769,35 +750,11 @@ codec {
 			sound-dai = <&lt9611_codec 0>;
 		};
 	};
+};
 
-	slim-dai-link {
-		link-name = "SLIM Playback";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_RX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
-		};
-	};
-
-	slimcap-dai-link {
-		link-name = "SLIM Capture";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_TX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&wcd9340 1>;
-		};
+&sound_slim_dai_link {
+	codec {
+		sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
index 5de8b4c372fc..54eabacdc031 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
@@ -7,6 +7,7 @@
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm845.dtsi"
+#include "sdm845-audio-wcd9340.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
 
@@ -384,57 +385,7 @@ &sound {
 		"AMIC1", "MIC BIAS1",
 		"AMIC2", "MIC BIAS2",
 		"AMIC3", "MIC BIAS3";
-
-	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>;
-		};
-	};
-
-	mm3-dai-link {
-		link-name = "MultiMedia3";
-		cpu {
-			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
-		};
-	};
-
-	slim-dai-link {
-		link-name = "SLIM Playback";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_RX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&wcd9340 0>;
-		};
-	};
-
-	slimcap-dai-link {
-		link-name = "SLIM Capture";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_TX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&wcd9340 1>;
-		};
-	};
+	status = "okay";
 };
 
 &tlmm {
diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
index a80c3dd9a2da..f81619c8a3ba 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
@@ -13,6 +13,7 @@
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm845.dtsi"
+#include "sdm845-audio-wcd9340.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
 #include "pm8005.dtsi"
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 0f1cb2c8addd..27d1917f5358 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -3831,65 +3831,7 @@ slim: slim-ngd@171c0000 {
 			iommus = <&apps_smmu 0x1806 0x0>;
 			#address-cells = <1>;
 			#size-cells = <0>;
-
-			slim@1 {
-				reg = <1>;
-				#address-cells = <2>;
-				#size-cells = <0>;
-
-				wcd9340_ifd: ifd@0,0 {
-					compatible = "slim217,250";
-					reg = <0 0>;
-				};
-
-				wcd9340: codec@1,0 {
-					compatible = "slim217,250";
-					reg = <1 0>;
-					slim-ifc-dev = <&wcd9340_ifd>;
-
-					#sound-dai-cells = <1>;
-
-					interrupts-extended = <&tlmm 54 IRQ_TYPE_LEVEL_HIGH>;
-					interrupt-controller;
-					#interrupt-cells = <1>;
-
-					#clock-cells = <0>;
-					clock-frequency = <9600000>;
-					clock-output-names = "mclk";
-					qcom,micbias1-microvolt = <1800000>;
-					qcom,micbias2-microvolt = <1800000>;
-					qcom,micbias3-microvolt = <1800000>;
-					qcom,micbias4-microvolt = <1800000>;
-
-					#address-cells = <1>;
-					#size-cells = <1>;
-
-					wcdgpio: gpio-controller@42 {
-						compatible = "qcom,wcd9340-gpio";
-						gpio-controller;
-						#gpio-cells = <2>;
-						reg = <0x42 0x2>;
-					};
-
-					swm: swm@c85 {
-						compatible = "qcom,soundwire-v1.3.0";
-						reg = <0xc85 0x40>;
-						interrupts-extended = <&wcd9340 20>;
-
-						qcom,dout-ports = <6>;
-						qcom,din-ports = <2>;
-						qcom,ports-sinterval-low = /bits/ 8  <0x07 0x1f 0x3f 0x7 0x1f 0x3f 0x0f 0x0f>;
-						qcom,ports-offset1 = /bits/ 8 <0x01 0x02 0x0c 0x6 0x12 0x0d 0x07 0x0a>;
-						qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x1f 0x00 0x00 0x1f 0x00 0x00>;
-
-						#sound-dai-cells = <1>;
-						clocks = <&wcd9340>;
-						clock-names = "iface";
-						#address-cells = <2>;
-						#size-cells = <0>;
-					};
-				};
-			};
+			status = "disabled";
 		};
 
 		lmh_cluster1: lmh@17d70800 {
diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index d55ffd69155e..b979d8ae8698 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -13,6 +13,7 @@
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm850.dtsi"
+#include "sdm845-audio-wcd9340.dtsi"
 #include "pm8998.dtsi"
 
 /*
@@ -522,57 +523,7 @@ &sound {
 		"MM_DL1",  "MultiMedia1 Playback",
 		"MM_DL3",  "MultiMedia3 Playback",
 		"MultiMedia2 Capture", "MM_UL2";
-
-	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>;
-		};
-	};
-
-	mm3-dai-link {
-		link-name = "MultiMedia3";
-		cpu {
-			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
-		};
-	};
-
-	slim-dai-link {
-		link-name = "SLIM Playback";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_RX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
-		};
-	};
-
-	slimcap-dai-link {
-		link-name = "SLIM Capture";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_TX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&wcd9340 1>;
-		};
-	};
+	status = "okay";
 
 	slim-wcd-dai-link {
 		link-name = "SLIM WCD Playback";
@@ -590,6 +541,12 @@ codec {
 	};
 };
 
+&sound_slim_dai_link {
+	codec {
+		sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <0 4>, <81 4>;
 
diff --git a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
index 6730804f4e3e..75773b06701b 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
@@ -14,6 +14,7 @@
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm850.dtsi"
+#include "sdm845-audio-wcd9340.dtsi"
 #include "pm8998.dtsi"
 
 /*
@@ -436,7 +437,6 @@ dai@2 {
 };
 
 &sound {
-	compatible = "qcom,sdm845-sndcard";
 	model = "Samsung-W737";
 
 	audio-routing =
@@ -447,57 +447,7 @@ &sound {
 		"MM_DL1",  "MultiMedia1 Playback",
 		"MM_DL3",  "MultiMedia3 Playback",
 		"MultiMedia2 Capture", "MM_UL2";
-
-	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>;
-		};
-	};
-
-	mm3-dai-link {
-		link-name = "MultiMedia3";
-		cpu {
-			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
-		};
-	};
-
-	slim-dai-link {
-		link-name = "SLIM Playback";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_RX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
-		};
-	};
-
-	slimcap-dai-link {
-		link-name = "SLIM Capture";
-		cpu {
-			sound-dai = <&q6afedai SLIMBUS_0_TX>;
-		};
-
-		platform {
-			sound-dai = <&q6routing>;
-		};
-
-		codec {
-			sound-dai = <&wcd9340 1>;
-		};
-	};
+	status = "okay";
 
 	slim-wcd-dai-link {
 		link-name = "SLIM WCD Playback";
@@ -515,6 +465,12 @@ codec {
 	};
 };
 
+&sound_slim_dai_link {
+	codec {
+		sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <0 6>, <85 4>;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [RFT PATCH v2 5/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize pinctrl
  2023-01-18 10:34 [RFT PATCH v2 1/6] arm64: dts: qcom: sdm845-db845c: add generic sound compatible Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2023-01-18 10:34 ` [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file Krzysztof Kozlowski
@ 2023-01-18 10:34 ` Krzysztof Kozlowski
  2023-01-18 10:34 ` [RFT PATCH v2 6/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize clocks Krzysztof Kozlowski
  4 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 10:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Pin configuration fow WCD9340 is the same in all users, so move it to
common file to reduce the code duplication (which still allows further
customizations per board).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

---

Changes since v1:
1. Add Rb tag.
2. Split from previous patchset.
---
 .../arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi | 15 +++++++++++++++
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts        | 11 -----------
 .../dts/qcom/sdm845-xiaomi-beryllium-common.dtsi  | 11 -----------
 .../arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 10 ----------
 .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts     | 11 -----------
 arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts  | 11 -----------
 6 files changed, 15 insertions(+), 54 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
index 0a94fde6741d..d0c77a8c1985 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
@@ -32,6 +32,10 @@ wcd9340: codec@1,0 {
 			#clock-cells = <0>;
 			clock-frequency = <9600000>;
 			clock-output-names = "mclk";
+
+			pinctrl-0 = <&wcd_intr_default>;
+			pinctrl-names = "default";
+
 			qcom,micbias1-microvolt = <1800000>;
 			qcom,micbias2-microvolt = <1800000>;
 			qcom,micbias3-microvolt = <1800000>;
@@ -123,3 +127,14 @@ codec {
 		};
 	};
 };
+
+&tlmm {
+	wcd_intr_default: wcd-intr-default-state {
+		pins = "gpio54";
+		function = "gpio";
+
+		input-enable;
+		bias-pull-down;
+		drive-strength = <2>;
+	};
+};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index 11b0554a6aea..e0289973d3e4 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -929,15 +929,6 @@ sdc2_card_det_n: sd-card-det-n-state {
 		function = "gpio";
 		bias-pull-up;
 	};
-
-	wcd_intr_default: wcd-intr-default-state {
-		pins = "gpio54";
-		function = "gpio";
-
-		input-enable;
-		bias-pull-down;
-		drive-strength = <2>;
-	};
 };
 
 &uart3 {
@@ -1043,8 +1034,6 @@ &venus {
 };
 
 &wcd9340 {
-	pinctrl-0 = <&wcd_intr_default>;
-	pinctrl-names = "default";
 	clock-names = "extclk";
 	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
index 54eabacdc031..5aca280b3994 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
@@ -416,15 +416,6 @@ sdc2_card_det_n: sd-card-det-n-state {
 		function = "gpio";
 		bias-pull-up;
 	};
-
-	wcd_intr_default: wcd-intr-default-state {
-		pins = "gpio54";
-		function = "gpio";
-
-		input-enable;
-		bias-pull-down;
-		drive-strength = <2>;
-	};
 };
 
 &uart6 {
@@ -493,8 +484,6 @@ &venus {
 };
 
 &wcd9340 {
-	pinctrl-0 = <&wcd_intr_default>;
-	pinctrl-names = "default";
 	clock-names = "extclk";
 	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
index f81619c8a3ba..1ceeea0885b9 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
@@ -616,14 +616,6 @@ sde_dsi_suspend: sde-dsi-suspend-state {
 		drive-strength = <2>;
 		bias-pull-down;
 	};
-
-	wcd_intr_default: wcd-intr-default-state {
-		pins = "gpio54";
-		function = "gpio";
-		input-enable;
-		bias-pull-down;
-		drive-strength = <2>;
-	};
 };
 
 &uart6 {
@@ -700,8 +692,6 @@ &venus {
 };
 
 &wcd9340 {
-	pinctrl-0 = <&wcd_intr_default>;
-	pinctrl-names = "default";
 	clock-names = "extclk";
 	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index b979d8ae8698..db868af1f399 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -584,15 +584,6 @@ i2c11_hid_active: i2c11-hid-active-state {
 		drive-strength = <2>;
 	};
 
-	wcd_intr_default: wcd-intr-default-state {
-		pins = "gpio54";
-		function = "gpio";
-
-		input-enable;
-		bias-pull-down;
-		drive-strength = <2>;
-	};
-
 	lid_pin_active: lid-pin-state {
 		pins = "gpio124";
 		function = "gpio";
@@ -703,8 +694,6 @@ &venus {
 };
 
 &wcd9340 {
-	pinctrl-0 = <&wcd_intr_default>;
-	pinctrl-names = "default";
 	clock-names = "extclk";
 	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
index 75773b06701b..6a9ced334f19 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
@@ -507,15 +507,6 @@ pen_rst_l: pen-rst-l-state {
 		 */
 		output-high;
 	};
-
-	wcd_intr_default: wcd-intr-default-state {
-		pins = "gpio54";
-		function = "gpio";
-
-		input-enable;
-		bias-pull-down;
-		drive-strength = <2>;
-	};
 };
 
 &uart6 {
@@ -611,8 +602,6 @@ &venus {
 };
 
 &wcd9340 {
-	pinctrl-0 = <&wcd_intr_default>;
-	pinctrl-names = "default";
 	clock-names = "extclk";
 	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [RFT PATCH v2 6/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize clocks
  2023-01-18 10:34 [RFT PATCH v2 1/6] arm64: dts: qcom: sdm845-db845c: add generic sound compatible Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2023-01-18 10:34 ` [RFT PATCH v2 5/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize pinctrl Krzysztof Kozlowski
@ 2023-01-18 10:34 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 10:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Clock for WCD9340 is coming from the SoC and is the same in all users,
so move it to common file to reduce the code duplication (which still
allows further customizations per board).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

---

Changes since v1:
1. Add Rb tag.
2. Split from previous patchset.
---
 arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi           | 3 +++
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts                   | 2 --
 arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi | 2 --
 arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts           | 2 --
 arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts         | 2 --
 arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts             | 2 --
 6 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
index d0c77a8c1985..c82a8f21cbdc 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
@@ -29,6 +29,9 @@ wcd9340: codec@1,0 {
 			interrupt-controller;
 			#interrupt-cells = <1>;
 
+			clock-names = "extclk";
+			clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
+
 			#clock-cells = <0>;
 			clock-frequency = <9600000>;
 			clock-output-names = "mclk";
diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index e0289973d3e4..d9dd0136ff62 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -1034,8 +1034,6 @@ &venus {
 };
 
 &wcd9340 {
-	clock-names = "extclk";
-	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
 	vdd-buck-supply = <&vreg_s4a_1p8>;
 	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
index 5aca280b3994..fb41ac8707f0 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
@@ -484,8 +484,6 @@ &venus {
 };
 
 &wcd9340 {
-	clock-names = "extclk";
-	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
 	vdd-buck-supply = <&vreg_s4a_1p8>;
 	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
index 1ceeea0885b9..d9c4af06ab63 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
@@ -692,8 +692,6 @@ &venus {
 };
 
 &wcd9340 {
-	clock-names = "extclk";
-	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
 	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
 	vdd-buck-supply = <&vreg_s4a_1p8>;
diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index db868af1f399..aeee716a1f9a 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -694,8 +694,6 @@ &venus {
 };
 
 &wcd9340 {
-	clock-names = "extclk";
-	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
 	vdd-buck-supply = <&vreg_s4a_1p8>;
 	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
diff --git a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
index 6a9ced334f19..7ff6ac6f820e 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
@@ -602,8 +602,6 @@ &venus {
 };
 
 &wcd9340 {
-	clock-names = "extclk";
-	clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
 	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
 	vdd-buck-supply = <&vreg_s4a_1p8>;
 	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file
  2023-01-18 10:34 ` [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file Krzysztof Kozlowski
@ 2023-01-19 23:24   ` Caleb Connolly
  2023-01-20  7:42     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Caleb Connolly @ 2023-01-19 23:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, linux-arm-msm, devicetree,
	linux-kernel, Srinivas Kandagatla



On 18/01/2023 10:34, Krzysztof Kozlowski wrote:
> Re-organize SDM845 sound components into separate, audio DTSI which
> should be included and customized by the SDM845 boards wanting audio.
> The DTSI includes:
> 1. WCD9340 codec node because it is not a property of the SoC, but board.
> 2. Common sound DAI links, shared with all sound cards.

Hi Krzysztof,

I know I already reported this on IRC, I thought I'd duplicate the info
here for completeness sake.

Due to how the sound node is parsed the device numbers in alsa are
derived from the index of the sound/mmX-dai-link child nodes.

For boards which use more than 3 FE's this causes breaking changes in
userspace, as the slim-dai-link and slimcap-dai-link nodes now come
before the other mmX-dai-link nodes, for example with my OnePlus 6
patches "aplay -l" shows:

card 0: O6 [OnePlus 6], device 0: MultiMedia1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: O6 [OnePlus 6], device 1: MultiMedia2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: O6 [OnePlus 6], device 2: MultiMedia3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: O6 [OnePlus 6], device 5: MultiMedia4 (*) [] <-- 5 instead of 3
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: O6 [OnePlus 6], device 6: MultiMedia5 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: O6 [OnePlus 6], device 7: MultiMedia6 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This breaks the UCM configs shipped by postmarketOS and Mobian - though
none of it is "upstream".

Would it be reasonable to add all 6 FE DAI's and then disable the unused
ones on a per-board basis?

> 
> The Xiaomi Polaris, although includes WCD9340 codec, it lacks sound
> node, so it stays disabled.
> 
> On all others boards not using audio, keep the Slimbus node disabled as
> it is empty.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Changes since v1:
> 1. Move also sound node.
> 2. Rewrite commit msg.
> 
> RFC - please kindly test the boards.
> ---
>  .../boot/dts/qcom/sdm845-audio-wcd9340.dtsi   | 125 ++++++++++++++++++
>  arch/arm64/boot/dts/qcom/sdm845-db845c.dts    |  55 +-------
>  .../qcom/sdm845-xiaomi-beryllium-common.dtsi  |  53 +-------
>  .../boot/dts/qcom/sdm845-xiaomi-polaris.dts   |   1 +
>  arch/arm64/boot/dts/qcom/sdm845.dtsi          |  60 +--------
>  .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts |  59 ++-------
>  .../boot/dts/qcom/sdm850-samsung-w737.dts     |  60 ++-------
>  7 files changed, 151 insertions(+), 262 deletions(-)
>  create mode 100644 arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
> new file mode 100644
> index 000000000000..0a94fde6741d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sdm845-audio-wcd9340.dtsi
> @@ -0,0 +1,125 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * SDM845 SoC device tree source
> + *
> + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
> + */
> +
> +&slim {
> +	status = "okay";
> +
> +	slim@1 {
> +		reg = <1>;
> +		#address-cells = <2>;
> +		#size-cells = <0>;
> +
> +		wcd9340_ifd: ifd@0,0 {
> +			compatible = "slim217,250";
> +			reg = <0 0>;
> +		};
> +
> +		wcd9340: codec@1,0 {
> +			compatible = "slim217,250";
> +			reg = <1 0>;
> +			slim-ifc-dev = <&wcd9340_ifd>;
> +
> +			#sound-dai-cells = <1>;
> +
> +			interrupts-extended = <&tlmm 54 IRQ_TYPE_LEVEL_HIGH>;
> +			interrupt-controller;
> +			#interrupt-cells = <1>;
> +
> +			#clock-cells = <0>;
> +			clock-frequency = <9600000>;
> +			clock-output-names = "mclk";
> +			qcom,micbias1-microvolt = <1800000>;
> +			qcom,micbias2-microvolt = <1800000>;
> +			qcom,micbias3-microvolt = <1800000>;
> +			qcom,micbias4-microvolt = <1800000>;
> +
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			wcdgpio: gpio-controller@42 {
> +				compatible = "qcom,wcd9340-gpio";
> +				gpio-controller;
> +				#gpio-cells = <2>;
> +				reg = <0x42 0x2>;
> +			};
> +
> +			swm: swm@c85 {
> +				compatible = "qcom,soundwire-v1.3.0";
> +				reg = <0xc85 0x40>;
> +				interrupts-extended = <&wcd9340 20>;
> +
> +				qcom,dout-ports = <6>;
> +				qcom,din-ports = <2>;
> +				qcom,ports-sinterval-low = /bits/ 8  <0x07 0x1f 0x3f 0x7 0x1f 0x3f 0x0f 0x0f>;
> +				qcom,ports-offset1 = /bits/ 8 <0x01 0x02 0x0c 0x6 0x12 0x0d 0x07 0x0a>;
> +				qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x1f 0x00 0x00 0x1f 0x00 0x00>;
> +
> +				#sound-dai-cells = <1>;
> +				clocks = <&wcd9340>;
> +				clock-names = "iface";
> +				#address-cells = <2>;
> +				#size-cells = <0>;
> +			};
> +		};
> +	};
> +};
> +
> +&sound {
> +	compatible = "qcom,sdm845-sndcard";
> +	status = "disabled";
> +
> +	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>;
> +		};
> +	};
> +
> +	mm3-dai-link {
> +		link-name = "MultiMedia3";
> +		cpu {
> +			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
> +		};
> +	};
> +
> +	sound_slim_dai_link: slim-dai-link {
> +		link-name = "SLIM Playback";
> +		cpu {
> +			sound-dai = <&q6afedai SLIMBUS_0_RX>;
> +		};
> +
> +		platform {
> +			sound-dai = <&q6routing>;
> +		};
> +
> +		codec {
> +			sound-dai = <&wcd9340 0>;
> +		};
> +	};
> +
> +	slimcap-dai-link {
> +		link-name = "SLIM Capture";
> +		cpu {
> +			sound-dai = <&q6afedai SLIMBUS_0_TX>;
> +		};
> +
> +		platform {
> +			sound-dai = <&q6routing>;
> +		};
> +
> +		codec {
> +			sound-dai = <&wcd9340 1>;
> +		};
> +	};
> +};
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> index 4833e89affc2..11b0554a6aea 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> @@ -11,6 +11,7 @@
>  #include <dt-bindings/sound/qcom,q6afe.h>
>  #include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm845.dtsi"
> +#include "sdm845-audio-wcd9340.dtsi"
>  #include "pm8998.dtsi"
>  #include "pmi8998.dtsi"
>  
> @@ -726,27 +727,7 @@ &quat_mi2s_sd2_active
>  		"MM_DL2",  "MultiMedia2 Playback",
>  		"MM_DL4",  "MultiMedia4 Playback",
>  		"MultiMedia3 Capture", "MM_UL3";
> -
> -	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>;
> -		};
> -	};
> -
> -	mm3-dai-link {
> -		link-name = "MultiMedia3";
> -		cpu {
> -			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
> -		};
> -	};
> +	status = "okay";
>  
>  	mm4-dai-link {
>  		link-name = "MultiMedia4";
> @@ -769,35 +750,11 @@ codec {
>  			sound-dai = <&lt9611_codec 0>;
>  		};
>  	};
> +};
>  
> -	slim-dai-link {
> -		link-name = "SLIM Playback";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_RX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
> -		};
> -	};
> -
> -	slimcap-dai-link {
> -		link-name = "SLIM Capture";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_TX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&wcd9340 1>;
> -		};
> +&sound_slim_dai_link {
> +	codec {
> +		sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
>  	};
>  };
>  
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
> index 5de8b4c372fc..54eabacdc031 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
> @@ -7,6 +7,7 @@
>  #include <dt-bindings/sound/qcom,q6afe.h>
>  #include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm845.dtsi"
> +#include "sdm845-audio-wcd9340.dtsi"
>  #include "pm8998.dtsi"
>  #include "pmi8998.dtsi"
>  
> @@ -384,57 +385,7 @@ &sound {
>  		"AMIC1", "MIC BIAS1",
>  		"AMIC2", "MIC BIAS2",
>  		"AMIC3", "MIC BIAS3";
> -
> -	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>;
> -		};
> -	};
> -
> -	mm3-dai-link {
> -		link-name = "MultiMedia3";
> -		cpu {
> -			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
> -		};
> -	};
> -
> -	slim-dai-link {
> -		link-name = "SLIM Playback";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_RX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&wcd9340 0>;
> -		};
> -	};
> -
> -	slimcap-dai-link {
> -		link-name = "SLIM Capture";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_TX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&wcd9340 1>;
> -		};
> -	};
> +	status = "okay";
>  };
>  
>  &tlmm {
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
> index a80c3dd9a2da..f81619c8a3ba 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
> @@ -13,6 +13,7 @@
>  #include <dt-bindings/sound/qcom,q6afe.h>
>  #include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm845.dtsi"
> +#include "sdm845-audio-wcd9340.dtsi"
>  #include "pm8998.dtsi"
>  #include "pmi8998.dtsi"
>  #include "pm8005.dtsi"
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 0f1cb2c8addd..27d1917f5358 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -3831,65 +3831,7 @@ slim: slim-ngd@171c0000 {
>  			iommus = <&apps_smmu 0x1806 0x0>;
>  			#address-cells = <1>;
>  			#size-cells = <0>;
> -
> -			slim@1 {
> -				reg = <1>;
> -				#address-cells = <2>;
> -				#size-cells = <0>;
> -
> -				wcd9340_ifd: ifd@0,0 {
> -					compatible = "slim217,250";
> -					reg = <0 0>;
> -				};
> -
> -				wcd9340: codec@1,0 {
> -					compatible = "slim217,250";
> -					reg = <1 0>;
> -					slim-ifc-dev = <&wcd9340_ifd>;
> -
> -					#sound-dai-cells = <1>;
> -
> -					interrupts-extended = <&tlmm 54 IRQ_TYPE_LEVEL_HIGH>;
> -					interrupt-controller;
> -					#interrupt-cells = <1>;
> -
> -					#clock-cells = <0>;
> -					clock-frequency = <9600000>;
> -					clock-output-names = "mclk";
> -					qcom,micbias1-microvolt = <1800000>;
> -					qcom,micbias2-microvolt = <1800000>;
> -					qcom,micbias3-microvolt = <1800000>;
> -					qcom,micbias4-microvolt = <1800000>;
> -
> -					#address-cells = <1>;
> -					#size-cells = <1>;
> -
> -					wcdgpio: gpio-controller@42 {
> -						compatible = "qcom,wcd9340-gpio";
> -						gpio-controller;
> -						#gpio-cells = <2>;
> -						reg = <0x42 0x2>;
> -					};
> -
> -					swm: swm@c85 {
> -						compatible = "qcom,soundwire-v1.3.0";
> -						reg = <0xc85 0x40>;
> -						interrupts-extended = <&wcd9340 20>;
> -
> -						qcom,dout-ports = <6>;
> -						qcom,din-ports = <2>;
> -						qcom,ports-sinterval-low = /bits/ 8  <0x07 0x1f 0x3f 0x7 0x1f 0x3f 0x0f 0x0f>;
> -						qcom,ports-offset1 = /bits/ 8 <0x01 0x02 0x0c 0x6 0x12 0x0d 0x07 0x0a>;
> -						qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x1f 0x00 0x00 0x1f 0x00 0x00>;
> -
> -						#sound-dai-cells = <1>;
> -						clocks = <&wcd9340>;
> -						clock-names = "iface";
> -						#address-cells = <2>;
> -						#size-cells = <0>;
> -					};
> -				};
> -			};
> +			status = "disabled";
>  		};
>  
>  		lmh_cluster1: lmh@17d70800 {
> diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> index d55ffd69155e..b979d8ae8698 100644
> --- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> @@ -13,6 +13,7 @@
>  #include <dt-bindings/sound/qcom,q6afe.h>
>  #include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm850.dtsi"
> +#include "sdm845-audio-wcd9340.dtsi"
>  #include "pm8998.dtsi"
>  
>  /*
> @@ -522,57 +523,7 @@ &sound {
>  		"MM_DL1",  "MultiMedia1 Playback",
>  		"MM_DL3",  "MultiMedia3 Playback",
>  		"MultiMedia2 Capture", "MM_UL2";
> -
> -	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>;
> -		};
> -	};
> -
> -	mm3-dai-link {
> -		link-name = "MultiMedia3";
> -		cpu {
> -			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
> -		};
> -	};
> -
> -	slim-dai-link {
> -		link-name = "SLIM Playback";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_RX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
> -		};
> -	};
> -
> -	slimcap-dai-link {
> -		link-name = "SLIM Capture";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_TX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&wcd9340 1>;
> -		};
> -	};
> +	status = "okay";
>  
>  	slim-wcd-dai-link {
>  		link-name = "SLIM WCD Playback";
> @@ -590,6 +541,12 @@ codec {
>  	};
>  };
>  
> +&sound_slim_dai_link {
> +	codec {
> +		sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
> +	};
> +};
> +
>  &tlmm {
>  	gpio-reserved-ranges = <0 4>, <81 4>;
>  
> diff --git a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
> index 6730804f4e3e..75773b06701b 100644
> --- a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
> @@ -14,6 +14,7 @@
>  #include <dt-bindings/sound/qcom,q6afe.h>
>  #include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm850.dtsi"
> +#include "sdm845-audio-wcd9340.dtsi"
>  #include "pm8998.dtsi"
>  
>  /*
> @@ -436,7 +437,6 @@ dai@2 {
>  };
>  
>  &sound {
> -	compatible = "qcom,sdm845-sndcard";
>  	model = "Samsung-W737";
>  
>  	audio-routing =
> @@ -447,57 +447,7 @@ &sound {
>  		"MM_DL1",  "MultiMedia1 Playback",
>  		"MM_DL3",  "MultiMedia3 Playback",
>  		"MultiMedia2 Capture", "MM_UL2";
> -
> -	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>;
> -		};
> -	};
> -
> -	mm3-dai-link {
> -		link-name = "MultiMedia3";
> -		cpu {
> -			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
> -		};
> -	};
> -
> -	slim-dai-link {
> -		link-name = "SLIM Playback";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_RX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
> -		};
> -	};
> -
> -	slimcap-dai-link {
> -		link-name = "SLIM Capture";
> -		cpu {
> -			sound-dai = <&q6afedai SLIMBUS_0_TX>;
> -		};
> -
> -		platform {
> -			sound-dai = <&q6routing>;
> -		};
> -
> -		codec {
> -			sound-dai = <&wcd9340 1>;
> -		};
> -	};
> +	status = "okay";
>  
>  	slim-wcd-dai-link {
>  		link-name = "SLIM WCD Playback";
> @@ -515,6 +465,12 @@ codec {
>  	};
>  };
>  
> +&sound_slim_dai_link {
> +	codec {
> +		sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
> +	};
> +};
> +
>  &tlmm {
>  	gpio-reserved-ranges = <0 6>, <85 4>;
>  

-- 
Kind Regards,
Caleb (they/them)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file
  2023-01-19 23:24   ` Caleb Connolly
@ 2023-01-20  7:42     ` Krzysztof Kozlowski
  2023-01-20 23:55       ` Caleb Connolly
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-20  7:42 UTC (permalink / raw)
  To: Caleb Connolly, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, linux-arm-msm, devicetree,
	linux-kernel, Srinivas Kandagatla

On 20/01/2023 00:24, Caleb Connolly wrote:
> 
> 
> On 18/01/2023 10:34, Krzysztof Kozlowski wrote:
>> Re-organize SDM845 sound components into separate, audio DTSI which
>> should be included and customized by the SDM845 boards wanting audio.
>> The DTSI includes:
>> 1. WCD9340 codec node because it is not a property of the SoC, but board.
>> 2. Common sound DAI links, shared with all sound cards.
> 
> Hi Krzysztof,
> 
> I know I already reported this on IRC, I thought I'd duplicate the info
> here for completeness sake.
> 
> Due to how the sound node is parsed the device numbers in alsa are
> derived from the index of the sound/mmX-dai-link child nodes.
> 
> For boards which use more than 3 FE's this causes breaking changes in
> userspace, as the slim-dai-link and slimcap-dai-link nodes now come
> before the other mmX-dai-link nodes, for example with my OnePlus 6
> patches "aplay -l" shows:
> 
> card 0: O6 [OnePlus 6], device 0: MultiMedia1 (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: O6 [OnePlus 6], device 1: MultiMedia2 (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: O6 [OnePlus 6], device 2: MultiMedia3 (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: O6 [OnePlus 6], device 5: MultiMedia4 (*) [] <-- 5 instead of 3
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: O6 [OnePlus 6], device 6: MultiMedia5 (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: O6 [OnePlus 6], device 7: MultiMedia6 (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> 
> This breaks the UCM configs shipped by postmarketOS and Mobian - though
> none of it is "upstream".

Thanks for the report.


> 
> Would it be reasonable to add all 6 FE DAI's and then disable the unused
> ones on a per-board basis?


Or just drop the sound node from the audio DTSI, not sure if there are
benefits in such case...

> 
>>
>> The Xiaomi Polaris, although includes WCD9340 codec, it lacks sound
>> node, so it stays disabled.
>>
>> On all others boards not using audio, keep the Slimbus node disabled as
>> it is empty.

Please trim your replies - there is a lot of unrelated content here and
I don't know if I should keep scrolling to look for something or not.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file
  2023-01-20  7:42     ` Krzysztof Kozlowski
@ 2023-01-20 23:55       ` Caleb Connolly
  0 siblings, 0 replies; 9+ messages in thread
From: Caleb Connolly @ 2023-01-20 23:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, linux-arm-msm, devicetree,
	linux-kernel, Srinivas Kandagatla



On 20/01/2023 07:42, Krzysztof Kozlowski wrote:
> On 20/01/2023 00:24, Caleb Connolly wrote:
>>
>>
>> On 18/01/2023 10:34, Krzysztof Kozlowski wrote:
>>> Re-organize SDM845 sound components into separate, audio DTSI which
>>> should be included and customized by the SDM845 boards wanting audio.
>>> The DTSI includes:
>>> 1. WCD9340 codec node because it is not a property of the SoC, but board.
>>> 2. Common sound DAI links, shared with all sound cards.
>>
>> Hi Krzysztof,
>>
>> I know I already reported this on IRC, I thought I'd duplicate the info
>> here for completeness sake.
>>
>> Due to how the sound node is parsed the device numbers in alsa are
>> derived from the index of the sound/mmX-dai-link child nodes.
>>
>> For boards which use more than 3 FE's this causes breaking changes in
>> userspace, as the slim-dai-link and slimcap-dai-link nodes now come
>> before the other mmX-dai-link nodes, for example with my OnePlus 6
>> patches "aplay -l" shows:
>>
>> card 0: O6 [OnePlus 6], device 0: MultiMedia1 (*) []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 0: O6 [OnePlus 6], device 1: MultiMedia2 (*) []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 0: O6 [OnePlus 6], device 2: MultiMedia3 (*) []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 0: O6 [OnePlus 6], device 5: MultiMedia4 (*) [] <-- 5 instead of 3
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 0: O6 [OnePlus 6], device 6: MultiMedia5 (*) []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 0: O6 [OnePlus 6], device 7: MultiMedia6 (*) []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>>
>> This breaks the UCM configs shipped by postmarketOS and Mobian - though
>> none of it is "upstream".
> 
> Thanks for the report.
> 
> 
>>
>> Would it be reasonable to add all 6 FE DAI's and then disable the unused
>> ones on a per-board basis?
> 
> 
> Or just drop the sound node from the audio DTSI, not sure if there are
> benefits in such case...

That sounds reasonable to me. I'd be happy to rebase my OnePlus 6 patch
on this.
> 
>>
>>>
>>> The Xiaomi Polaris, although includes WCD9340 codec, it lacks sound
>>> node, so it stays disabled.
>>>
>>> On all others boards not using audio, keep the Slimbus node disabled as
>>> it is empty.
> 
> Please trim your replies - there is a lot of unrelated content here and
> I don't know if I should keep scrolling to look for something or not.

Will do, thanks for pointing that out.
> 
> Best regards,
> Krzysztof
> 

-- 
Kind Regards,
Caleb (they/them)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-20 23:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18 10:34 [RFT PATCH v2 1/6] arm64: dts: qcom: sdm845-db845c: add generic sound compatible Krzysztof Kozlowski
2023-01-18 10:34 ` [RFT PATCH v2 2/6] arm64: dts: qcom: sdm845-xiaomi-beryllium: " Krzysztof Kozlowski
2023-01-18 10:34 ` [RFT PATCH v2 3/6] arm64: dts: qcom: sdm850-lenovo-yoga: correct " Krzysztof Kozlowski
2023-01-18 10:34 ` [RFT PATCH v2 4/6] arm64: dts: qcom: sdm845: move audio to separate file Krzysztof Kozlowski
2023-01-19 23:24   ` Caleb Connolly
2023-01-20  7:42     ` Krzysztof Kozlowski
2023-01-20 23:55       ` Caleb Connolly
2023-01-18 10:34 ` [RFT PATCH v2 5/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize pinctrl Krzysztof Kozlowski
2023-01-18 10:34 ` [RFT PATCH v2 6/6] arm64: dts: qcom: sdm845-audio-wcd9340: commonize clocks Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.