linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] arm64: dts: qcom: sdm845: add audio support
@ 2020-03-05 14:53 Srinivas Kandagatla
  2020-03-05 14:53 ` [PATCH 1/4] arm64: dts: qcom: sdm845: Add ADSP " Srinivas Kandagatla
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2020-03-05 14:53 UTC (permalink / raw)
  To: bjorn.andersson, agross
  Cc: linux-arm-msm, devicetree, robh+dt, linux-kernel, Srinivas Kandagatla

First 3 patches in this patchset adds support to audio via wcd934x codec.
Last patch adds support to i2c/spi buses on Low speed expansion.


Srinivas Kandagatla (4):
  arm64: dts: qcom: sdm845: Add ADSP audio support
  arm64: dts: qcom: c630: Enable audio support
  arm64: dts: qcom: db845c: add analog audio support
  arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes

 arch/arm64/boot/dts/qcom/sdm845-db845c.dts    | 147 ++++++++
 arch/arm64/boot/dts/qcom/sdm845.dtsi          | 338 ++++++++++++++++++
 .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts |  91 +++++
 3 files changed, 576 insertions(+)

-- 
2.21.0


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

* [PATCH 1/4] arm64: dts: qcom: sdm845: Add ADSP audio support
  2020-03-05 14:53 [PATCH 0/4] arm64: dts: qcom: sdm845: add audio support Srinivas Kandagatla
@ 2020-03-05 14:53 ` Srinivas Kandagatla
  2020-03-07  2:37   ` Bjorn Andersson
  2020-03-05 14:53 ` [PATCH 2/4] arm64: dts: qcom: c630: Enable " Srinivas Kandagatla
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Srinivas Kandagatla @ 2020-03-05 14:53 UTC (permalink / raw)
  To: bjorn.andersson, agross
  Cc: linux-arm-msm, devicetree, robh+dt, linux-kernel, Srinivas Kandagatla

This patch adds support to basic dsp audio, codec, slimbus
and soundwire controller DT nodes.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 338 +++++++++++++++++++++++++++
 1 file changed, 338 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 061f49faab19..705d8a0c3a1e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -20,6 +20,7 @@
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>
 #include <dt-bindings/clock/qcom,gcc-sdm845.h>
 #include <dt-bindings/thermal/thermal.h>
+#include <dt-bindings/soc/qcom,apr.h>
 
 / {
 	interrupt-parent = <&intc>;
@@ -491,6 +492,54 @@
 			label = "lpass";
 			qcom,remote-pid = <2>;
 			mboxes = <&apss_shared 8>;
+			apr {
+				compatible = "qcom,apr-v2";
+				qcom,glink-channels = "apr_audio_svc";
+				qcom,apr-domain = <APR_DOMAIN_ADSP>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				qcom,intents = <512 20>;
+
+				q6core {
+					reg = <APR_SVC_ADSP_CORE>;
+					compatible = "qcom,q6core";
+				};
+
+				q6afe: q6afe {
+					compatible = "qcom,q6afe";
+					reg = <APR_SVC_AFE>;
+					q6afedai: dais {
+						compatible = "qcom,q6afe-dais";
+						#address-cells = <1>;
+						#size-cells = <0>;
+						#sound-dai-cells = <1>;
+
+						qi2s@22 {
+							reg = <22>;
+							qcom,sd-lines = <0 1 2 3>;
+						};
+					};
+				};
+
+				q6asm: q6asm {
+					compatible = "qcom,q6asm";
+					reg = <APR_SVC_ASM>;
+					q6asmdai: dais {
+						compatible = "qcom,q6asm-dais";
+						#sound-dai-cells = <1>;
+						iommus = <&apps_smmu 0x1821 0x0>;
+					};
+				};
+
+				q6adm: q6adm {
+					compatible = "qcom,q6adm";
+					reg = <APR_SVC_ADM>;
+					q6routing: routing {
+						compatible = "qcom,q6adm-routing";
+						#sound-dai-cells = <0>;
+					};
+				};
+			};
 			fastrpc {
 				compatible = "qcom,fastrpc";
 				qcom,glink-channels = "fastrpcglink-apps-dsp";
@@ -513,6 +562,9 @@
 		};
 	};
 
+	sound: sound {
+	};
+
 	cdsp_pas: remoteproc-cdsp {
 		compatible = "qcom,sdm845-cdsp-pas";
 
@@ -1782,6 +1834,142 @@
 				};
 			};
 
+			quat_mi2s_sleep: quat_mi2s_sleep {
+				mux {
+					pins = "gpio58", "gpio59";
+					function = "gpio";
+				};
+
+				config {
+					pins = "gpio58", "gpio59";
+					drive-strength = <2>;   /* 2 mA */
+					bias-pull-down;         /* PULL DOWN */
+					input-enable;
+				};
+			};
+
+			quat_mi2s_active: quat_mi2s_active {
+				mux {
+					pins = "gpio58", "gpio59";
+					function = "qua_mi2s";
+				};
+
+				config {
+					pins = "gpio58", "gpio59";
+					drive-strength = <8>;   /* 8 mA */
+					bias-disable;           /* NO PULL */
+					output-high;
+				};
+			};
+
+			quat_mi2s_sd0_sleep: quat_mi2s_sd0_sleep {
+				mux {
+					pins = "gpio60";
+					function = "gpio";
+				};
+
+				config {
+					pins = "gpio60";
+					drive-strength = <2>;   /* 2 mA */
+					bias-pull-down;         /* PULL DOWN */
+					input-enable;
+				};
+			};
+
+			quat_mi2s_sd0_active: quat_mi2s_sd0_active {
+				mux {
+					pins = "gpio60";
+					function = "qua_mi2s";
+				};
+
+				config {
+					pins = "gpio60";
+					drive-strength = <8>;   /* 8 mA */
+					bias-disable;           /* NO PULL */
+				};
+			};
+
+			quat_mi2s_sd1_sleep: quat_mi2s_sd1_sleep {
+				mux {
+					pins = "gpio61";
+					function = "gpio";
+				};
+
+				config {
+					pins = "gpio61";
+					drive-strength = <2>;   /* 2 mA */
+					bias-pull-down;         /* PULL DOWN */
+					input-enable;
+				};
+			};
+
+			quat_mi2s_sd1_active: quat_mi2s_sd1_active {
+				mux {
+					pins = "gpio61";
+					function = "qua_mi2s";
+				};
+
+				config {
+					pins = "gpio61";
+					drive-strength = <8>;   /* 8 mA */
+					bias-disable;           /* NO PULL */
+				};
+			};
+
+			quat_mi2s_sd2_sleep: quat_mi2s_sd2_sleep {
+				mux {
+					pins = "gpio62";
+					function = "gpio";
+				};
+
+				config {
+					pins = "gpio62";
+					drive-strength = <2>;   /* 2 mA */
+					bias-pull-down;         /* PULL DOWN */
+					input-enable;
+				};
+			};
+
+			quat_mi2s_sd2_active: quat_mi2s_sd2_active {
+				mux {
+					pins = "gpio62";
+					function = "qua_mi2s";
+				};
+
+				config {
+					pins = "gpio62";
+					drive-strength = <8>;   /* 8 mA */
+					bias-disable;           /* NO PULL */
+				};
+			};
+
+			quat_mi2s_sd3_sleep: quat_mi2s_sd3_sleep {
+				mux {
+					pins = "gpio63";
+					function = "gpio";
+				};
+
+				config {
+					pins = "gpio63";
+					drive-strength = <2>;   /* 2 mA */
+					bias-pull-down;         /* PULL DOWN */
+					input-enable;
+				};
+			};
+
+			quat_mi2s_sd3_active: quat_mi2s_sd3_active {
+				mux {
+					pins = "gpio63";
+					function = "qua_mi2s";
+				};
+
+				config {
+					pins = "gpio63";
+					drive-strength = <8>;   /* 8 mA */
+					bias-disable;           /* NO PULL */
+				};
+			};
+
 			qup_i2c12_default: qup-i2c12-default {
 				pinmux {
 					pins = "gpio49", "gpio50";
@@ -2049,6 +2237,59 @@
 					function = "qup15";
 				};
 			};
+
+			wcd_intr_default: wcd_intr_default{
+				pinmux {
+					pins = "gpio54";
+					function = "gpio";
+				};
+
+				pinconf {
+					pins = "gpio54";
+					drive-strength = <2>; /* 2 mA */
+					bias-pull-down; /* pull down */
+					input-enable;
+				};
+			};
+
+			cdc_reset_sleep: cdc_reset_sleep {
+				pinmux {
+					pins = "gpio64";
+					function = "gpio";
+				};
+				pinconf {
+					pins = "gpio64";
+					drive-strength = <2>;
+					bias-disable;
+					output-low;
+				};
+			};
+
+			cdc_reset_active:cdc_reset_active {
+				pinmux {
+					pins = "gpio64";
+					function = "gpio";
+				};
+				pinconf {
+					pins = "gpio64";
+					drive-strength = <8>;
+					bias-pull-down;
+					output-high;
+				};
+			};
+
+			audio_slimclk:slim_clk {
+				pinmux {
+					pins = "gpio70";
+					function = "gpio";
+				};
+				pinconf {
+					pins = "gpio70";
+					drive-strength = <16>;
+					bias-pull-down;
+					output-high;
+				};
+			};
 		};
 
 		mss_pil: remoteproc@4080000 {
@@ -2602,6 +2843,91 @@
 			status = "disabled";
 		};
 
+		slim_msm: slim@171c0000 {
+			compatible = "qcom,slim-ngd-v2.1.0";
+			reg = <0 0x171c0000 0 0x2C000>;
+			reg-names = "ctrl";
+			interrupts = <0 163 IRQ_TYPE_LEVEL_HIGH>;
+
+			qcom,apps-ch-pipes = <0x780000>;
+			qcom,ea-pc = <0x270>;
+			status = "okay";
+			dmas =	<&slimbam 3>, <&slimbam 4>,
+				<&slimbam 5>, <&slimbam 6>;
+			dma-names = "rx", "tx", "tx2", "rx2";
+
+			iommus = <&apps_smmu 0x1806 0x0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ngd@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				wcd9340_ifd: tas-ifd {
+					compatible = "slim217,250";
+					reg  = <0 0>;
+				};
+
+				wcd9340: codec@1{
+					pinctrl-0 = <&wcd_intr_default>;
+					pinctrl-names = "default";
+					compatible = "slim217,250";
+					reg  = <1 0>;
+					reset-gpios = <&tlmm 64 0>;
+					slim-ifc-dev  = <&wcd9340_ifd>;
+
+					#sound-dai-cells = <1>;
+
+					interrupt-parent = <&tlmm>;
+					interrupts = <54 IRQ_TYPE_LEVEL_HIGH>;
+					interrupt-controller;
+					#interrupt-cells = <1>;
+
+					#clock-cells = <0>;
+					clock-frequency = <9600000>;
+					clock-output-names = "mclk";
+					qcom,micbias1-millivolt = <1800>;
+					qcom,micbias2-millivolt = <1800>;
+					qcom,micbias3-millivolt = <1800>;
+					qcom,micbias4-millivolt = <1800>;
+
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					wcdpinctrl: wcd-pinctrl@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>;
+						interrupt-parent = <&wcd9340>;
+						interrupts = <20 IRQ_TYPE_EDGE_RISING>;
+						interrupt-names = "soundwire";
+
+						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>;
+
+
+					};
+				};
+			};
+		};
+
 		usb_1_hsphy: phy@88e2000 {
 			compatible = "qcom,sdm845-qusb2-phy";
 			reg = <0 0x088e2000 0 0x400>;
@@ -3446,6 +3772,18 @@
 			};
 		};
 
+		slimbam: bamdma@17184000 {
+			compatible = "qcom,bam-v1.7.0";
+			qcom,controlled-remotely;
+			reg = <0 0x17184000 0 0x2a000>;
+			num-channels  = <31>;
+			interrupts = <0 164 IRQ_TYPE_LEVEL_HIGH>;
+			#dma-cells = <1>;
+			qcom,ee = <1>;
+			qcom,num-ees = <2>;
+			iommus = <&apps_smmu 0x1806 0x0>;
+		};
+
 		timer@17c90000 {
 			#address-cells = <2>;
 			#size-cells = <2>;
-- 
2.21.0


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

* [PATCH 2/4] arm64: dts: qcom: c630: Enable audio support
  2020-03-05 14:53 [PATCH 0/4] arm64: dts: qcom: sdm845: add audio support Srinivas Kandagatla
  2020-03-05 14:53 ` [PATCH 1/4] arm64: dts: qcom: sdm845: Add ADSP " Srinivas Kandagatla
@ 2020-03-05 14:53 ` Srinivas Kandagatla
  2020-03-07  2:43   ` Bjorn Andersson
  2020-03-05 14:53 ` [PATCH 3/4] arm64: dts: qcom: db845c: add analog " Srinivas Kandagatla
  2020-03-05 14:53 ` [PATCH 4/4] arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes Srinivas Kandagatla
  3 siblings, 1 reply; 8+ messages in thread
From: Srinivas Kandagatla @ 2020-03-05 14:53 UTC (permalink / raw)
  To: bjorn.andersson, agross
  Cc: linux-arm-msm, devicetree, robh+dt, linux-kernel, Srinivas Kandagatla

This patch add support to audio via WSA881x Speakers and Headset.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 91 +++++++++++++++++++
 1 file changed, 91 insertions(+)

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 b255be3a4a0a..99f5836b9331 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -8,6 +8,8 @@
 /dts-v1/;
 
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm845.dtsi"
 #include "pm8998.dtsi"
 
@@ -353,6 +355,95 @@
 	status = "okay";
 };
 
+&slim_msm {
+	ngd@1 {
+		wcd9340: codec@1{
+			clock-names = "extclk";
+			clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
+			vdd-buck-supply = <&vreg_s4a_1p8>;
+			vdd-buck-sido-supply = <&vreg_s4a_1p8>;
+			vdd-tx-supply = <&vreg_s4a_1p8>;
+			vdd-rx-supply = <&vreg_s4a_1p8>;
+			vdd-io-supply = <&vreg_s4a_1p8>;
+			swm: swm@c85 {
+				left_spkr:wsa8810-left{
+					compatible = "sdw10217211000";
+					reg = <0 3>;
+					powerdown-gpios = <&wcdpinctrl 2 0>;
+					#thermal-sensor-cells = <0>;
+					sound-name-prefix = "SpkrLeft";
+					#sound-dai-cells = <0>;
+				};
+
+				right_spkr:wsa8810-right{
+					compatible = "sdw10217211000";
+					powerdown-gpios = <&wcdpinctrl 3 0>;
+					reg = <0 4>;
+					#thermal-sensor-cells = <0>;
+					sound-name-prefix = "SpkrRight";
+					#sound-dai-cells = <0>;
+				};
+			};
+
+		};
+	};
+};
+
+&sound {
+	compatible = "qcom,db845c-sndcard";
+	model = "Lenovo-YOGA-C630-13Q50";
+
+	audio-routing =
+		"RX_BIAS", "MCLK",
+		"AMIC2", "MIC BIAS2",
+		"SpkrLeft IN", "SPK1 OUT",
+		"SpkrRight IN", "SPK2 OUT";
+
+	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>;
+		};
+	};
+
+	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>;
+		};
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <0 4>, <81 4>;
 
-- 
2.21.0


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

* [PATCH 3/4] arm64: dts: qcom: db845c: add analog audio support
  2020-03-05 14:53 [PATCH 0/4] arm64: dts: qcom: sdm845: add audio support Srinivas Kandagatla
  2020-03-05 14:53 ` [PATCH 1/4] arm64: dts: qcom: sdm845: Add ADSP " Srinivas Kandagatla
  2020-03-05 14:53 ` [PATCH 2/4] arm64: dts: qcom: c630: Enable " Srinivas Kandagatla
@ 2020-03-05 14:53 ` Srinivas Kandagatla
  2020-03-05 14:53 ` [PATCH 4/4] arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes Srinivas Kandagatla
  3 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2020-03-05 14:53 UTC (permalink / raw)
  To: bjorn.andersson, agross
  Cc: linux-arm-msm, devicetree, robh+dt, linux-kernel, Srinivas Kandagatla

This patch adds support to Analog audio via WSA881x speakers.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 113 +++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index 6e60e81f8db7..350d3ea60235 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -8,6 +8,8 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
 #include "sdm845.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
@@ -200,6 +202,41 @@
 	firmware-name = "qcom/sdm845/adsp.mdt";
 };
 
+
+&slim_msm {
+	ngd@1 {
+		wcd9340: codec@1{
+			clock-names = "extclk";
+			clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
+			vdd-buck-supply = <&vreg_s4a_1p8>;
+			vdd-buck-sido-supply = <&vreg_s4a_1p8>;
+			vdd-tx-supply = <&vreg_s4a_1p8>;
+			vdd-rx-supply = <&vreg_s4a_1p8>;
+			vdd-io-supply = <&vreg_s4a_1p8>;
+
+			swm: swm@c85 {
+				left_spkr:wsa8810-left{
+					compatible = "sdw10217201000";
+					reg = <0 1>;
+					powerdown-gpios = <&wcdpinctrl 2 0>;
+					#thermal-sensor-cells = <0>;
+					sound-name-prefix = "SpkrLeft";
+					#sound-dai-cells = <0>;
+				};
+
+				right_spkr:wsa8810-right{
+					compatible = "sdw10217201000";
+					powerdown-gpios = <&wcdpinctrl 2 0>;
+					reg = <0 2>;
+					#thermal-sensor-cells = <0>;
+					sound-name-prefix = "SpkrRight";
+					#sound-dai-cells = <0>;
+				};
+			};
+		};
+	};
+};
+
 &apps_rsc {
 	pm8998-rpmh-regulators {
 		compatible = "qcom,pm8998-rpmh-regulators";
@@ -674,3 +711,79 @@
 		bias-pull-up;
 	};
 };
+
+/* QUAT I2S Uses 4 I2S SD Lines for audio on LT9611 HDMI Bridge */
+&q6afedai {
+	qi2s@22 {
+		reg = <22>;
+		qcom,sd-lines = <0 1 2 3>;
+	};
+};
+
+&sound {
+	compatible = "qcom,db845c-sndcard";
+	pinctrl-0 = <&quat_mi2s_active
+			 &quat_mi2s_sd0_active
+			 &quat_mi2s_sd1_active
+			 &quat_mi2s_sd2_active
+			 &quat_mi2s_sd3_active>;
+	pinctrl-names = "default";
+	model = "DB845c";
+	audio-routing =
+		"RX_BIAS", "MCLK",
+		"AMIC1", "MIC BIAS1",
+		"AMIC2", "MIC BIAS2",
+		"DMIC0", "MIC BIAS1",
+		"DMIC1", "MIC BIAS1",
+		"DMIC2", "MIC BIAS3",
+		"DMIC3", "MIC BIAS3",
+		"SpkrLeft IN", "SPK1 OUT",
+		"SpkrRight IN", "SPK2 OUT",
+		"MM_DL1",  "MultiMedia1 Playback",
+		"MM_DL2",  "MultiMedia2 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>;
+		};
+	};
+
+	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>;
+		};
+	};
+};
-- 
2.21.0


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

* [PATCH 4/4] arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes
  2020-03-05 14:53 [PATCH 0/4] arm64: dts: qcom: sdm845: add audio support Srinivas Kandagatla
                   ` (2 preceding siblings ...)
  2020-03-05 14:53 ` [PATCH 3/4] arm64: dts: qcom: db845c: add analog " Srinivas Kandagatla
@ 2020-03-05 14:53 ` Srinivas Kandagatla
  2020-03-07  2:47   ` Bjorn Andersson
  3 siblings, 1 reply; 8+ messages in thread
From: Srinivas Kandagatla @ 2020-03-05 14:53 UTC (permalink / raw)
  To: bjorn.andersson, agross
  Cc: linux-arm-msm, devicetree, robh+dt, linux-kernel, Srinivas Kandagatla

This patch adds support UART0, I2C0, I2C1 and SPI0 available
on Low Speed expansion connector.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index 350d3ea60235..fd2bdf10a4d9 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -434,6 +434,24 @@
 	vdda-pll-supply = <&vreg_l26a_1p2>;
 };
 
+&i2c11 {
+	/* On Low speed expansion */
+	label = "LS-I2C1";
+	status = "okay";
+};
+
+&i2c14 {
+	/* On Low speed expansion */
+	label = "LS-I2C0";
+	status = "okay";
+};
+
+&spi2 {
+	/* On Low speed expansion */
+	label = "LS-SPI0";
+	status = "okay";
+};
+
 &pm8998_gpio {
 	vol_up_pin_a: vol-up-active {
 		pins = "gpio6";
@@ -574,6 +592,11 @@
 	};
 };
 
+&uart3 {
+	label = "LS-UART0";
+	status = "disabled";
+};
+
 &uart6 {
 	status = "okay";
 
@@ -589,6 +612,7 @@
 };
 
 &uart9 {
+	label = "LS-UART1";
 	status = "okay";
 };
 
@@ -674,6 +698,16 @@
 };
 
 /* PINCTRL - additions to nodes defined in sdm845.dtsi */
+&qup_spi2_default {
+	drive-strength = <16>;
+};
+
+&qup_uart3_default{
+	pinmux {
+		pins = "gpio41", "gpio42", "gpio43", "gpio44";
+		function = "qup3";
+	};
+};
 
 &qup_uart6_default {
 	pinmux {
-- 
2.21.0


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

* Re: [PATCH 1/4] arm64: dts: qcom: sdm845: Add ADSP audio support
  2020-03-05 14:53 ` [PATCH 1/4] arm64: dts: qcom: sdm845: Add ADSP " Srinivas Kandagatla
@ 2020-03-07  2:37   ` Bjorn Andersson
  0 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2020-03-07  2:37 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: agross, linux-arm-msm, devicetree, robh+dt, linux-kernel

On Thu 05 Mar 06:53 PST 2020, Srinivas Kandagatla wrote:

> This patch adds support to basic dsp audio, codec, slimbus
> and soundwire controller DT nodes.
> 

I wouldn't be against the idea of splitting this patch in a few...

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 338 +++++++++++++++++++++++++++
>  1 file changed, 338 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 061f49faab19..705d8a0c3a1e 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -20,6 +20,7 @@
>  #include <dt-bindings/soc/qcom,rpmh-rsc.h>
>  #include <dt-bindings/clock/qcom,gcc-sdm845.h>
>  #include <dt-bindings/thermal/thermal.h>
> +#include <dt-bindings/soc/qcom,apr.h>

Please keep these sorted alphabetically.

>  
>  / {
>  	interrupt-parent = <&intc>;
> @@ -491,6 +492,54 @@
>  			label = "lpass";
>  			qcom,remote-pid = <2>;
>  			mboxes = <&apss_shared 8>;

Please add an empty line here.

> +			apr {
> +				compatible = "qcom,apr-v2";
> +				qcom,glink-channels = "apr_audio_svc";
> +				qcom,apr-domain = <APR_DOMAIN_ADSP>;
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				qcom,intents = <512 20>;
> +
> +				q6core {

q6core@3

Due to the reg.

> +					reg = <APR_SVC_ADSP_CORE>;
> +					compatible = "qcom,q6core";

Don't we want some qcom,protection-domain properties on these?

> +				};
> +
> +				q6afe: q6afe {

q6afe@4

> +					compatible = "qcom,q6afe";
> +					reg = <APR_SVC_AFE>;
> +					q6afedai: dais {
> +						compatible = "qcom,q6afe-dais";
> +						#address-cells = <1>;
> +						#size-cells = <0>;
> +						#sound-dai-cells = <1>;
> +
> +						qi2s@22 {
> +							reg = <22>;
> +							qcom,sd-lines = <0 1 2 3>;
> +						};
> +					};
> +				};
> +
> +				q6asm: q6asm {

q6asm@7

> +					compatible = "qcom,q6asm";
> +					reg = <APR_SVC_ASM>;
> +					q6asmdai: dais {
> +						compatible = "qcom,q6asm-dais";
> +						#sound-dai-cells = <1>;
> +						iommus = <&apps_smmu 0x1821 0x0>;
> +					};
> +				};
> +
> +				q6adm: q6adm {

q6adm@8

Or perhaps then, as we have a unit address, these could use a generic
name and be on the form:

q6adm: apr-service@8 {

> +					compatible = "qcom,q6adm";
> +					reg = <APR_SVC_ADM>;
> +					q6routing: routing {
> +						compatible = "qcom,q6adm-routing";
> +						#sound-dai-cells = <0>;
> +					};
> +				};
> +			};

Please take the opportunity of adding an empty line here as well.

>  			fastrpc {
>  				compatible = "qcom,fastrpc";
>  				qcom,glink-channels = "fastrpcglink-apps-dsp";
> @@ -513,6 +562,9 @@
>  		};
>  	};
>  
> +	sound: sound {
> +	};
> +
>  	cdsp_pas: remoteproc-cdsp {
>  		compatible = "qcom,sdm845-cdsp-pas";
>  
> @@ -1782,6 +1834,142 @@
>  				};
>  			};
>  
> +			quat_mi2s_sleep: quat_mi2s_sleep {

Are these all board-agnostic or should they live in the board.dts files
instead?

For all of these, please replace _ with - in the node names.

> +				mux {
> +					pins = "gpio58", "gpio59";
> +					function = "gpio";
> +				};
> +
> +				config {
> +					pins = "gpio58", "gpio59";
> +					drive-strength = <2>;   /* 2 mA */
> +					bias-pull-down;         /* PULL DOWN */

Please omit these comments, given that the properties are quite
descriptive already.

> +					input-enable;
> +				};

And you don't need the subnode level these days, i.e. this can be
written as:

			quat_mi2s_sleep: quat-mi2s-sleep {
				pins = "gpio58", "gpio59";
				function = "gpio";
				drive-strength = <2>;
				bias-pull-down;
				input-enable;
			};

> +			};
> +
[..]
> @@ -2602,6 +2843,91 @@
>  			status = "disabled";
>  		};
>  
> +		slim_msm: slim@171c0000 {
> +			compatible = "qcom,slim-ngd-v2.1.0";
> +			reg = <0 0x171c0000 0 0x2C000>;

Please lowercase the digits of the size.

> +			reg-names = "ctrl";

reg-names is not in binding, nor used by driver.

> +			interrupts = <0 163 IRQ_TYPE_LEVEL_HIGH>;

s/0/GIC_SPI/

> +
> +			qcom,apps-ch-pipes = <0x780000>;
> +			qcom,ea-pc = <0x270>;
> +			status = "okay";
> +			dmas =	<&slimbam 3>, <&slimbam 4>,
> +				<&slimbam 5>, <&slimbam 6>;
> +			dma-names = "rx", "tx", "tx2", "rx2";
> +
> +			iommus = <&apps_smmu 0x1806 0x0>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			ngd@1 {
> +				reg = <1>;
> +				#address-cells = <1>;
> +				#size-cells = <1>;
> +
> +				wcd9340_ifd: tas-ifd {

@0 given the reg, perhaps codec@0?

> +					compatible = "slim217,250";
> +					reg  = <0 0>;

Out of curiosity, why does ngd@1 have #size-cells = <1>, but then all
codecs have size 0?

> +				};
> +
> +				wcd9340: codec@1{
> +					pinctrl-0 = <&wcd_intr_default>;
> +					pinctrl-names = "default";
> +					compatible = "slim217,250";
> +					reg  = <1 0>;

I do prefer when the nodes start with compatible and then reg...

> +					reset-gpios = <&tlmm 64 0>;
> +					slim-ifc-dev  = <&wcd9340_ifd>;
> +
> +					#sound-dai-cells = <1>;
> +
> +					interrupt-parent = <&tlmm>;
> +					interrupts = <54 IRQ_TYPE_LEVEL_HIGH>;


How about combining the interrupt-parent and interrupts as:
					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-millivolt = <1800>;
> +					qcom,micbias2-millivolt = <1800>;
> +					qcom,micbias3-millivolt = <1800>;
> +					qcom,micbias4-millivolt = <1800>;
> +
> +					#address-cells = <1>;
> +					#size-cells = <1>;
> +
> +					wcdpinctrl: wcd-pinctrl@42 {

s/wcd-pinctrl/gpio-controller/

> +						compatible = "qcom,wcd9340-gpio";
> +						gpio-controller;
> +						#gpio-cells = <2>;
> +						reg = <0x42 0x2>;
> +					};
> +
> +					swm: swm@c85 {
> +						compatible = "qcom,soundwire-v1.3.0";
> +						reg = <0xc85 0x40>;
> +						interrupt-parent = <&wcd9340>;
> +						interrupts = <20 IRQ_TYPE_EDGE_RISING>;

interrupts-extended?

> +						interrupt-names = "soundwire";

No interrupt-names in binding and driver resolves the interrupt by
index, so you can omit this.

> +
> +						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>;

Odd indentation on these two.

> +
> +

Empty lines?

> +					};
> +				};
> +			};
> +		};
> +
>  		usb_1_hsphy: phy@88e2000 {
>  			compatible = "qcom,sdm845-qusb2-phy";
>  			reg = <0 0x088e2000 0 0x400>;
> @@ -3446,6 +3772,18 @@
>  			};
>  		};
>  
> +		slimbam: bamdma@17184000 {

s/bamdma/dma/

Regards,
Bjorn

> +			compatible = "qcom,bam-v1.7.0";
> +			qcom,controlled-remotely;
> +			reg = <0 0x17184000 0 0x2a000>;
> +			num-channels  = <31>;
> +			interrupts = <0 164 IRQ_TYPE_LEVEL_HIGH>;

s/0/GIC_SPI/

Regards,
Bjorn

> +			#dma-cells = <1>;
> +			qcom,ee = <1>;
> +			qcom,num-ees = <2>;
> +			iommus = <&apps_smmu 0x1806 0x0>;
> +		};
> +
>  		timer@17c90000 {
>  			#address-cells = <2>;
>  			#size-cells = <2>;
> -- 
> 2.21.0
> 

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

* Re: [PATCH 2/4] arm64: dts: qcom: c630: Enable audio support
  2020-03-05 14:53 ` [PATCH 2/4] arm64: dts: qcom: c630: Enable " Srinivas Kandagatla
@ 2020-03-07  2:43   ` Bjorn Andersson
  0 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2020-03-07  2:43 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: agross, linux-arm-msm, devicetree, robh+dt, linux-kernel

On Thu 05 Mar 06:53 PST 2020, Srinivas Kandagatla wrote:

> This patch add support to audio via WSA881x Speakers and Headset.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 91 +++++++++++++++++++
>  1 file changed, 91 insertions(+)
> 
> 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 b255be3a4a0a..99f5836b9331 100644
> --- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> @@ -8,6 +8,8 @@
>  /dts-v1/;
>  
>  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> +#include <dt-bindings/sound/qcom,q6afe.h>
> +#include <dt-bindings/sound/qcom,q6asm.h>
>  #include "sdm845.dtsi"
>  #include "pm8998.dtsi"
>  
> @@ -353,6 +355,95 @@
>  	status = "okay";
>  };
>  
> +&slim_msm {
> +	ngd@1 {
> +		wcd9340: codec@1{

Afaict this extends the &wcd9340 defined in sdm845.dtsi, so you should
be able to just reference &wcd9340 here instead.

> +			clock-names = "extclk";
> +			clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
> +			vdd-buck-supply = <&vreg_s4a_1p8>;
> +			vdd-buck-sido-supply = <&vreg_s4a_1p8>;
> +			vdd-tx-supply = <&vreg_s4a_1p8>;
> +			vdd-rx-supply = <&vreg_s4a_1p8>;
> +			vdd-io-supply = <&vreg_s4a_1p8>;
> +			swm: swm@c85 {

This too extends the node from sdm845.dtsi, so reference it by label
(and perhaps give it a label to indicate that this is the wcd9340_swm?

> +				left_spkr:wsa8810-left{

Space after ':', unit address on the node name and then perhaps just
give the node a more generic name? Something like:

left_spkr: amplifier@0 {

> +					compatible = "sdw10217211000";
> +					reg = <0 3>;
> +					powerdown-gpios = <&wcdpinctrl 2 0>;

s/0/GPIO_ACTIVE_HIGH/

> +					#thermal-sensor-cells = <0>;
> +					sound-name-prefix = "SpkrLeft";
> +					#sound-dai-cells = <0>;
> +				};
> +
> +				right_spkr:wsa8810-right{
> +					compatible = "sdw10217211000";
> +					powerdown-gpios = <&wcdpinctrl 3 0>;
> +					reg = <0 4>;
> +					#thermal-sensor-cells = <0>;
> +					sound-name-prefix = "SpkrRight";
> +					#sound-dai-cells = <0>;
> +				};
> +			};
> +
> +		};
> +	};
> +};

Regards,
Bjorn

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

* Re: [PATCH 4/4] arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes
  2020-03-05 14:53 ` [PATCH 4/4] arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes Srinivas Kandagatla
@ 2020-03-07  2:47   ` Bjorn Andersson
  0 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2020-03-07  2:47 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: agross, linux-arm-msm, devicetree, robh+dt, linux-kernel

On Thu 05 Mar 06:53 PST 2020, Srinivas Kandagatla wrote:

> This patch adds support UART0, I2C0, I2C1 and SPI0 available
> on Low Speed expansion connector.
> 

Applied, after fixing the sort order. Thanks for posting this!

Regards,
Bjorn

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 34 ++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> index 350d3ea60235..fd2bdf10a4d9 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> @@ -434,6 +434,24 @@
>  	vdda-pll-supply = <&vreg_l26a_1p2>;
>  };
>  
> +&i2c11 {
> +	/* On Low speed expansion */
> +	label = "LS-I2C1";
> +	status = "okay";
> +};
> +
> +&i2c14 {
> +	/* On Low speed expansion */
> +	label = "LS-I2C0";
> +	status = "okay";
> +};
> +
> +&spi2 {
> +	/* On Low speed expansion */
> +	label = "LS-SPI0";
> +	status = "okay";
> +};
> +
>  &pm8998_gpio {
>  	vol_up_pin_a: vol-up-active {
>  		pins = "gpio6";
> @@ -574,6 +592,11 @@
>  	};
>  };
>  
> +&uart3 {
> +	label = "LS-UART0";
> +	status = "disabled";
> +};
> +
>  &uart6 {
>  	status = "okay";
>  
> @@ -589,6 +612,7 @@
>  };
>  
>  &uart9 {
> +	label = "LS-UART1";
>  	status = "okay";
>  };
>  
> @@ -674,6 +698,16 @@
>  };
>  
>  /* PINCTRL - additions to nodes defined in sdm845.dtsi */
> +&qup_spi2_default {
> +	drive-strength = <16>;
> +};
> +
> +&qup_uart3_default{
> +	pinmux {
> +		pins = "gpio41", "gpio42", "gpio43", "gpio44";
> +		function = "qup3";
> +	};
> +};
>  
>  &qup_uart6_default {
>  	pinmux {
> -- 
> 2.21.0
> 

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

end of thread, other threads:[~2020-03-07  2:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-05 14:53 [PATCH 0/4] arm64: dts: qcom: sdm845: add audio support Srinivas Kandagatla
2020-03-05 14:53 ` [PATCH 1/4] arm64: dts: qcom: sdm845: Add ADSP " Srinivas Kandagatla
2020-03-07  2:37   ` Bjorn Andersson
2020-03-05 14:53 ` [PATCH 2/4] arm64: dts: qcom: c630: Enable " Srinivas Kandagatla
2020-03-07  2:43   ` Bjorn Andersson
2020-03-05 14:53 ` [PATCH 3/4] arm64: dts: qcom: db845c: add analog " Srinivas Kandagatla
2020-03-05 14:53 ` [PATCH 4/4] arm64: dts: qcom: db845c: add Low speed expansion i2c and spi nodes Srinivas Kandagatla
2020-03-07  2:47   ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).