All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/6] arm64: ti: Enable audio on AM62 and AM62A
@ 2023-03-28 13:29 ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

This patch series adds support for audio via headphone jack on SK-AM62
(E2+) and SK-AM62A boards. The jack is wired to TLV320AIC3106 (codec),
which is connected to McASP1 (serializer) on the SoC.

The TRRS 3.5mm jack can be used for simultaneous playback and recording.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
---
Changes in v8:
- Rebase on top of
  https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git/log/?h=ti-k3-dts-next
  keeping audio nodes in the common dtsi
- Link to v7: https://lore.kernel.org/r/20230313-mcasp_upstream-v7-1-88168d0df9b8@ti.com

Changes in v7:
- Add links to schematics in commit messages
- Link to v6: https://lore.kernel.org/r/20230313-mcasp_upstream-v6-0-77685d7cbeb8@ti.com

Changes in v6:
- Use generic node names (audio-controller@) for McASP
- Fix labels, indentation and spacing issues
- For SK-AM62A:
	- Remove redundant status property from codec
	- Add a note in commit message about missing DVDD regulator
	- Supply OCMV level manually to the codec
- Link to v5: https://lore.kernel.org/r/20230313-mcasp_upstream-v5-0-d6844707aa8a@ti.com

---
Jai Luthra (5):
      arm64: defconfig: Enable audio drivers for TI K3 SoCs
      arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
      arm64: dts: ti: k3-am62a-main: Add nodes for McASP
      arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators
      arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A

Jayesh Choudhary (1):
      arm64: dts: ti: k3-am62-main: Add McASP nodes

 arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 +++
 arch/arm64/boot/dts/ti/k3-am62-main.dtsi       | 60 +++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 +++
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi      | 60 +++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts        | 92 +++++++++++++++++++++++++-
 arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 +++++++++++++++++++++
 arch/arm64/configs/defconfig                   |  2 +
 7 files changed, 311 insertions(+), 2 deletions(-)
---
base-commit: e1ecd17c0d1e2219c58e5152243e4702bae4f0a4
change-id: 20230313-mcasp_upstream-0e137013059b

Best regards,
-- 
Jai Luthra <j-luthra@ti.com>


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

* [PATCH v8 0/6] arm64: ti: Enable audio on AM62 and AM62A
@ 2023-03-28 13:29 ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

This patch series adds support for audio via headphone jack on SK-AM62
(E2+) and SK-AM62A boards. The jack is wired to TLV320AIC3106 (codec),
which is connected to McASP1 (serializer) on the SoC.

The TRRS 3.5mm jack can be used for simultaneous playback and recording.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
---
Changes in v8:
- Rebase on top of
  https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git/log/?h=ti-k3-dts-next
  keeping audio nodes in the common dtsi
- Link to v7: https://lore.kernel.org/r/20230313-mcasp_upstream-v7-1-88168d0df9b8@ti.com

Changes in v7:
- Add links to schematics in commit messages
- Link to v6: https://lore.kernel.org/r/20230313-mcasp_upstream-v6-0-77685d7cbeb8@ti.com

Changes in v6:
- Use generic node names (audio-controller@) for McASP
- Fix labels, indentation and spacing issues
- For SK-AM62A:
	- Remove redundant status property from codec
	- Add a note in commit message about missing DVDD regulator
	- Supply OCMV level manually to the codec
- Link to v5: https://lore.kernel.org/r/20230313-mcasp_upstream-v5-0-d6844707aa8a@ti.com

---
Jai Luthra (5):
      arm64: defconfig: Enable audio drivers for TI K3 SoCs
      arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
      arm64: dts: ti: k3-am62a-main: Add nodes for McASP
      arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators
      arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A

Jayesh Choudhary (1):
      arm64: dts: ti: k3-am62-main: Add McASP nodes

 arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 +++
 arch/arm64/boot/dts/ti/k3-am62-main.dtsi       | 60 +++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 +++
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi      | 60 +++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts        | 92 +++++++++++++++++++++++++-
 arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 +++++++++++++++++++++
 arch/arm64/configs/defconfig                   |  2 +
 7 files changed, 311 insertions(+), 2 deletions(-)
---
base-commit: e1ecd17c0d1e2219c58e5152243e4702bae4f0a4
change-id: 20230313-mcasp_upstream-0e137013059b

Best regards,
-- 
Jai Luthra <j-luthra@ti.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v8 1/6] arm64: defconfig: Enable audio drivers for TI K3 SoCs
  2023-03-28 13:29 ` Jai Luthra
@ 2023-03-28 13:29   ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

TI's K3 platform uses McASP as the digital audio interface on the SoCs.
AM62x and AM62A based starter kits also use the TLV320AIC3106 codec with
a 3.5mm jack for analog audio input and output.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
 arch/arm64/configs/defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7790ee42c68a..7e0ce1833904 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -898,6 +898,8 @@ CONFIG_SND_SOC_LPASS_WSA_MACRO=m
 CONFIG_SND_SOC_LPASS_VA_MACRO=m
 CONFIG_SND_SOC_LPASS_RX_MACRO=m
 CONFIG_SND_SOC_LPASS_TX_MACRO=m
+CONFIG_SND_SOC_DAVINCI_MCASP=m
+CONFIG_SND_SOC_TLV320AIC3X_I2C=m
 CONFIG_SND_SIMPLE_CARD=m
 CONFIG_SND_AUDIO_GRAPH_CARD=m
 CONFIG_SND_AUDIO_GRAPH_CARD2=m

-- 
2.40.0


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

* [PATCH v8 1/6] arm64: defconfig: Enable audio drivers for TI K3 SoCs
@ 2023-03-28 13:29   ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

TI's K3 platform uses McASP as the digital audio interface on the SoCs.
AM62x and AM62A based starter kits also use the TLV320AIC3106 codec with
a 3.5mm jack for analog audio input and output.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
 arch/arm64/configs/defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7790ee42c68a..7e0ce1833904 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -898,6 +898,8 @@ CONFIG_SND_SOC_LPASS_WSA_MACRO=m
 CONFIG_SND_SOC_LPASS_VA_MACRO=m
 CONFIG_SND_SOC_LPASS_RX_MACRO=m
 CONFIG_SND_SOC_LPASS_TX_MACRO=m
+CONFIG_SND_SOC_DAVINCI_MCASP=m
+CONFIG_SND_SOC_TLV320AIC3X_I2C=m
 CONFIG_SND_SIMPLE_CARD=m
 CONFIG_SND_AUDIO_GRAPH_CARD=m
 CONFIG_SND_AUDIO_GRAPH_CARD2=m

-- 
2.40.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v8 2/6] arm64: dts: ti: k3-am62-main: Add McASP nodes
  2023-03-28 13:29 ` Jai Luthra
@ 2023-03-28 13:29   ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

From: Jayesh Choudhary <j-choudhary@ti.com>

Add the nodes for McASP 0-2.

Use the audio-friendly 96MHz main_1_hsdivout6_clk as clock parent
instead of the default 100Mhz main_2_hsdivout8_clk source.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 60 ++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
index 16e14863d7df..b3e4857bbbe4 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -832,4 +832,64 @@ epwm2: pwm@23020000 {
 		clock-names = "tbclk", "fck";
 		status = "disabled";
 	};
+
+	mcasp0: audio-controller@2b00000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b00000 0x00 0x2000>,
+		      <0x00 0x02b08000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 236 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc500 0>, <&main_bcdma 0 0x4500 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 190 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 190 0>;
+		assigned-clock-parents = <&k3_clks 190 2>;
+		power-domains = <&k3_pds 190 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp1: audio-controller@2b10000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b10000 0x00 0x2000>,
+		      <0x00 0x02b18000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc501 0>, <&main_bcdma 0 0x4501 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 191 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 191 0>;
+		assigned-clock-parents = <&k3_clks 191 2>;
+		power-domains = <&k3_pds 191 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp2: audio-controller@2b20000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b20000 0x00 0x2000>,
+		      <0x00 0x02b28000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc502 0>, <&main_bcdma 0 0x4502 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 192 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 192 0>;
+		assigned-clock-parents = <&k3_clks 192 2>;
+		power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
 };

-- 
2.40.0


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

* [PATCH v8 2/6] arm64: dts: ti: k3-am62-main: Add McASP nodes
@ 2023-03-28 13:29   ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

From: Jayesh Choudhary <j-choudhary@ti.com>

Add the nodes for McASP 0-2.

Use the audio-friendly 96MHz main_1_hsdivout6_clk as clock parent
instead of the default 100Mhz main_2_hsdivout8_clk source.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 60 ++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
index 16e14863d7df..b3e4857bbbe4 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -832,4 +832,64 @@ epwm2: pwm@23020000 {
 		clock-names = "tbclk", "fck";
 		status = "disabled";
 	};
+
+	mcasp0: audio-controller@2b00000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b00000 0x00 0x2000>,
+		      <0x00 0x02b08000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 236 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc500 0>, <&main_bcdma 0 0x4500 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 190 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 190 0>;
+		assigned-clock-parents = <&k3_clks 190 2>;
+		power-domains = <&k3_pds 190 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp1: audio-controller@2b10000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b10000 0x00 0x2000>,
+		      <0x00 0x02b18000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc501 0>, <&main_bcdma 0 0x4501 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 191 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 191 0>;
+		assigned-clock-parents = <&k3_clks 191 2>;
+		power-domains = <&k3_pds 191 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp2: audio-controller@2b20000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b20000 0x00 0x2000>,
+		      <0x00 0x02b28000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc502 0>, <&main_bcdma 0 0x4502 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 192 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 192 0>;
+		assigned-clock-parents = <&k3_clks 192 2>;
+		power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
 };

-- 
2.40.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
  2023-03-28 13:29 ` Jai Luthra
@ 2023-03-28 13:29   ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

Add nodes for audio codec and sound card, enable the audio serializer
(McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.

Keep all audio related nodes in the common dtsi as they are exactly the
same between SK-AM62 and SK-AM62-LP.

Link: https://www.ti.com/lit/zip/sprr448 [1]
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
 arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
 arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
index b2ca19e3042e..5ed6b1abe87d 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
@@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
 		states = <1800000 0x0>,
 			 <3300000 0x1>;
 	};
+
+	vcc_1v8: regulator-5 {
+		/* output of TPS62824DMQ */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_1v8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3_sys>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &main_pmx0 {
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
index cdc0858dd1b2..2b861681e548 100644
--- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
@@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
 		states = <1800000 0x0>,
 			 <3300000 0x1>;
 	};
+
+	vcc_1v8: regulator-5 {
+		/* output of TPS6282518DMQ */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_1v8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3_sys>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &main_pmx0 {
diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
index 54318a07d50c..2500cb9ba323 100644
--- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
@@ -81,6 +81,41 @@ led-0 {
 			default-state = "off";
 		};
 	};
+
+	tlv320_mclk: clk-0 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		clock-frequency = <12288000>;
+	};
+
+	codec_audio: sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "AM62x-SKEVM";
+		simple-audio-card,widgets =
+			"Headphone",	"Headphone Jack",
+			"Line",		"Line In",
+			"Microphone",	"Microphone Jack";
+		simple-audio-card,routing =
+			"Headphone Jack",	"HPLOUT",
+			"Headphone Jack",	"HPROUT",
+			"LINE1L",		"Line In",
+			"LINE1R",		"Line In",
+			"MIC3R",		"Microphone Jack",
+			"Microphone Jack",	"Mic Bias";
+		simple-audio-card,format = "dsp_b";
+		simple-audio-card,bitclock-master = <&sound_master>;
+		simple-audio-card,frame-master = <&sound_master>;
+		simple-audio-card,bitclock-inversion;
+
+		simple-audio-card,cpu {
+			sound-dai = <&mcasp1>;
+		};
+
+		sound_master: simple-audio-card,codec {
+			sound-dai = <&tlv320aic3106>;
+			clocks = <&tlv320_mclk>;
+		};
+	};
 };
 
 &main_pmx0 {
@@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
 			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
 		>;
 	};
+
+	main_mcasp1_pins_default: main-mcasp1-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
+			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
+			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
+			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
+		>;
+	};
 };
 
 &wkup_uart0 {
@@ -205,6 +249,19 @@ &main_i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&main_i2c1_pins_default>;
 	clock-frequency = <400000>;
+
+	tlv320aic3106: audio-codec@1b {
+		#sound-dai-cells = <0>;
+		compatible = "ti,tlv320aic3106";
+		reg = <0x1b>;
+		ai3x-micbias-vg = <1>;	/* 2.0V */
+
+		/* Regulators */
+		AVDD-supply = <&vcc_3v3_sys>;
+		IOVDD-supply = <&vcc_3v3_sys>;
+		DRVDD-supply = <&vcc_3v3_sys>;
+		DVDD-supply = <&vcc_1v8>;
+	};
 };
 
 &sdhci0 {
@@ -272,3 +329,23 @@ &usb1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&main_usb1_pins_default>;
 };
+
+&mcasp1 {
+	status = "okay";
+	#sound-dai-cells = <0>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mcasp1_pins_default>;
+
+	op-mode = <0>;          /* MCASP_IIS_MODE */
+	tdm-slots = <2>;
+
+	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+	       1 0 2 0
+	       0 0 0 0
+	       0 0 0 0
+	       0 0 0 0
+	>;
+	tx-num-evt = <32>;
+	rx-num-evt = <32>;
+};

-- 
2.40.0


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

* [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
@ 2023-03-28 13:29   ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

Add nodes for audio codec and sound card, enable the audio serializer
(McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.

Keep all audio related nodes in the common dtsi as they are exactly the
same between SK-AM62 and SK-AM62-LP.

Link: https://www.ti.com/lit/zip/sprr448 [1]
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
 arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
 arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
index b2ca19e3042e..5ed6b1abe87d 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
@@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
 		states = <1800000 0x0>,
 			 <3300000 0x1>;
 	};
+
+	vcc_1v8: regulator-5 {
+		/* output of TPS62824DMQ */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_1v8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3_sys>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &main_pmx0 {
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
index cdc0858dd1b2..2b861681e548 100644
--- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
@@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
 		states = <1800000 0x0>,
 			 <3300000 0x1>;
 	};
+
+	vcc_1v8: regulator-5 {
+		/* output of TPS6282518DMQ */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_1v8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3_sys>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &main_pmx0 {
diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
index 54318a07d50c..2500cb9ba323 100644
--- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
@@ -81,6 +81,41 @@ led-0 {
 			default-state = "off";
 		};
 	};
+
+	tlv320_mclk: clk-0 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		clock-frequency = <12288000>;
+	};
+
+	codec_audio: sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "AM62x-SKEVM";
+		simple-audio-card,widgets =
+			"Headphone",	"Headphone Jack",
+			"Line",		"Line In",
+			"Microphone",	"Microphone Jack";
+		simple-audio-card,routing =
+			"Headphone Jack",	"HPLOUT",
+			"Headphone Jack",	"HPROUT",
+			"LINE1L",		"Line In",
+			"LINE1R",		"Line In",
+			"MIC3R",		"Microphone Jack",
+			"Microphone Jack",	"Mic Bias";
+		simple-audio-card,format = "dsp_b";
+		simple-audio-card,bitclock-master = <&sound_master>;
+		simple-audio-card,frame-master = <&sound_master>;
+		simple-audio-card,bitclock-inversion;
+
+		simple-audio-card,cpu {
+			sound-dai = <&mcasp1>;
+		};
+
+		sound_master: simple-audio-card,codec {
+			sound-dai = <&tlv320aic3106>;
+			clocks = <&tlv320_mclk>;
+		};
+	};
 };
 
 &main_pmx0 {
@@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
 			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
 		>;
 	};
+
+	main_mcasp1_pins_default: main-mcasp1-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
+			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
+			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
+			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
+		>;
+	};
 };
 
 &wkup_uart0 {
@@ -205,6 +249,19 @@ &main_i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&main_i2c1_pins_default>;
 	clock-frequency = <400000>;
+
+	tlv320aic3106: audio-codec@1b {
+		#sound-dai-cells = <0>;
+		compatible = "ti,tlv320aic3106";
+		reg = <0x1b>;
+		ai3x-micbias-vg = <1>;	/* 2.0V */
+
+		/* Regulators */
+		AVDD-supply = <&vcc_3v3_sys>;
+		IOVDD-supply = <&vcc_3v3_sys>;
+		DRVDD-supply = <&vcc_3v3_sys>;
+		DVDD-supply = <&vcc_1v8>;
+	};
 };
 
 &sdhci0 {
@@ -272,3 +329,23 @@ &usb1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&main_usb1_pins_default>;
 };
+
+&mcasp1 {
+	status = "okay";
+	#sound-dai-cells = <0>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mcasp1_pins_default>;
+
+	op-mode = <0>;          /* MCASP_IIS_MODE */
+	tdm-slots = <2>;
+
+	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+	       1 0 2 0
+	       0 0 0 0
+	       0 0 0 0
+	       0 0 0 0
+	>;
+	tx-num-evt = <32>;
+	rx-num-evt = <32>;
+};

-- 
2.40.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v8 4/6] arm64: dts: ti: k3-am62a-main: Add nodes for McASP
  2023-03-28 13:29 ` Jai Luthra
@ 2023-03-28 13:29   ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

Same as AM62, AM62A has three instances of McASP which can be used for
transmitting or receiving digital audio in various formats.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 60 +++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
index 393a1a40b68b..50e4fcb1d678 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
@@ -660,4 +660,64 @@ ecap2: pwm@23120000 {
 		clock-names = "fck";
 		status = "disabled";
 	};
+
+	mcasp0: audio-controller@2b00000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b00000 0x00 0x2000>,
+		      <0x00 0x02b08000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 236 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc500 0>, <&main_bcdma 0 0x4500 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 190 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 190 0>;
+		assigned-clock-parents = <&k3_clks 190 2>;
+		power-domains = <&k3_pds 190 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp1: audio-controller@2b10000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b10000 0x00 0x2000>,
+		      <0x00 0x02b18000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc501 0>, <&main_bcdma 0 0x4501 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 191 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 191 0>;
+		assigned-clock-parents = <&k3_clks 191 2>;
+		power-domains = <&k3_pds 191 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp2: audio-controller@2b20000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b20000 0x00 0x2000>,
+		      <0x00 0x02b28000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc502 0>, <&main_bcdma 0 0x4502 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 192 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 192 0>;
+		assigned-clock-parents = <&k3_clks 192 2>;
+		power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
 };

-- 
2.40.0


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

* [PATCH v8 4/6] arm64: dts: ti: k3-am62a-main: Add nodes for McASP
@ 2023-03-28 13:29   ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

Same as AM62, AM62A has three instances of McASP which can be used for
transmitting or receiving digital audio in various formats.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 60 +++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
index 393a1a40b68b..50e4fcb1d678 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
@@ -660,4 +660,64 @@ ecap2: pwm@23120000 {
 		clock-names = "fck";
 		status = "disabled";
 	};
+
+	mcasp0: audio-controller@2b00000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b00000 0x00 0x2000>,
+		      <0x00 0x02b08000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 236 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc500 0>, <&main_bcdma 0 0x4500 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 190 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 190 0>;
+		assigned-clock-parents = <&k3_clks 190 2>;
+		power-domains = <&k3_pds 190 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp1: audio-controller@2b10000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b10000 0x00 0x2000>,
+		      <0x00 0x02b18000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc501 0>, <&main_bcdma 0 0x4501 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 191 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 191 0>;
+		assigned-clock-parents = <&k3_clks 191 2>;
+		power-domains = <&k3_pds 191 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
+
+	mcasp2: audio-controller@2b20000 {
+		compatible = "ti,am33xx-mcasp-audio";
+		reg = <0x00 0x02b20000 0x00 0x2000>,
+		      <0x00 0x02b28000 0x00 0x400>;
+		reg-names = "mpu", "dat";
+		interrupts = <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "tx", "rx";
+
+		dmas = <&main_bcdma 0 0xc502 0>, <&main_bcdma 0 0x4502 0>;
+		dma-names = "tx", "rx";
+
+		clocks = <&k3_clks 192 0>;
+		clock-names = "fck";
+		assigned-clocks = <&k3_clks 192 0>;
+		assigned-clock-parents = <&k3_clks 192 2>;
+		power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
 };

-- 
2.40.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v8 5/6] arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators
  2023-03-28 13:29 ` Jai Luthra
@ 2023-03-28 13:29   ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

VCC_3V3_MAIN is the output of LM5141-Q1, and it serves as an input to
TPS22965DSGT which produces VCC_3V3_SYS. [1]

Link: https://www.ti.com/lit/zip/sprr459 [1]
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
index f6a67f072dca..2296d656323c 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
@@ -77,10 +77,10 @@ vcc_5v0: regulator-1 {
 		regulator-boot-on;
 	};
 
-	vcc_3v3_sys: regulator-2 {
+	vcc_3v3_main: regulator-2 {
 		/* output of LM5141-Q1 */
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_3v3_sys";
+		regulator-name = "vcc_3v3_main";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		vin-supply = <&vmain_pd>;
@@ -99,6 +99,17 @@ vdd_mmc1: regulator-3 {
 		gpio = <&exp1 3 GPIO_ACTIVE_HIGH>;
 	};
 
+	vcc_3v3_sys: regulator-4 {
+		/* output of TPS222965DSGT */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_3v3_sys";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_3v3_main>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";

-- 
2.40.0


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

* [PATCH v8 5/6] arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators
@ 2023-03-28 13:29   ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

VCC_3V3_MAIN is the output of LM5141-Q1, and it serves as an input to
TPS22965DSGT which produces VCC_3V3_SYS. [1]

Link: https://www.ti.com/lit/zip/sprr459 [1]
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
index f6a67f072dca..2296d656323c 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
@@ -77,10 +77,10 @@ vcc_5v0: regulator-1 {
 		regulator-boot-on;
 	};
 
-	vcc_3v3_sys: regulator-2 {
+	vcc_3v3_main: regulator-2 {
 		/* output of LM5141-Q1 */
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_3v3_sys";
+		regulator-name = "vcc_3v3_main";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		vin-supply = <&vmain_pd>;
@@ -99,6 +99,17 @@ vdd_mmc1: regulator-3 {
 		gpio = <&exp1 3 GPIO_ACTIVE_HIGH>;
 	};
 
+	vcc_3v3_sys: regulator-4 {
+		/* output of TPS222965DSGT */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_3v3_sys";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_3v3_main>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";

-- 
2.40.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v8 6/6] arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A
  2023-03-28 13:29 ` Jai Luthra
@ 2023-03-28 13:29   ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

Add nodes for audio codec and sound card, enable the audio serializer
(McASP1) under use and update pinmux.

The codec (TLV320AIC3106) is also supplied with a DVDD 1.8V supply from
the PMIC (TPS6593x) on the SK. [1] As the PMIC driver and devicetree
node is missing, skip describing DVDD for now and manually set the OCMV
voltage.

Link: https://www.ti.com/lit/zip/sprr459 [1]
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 77 +++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
index 2296d656323c..8d7087e5f9e4 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
@@ -123,6 +123,41 @@ led-0 {
 			default-state = "off";
 		};
 	};
+
+	tlv320_mclk: clk-0 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		clock-frequency = <12288000>;
+	};
+
+	codec_audio: sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "AM62Ax-SKEVM";
+		simple-audio-card,widgets =
+			"Headphone",	"Headphone Jack",
+			"Line",		"Line In",
+			"Microphone",	"Microphone Jack";
+		simple-audio-card,routing =
+			"Headphone Jack",	"HPLOUT",
+			"Headphone Jack",	"HPROUT",
+			"LINE1L",		"Line In",
+			"LINE1R",		"Line In",
+			"MIC3R",		"Microphone Jack",
+			"Microphone Jack",	"Mic Bias";
+		simple-audio-card,format = "dsp_b";
+		simple-audio-card,bitclock-master = <&sound_master>;
+		simple-audio-card,frame-master = <&sound_master>;
+		simple-audio-card,bitclock-inversion;
+
+		simple-audio-card,cpu {
+			sound-dai = <&mcasp1>;
+		};
+
+		sound_master: simple-audio-card,codec {
+			sound-dai = <&tlv320aic3106>;
+			clocks = <&tlv320_mclk>;
+		};
+	};
 };
 
 &main_pmx0 {
@@ -201,6 +236,15 @@ AM62AX_IOPAD(0x130, PIN_INPUT, 0) /* (AB17) RGMII1_TXC */
 			AM62AX_IOPAD(0x12c, PIN_INPUT, 0) /* (W16) RGMII1_TX_CTL */
 		>;
 	};
+
+	main_mcasp1_pins_default: main-mcasp1-pins-default {
+		pinctrl-single,pins = <
+			AM62AX_IOPAD(0x090, PIN_INPUT, 2) /* (L19) GPMC0_BE0n_CLE.MCASP1_ACLKX */
+			AM62AX_IOPAD(0x098, PIN_INPUT, 2) /* (R18) GPMC0_WAIT0.MCASP1_AFSX */
+			AM62AX_IOPAD(0x08c, PIN_OUTPUT, 2) /* (K19) GPMC0_WEn.MCASP1_AXR0 */
+			AM62AX_IOPAD(0x084, PIN_INPUT, 2) /* (L18) GPMC0_ADVn_ALE.MCASP1_AXR2 */
+		>;
+	};
 };
 
 &main_i2c0 {
@@ -235,6 +279,19 @@ exp1: gpio@22 {
 				   "MCASP1_FET_SEL", "UART1_FET_SEL",
 				   "PD_I2C_IRQ", "IO_EXP_TEST_LED";
 	};
+
+	tlv320aic3106: audio-codec@1b {
+		#sound-dai-cells = <0>;
+		compatible = "ti,tlv320aic3106";
+		reg = <0x1b>;
+		ai3x-micbias-vg = <1>;	/* 2.0V */
+		ai3x-ocmv = <1>;	/* 1.5V */
+
+		/* Regulators */
+		AVDD-supply = <&vcc_3v3_sys>;
+		IOVDD-supply = <&vcc_3v3_sys>;
+		DRVDD-supply = <&vcc_3v3_sys>;
+	};
 };
 
 &sdhci1 {
@@ -303,3 +360,23 @@ cpsw3g_phy0: ethernet-phy@0 {
 		ti,min-output-impedance;
 	};
 };
+
+&mcasp1 {
+	status = "okay";
+	#sound-dai-cells = <0>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mcasp1_pins_default>;
+
+	op-mode = <0>;          /* MCASP_IIS_MODE */
+	tdm-slots = <2>;
+
+	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+	       1 0 2 0
+	       0 0 0 0
+	       0 0 0 0
+	       0 0 0 0
+	>;
+	tx-num-evt = <32>;
+	rx-num-evt = <32>;
+};

-- 
2.40.0


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

* [PATCH v8 6/6] arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A
@ 2023-03-28 13:29   ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:29 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-kernel, linux-kernel, devicetree, Aradhya Bhatia,
	Devarsh Thakkar, Jayesh Choudhary, Andrew Davis, Jai Luthra

Add nodes for audio codec and sound card, enable the audio serializer
(McASP1) under use and update pinmux.

The codec (TLV320AIC3106) is also supplied with a DVDD 1.8V supply from
the PMIC (TPS6593x) on the SK. [1] As the PMIC driver and devicetree
node is missing, skip describing DVDD for now and manually set the OCMV
voltage.

Link: https://www.ti.com/lit/zip/sprr459 [1]
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 77 +++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
index 2296d656323c..8d7087e5f9e4 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
@@ -123,6 +123,41 @@ led-0 {
 			default-state = "off";
 		};
 	};
+
+	tlv320_mclk: clk-0 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		clock-frequency = <12288000>;
+	};
+
+	codec_audio: sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "AM62Ax-SKEVM";
+		simple-audio-card,widgets =
+			"Headphone",	"Headphone Jack",
+			"Line",		"Line In",
+			"Microphone",	"Microphone Jack";
+		simple-audio-card,routing =
+			"Headphone Jack",	"HPLOUT",
+			"Headphone Jack",	"HPROUT",
+			"LINE1L",		"Line In",
+			"LINE1R",		"Line In",
+			"MIC3R",		"Microphone Jack",
+			"Microphone Jack",	"Mic Bias";
+		simple-audio-card,format = "dsp_b";
+		simple-audio-card,bitclock-master = <&sound_master>;
+		simple-audio-card,frame-master = <&sound_master>;
+		simple-audio-card,bitclock-inversion;
+
+		simple-audio-card,cpu {
+			sound-dai = <&mcasp1>;
+		};
+
+		sound_master: simple-audio-card,codec {
+			sound-dai = <&tlv320aic3106>;
+			clocks = <&tlv320_mclk>;
+		};
+	};
 };
 
 &main_pmx0 {
@@ -201,6 +236,15 @@ AM62AX_IOPAD(0x130, PIN_INPUT, 0) /* (AB17) RGMII1_TXC */
 			AM62AX_IOPAD(0x12c, PIN_INPUT, 0) /* (W16) RGMII1_TX_CTL */
 		>;
 	};
+
+	main_mcasp1_pins_default: main-mcasp1-pins-default {
+		pinctrl-single,pins = <
+			AM62AX_IOPAD(0x090, PIN_INPUT, 2) /* (L19) GPMC0_BE0n_CLE.MCASP1_ACLKX */
+			AM62AX_IOPAD(0x098, PIN_INPUT, 2) /* (R18) GPMC0_WAIT0.MCASP1_AFSX */
+			AM62AX_IOPAD(0x08c, PIN_OUTPUT, 2) /* (K19) GPMC0_WEn.MCASP1_AXR0 */
+			AM62AX_IOPAD(0x084, PIN_INPUT, 2) /* (L18) GPMC0_ADVn_ALE.MCASP1_AXR2 */
+		>;
+	};
 };
 
 &main_i2c0 {
@@ -235,6 +279,19 @@ exp1: gpio@22 {
 				   "MCASP1_FET_SEL", "UART1_FET_SEL",
 				   "PD_I2C_IRQ", "IO_EXP_TEST_LED";
 	};
+
+	tlv320aic3106: audio-codec@1b {
+		#sound-dai-cells = <0>;
+		compatible = "ti,tlv320aic3106";
+		reg = <0x1b>;
+		ai3x-micbias-vg = <1>;	/* 2.0V */
+		ai3x-ocmv = <1>;	/* 1.5V */
+
+		/* Regulators */
+		AVDD-supply = <&vcc_3v3_sys>;
+		IOVDD-supply = <&vcc_3v3_sys>;
+		DRVDD-supply = <&vcc_3v3_sys>;
+	};
 };
 
 &sdhci1 {
@@ -303,3 +360,23 @@ cpsw3g_phy0: ethernet-phy@0 {
 		ti,min-output-impedance;
 	};
 };
+
+&mcasp1 {
+	status = "okay";
+	#sound-dai-cells = <0>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mcasp1_pins_default>;
+
+	op-mode = <0>;          /* MCASP_IIS_MODE */
+	tdm-slots = <2>;
+
+	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+	       1 0 2 0
+	       0 0 0 0
+	       0 0 0 0
+	       0 0 0 0
+	>;
+	tx-num-evt = <32>;
+	rx-num-evt = <32>;
+};

-- 
2.40.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
  2023-03-28 13:29   ` Jai Luthra
@ 2023-03-28 13:32     ` Nishanth Menon
  -1 siblings, 0 replies; 20+ messages in thread
From: Nishanth Menon @ 2023-03-28 13:32 UTC (permalink / raw)
  To: Jai Luthra
  Cc: Vignesh Raghavendra, Tero Kristo, Catalin Marinas, Will Deacon,
	Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, linux-kernel,
	devicetree, Aradhya Bhatia, Devarsh Thakkar, Jayesh Choudhary,
	Andrew Davis

On 18:59-20230328, Jai Luthra wrote:
> Add nodes for audio codec and sound card, enable the audio serializer
> (McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.
> 
> Keep all audio related nodes in the common dtsi as they are exactly the
> same between SK-AM62 and SK-AM62-LP.
> 
> Link: https://www.ti.com/lit/zip/sprr448 [1]
> Signed-off-by: Jai Luthra <j-luthra@ti.com>
> Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
>  arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
>  arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
>  3 files changed, 99 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> index b2ca19e3042e..5ed6b1abe87d 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> @@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
>  		states = <1800000 0x0>,
>  			 <3300000 0x1>;
>  	};
> +
> +	vcc_1v8: regulator-5 {
> +		/* output of TPS62824DMQ */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc_1v8";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		vin-supply = <&vcc_3v3_sys>;
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
>  };
>  
>  &main_pmx0 {
> diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> index cdc0858dd1b2..2b861681e548 100644
> --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> @@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
>  		states = <1800000 0x0>,
>  			 <3300000 0x1>;
>  	};
> +
> +	vcc_1v8: regulator-5 {
> +		/* output of TPS6282518DMQ */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc_1v8";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		vin-supply = <&vcc_3v3_sys>;
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
>  };

If the regulators are common, maybe we should first move the regulators
to common dtsi?

>  
>  &main_pmx0 {
> diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> index 54318a07d50c..2500cb9ba323 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> @@ -81,6 +81,41 @@ led-0 {
>  			default-state = "off";
>  		};
>  	};
> +
> +	tlv320_mclk: clk-0 {
> +		#clock-cells = <0>;
> +		compatible = "fixed-clock";
> +		clock-frequency = <12288000>;
> +	};
> +
> +	codec_audio: sound {
> +		compatible = "simple-audio-card";
> +		simple-audio-card,name = "AM62x-SKEVM";
> +		simple-audio-card,widgets =
> +			"Headphone",	"Headphone Jack",
> +			"Line",		"Line In",
> +			"Microphone",	"Microphone Jack";
> +		simple-audio-card,routing =
> +			"Headphone Jack",	"HPLOUT",
> +			"Headphone Jack",	"HPROUT",
> +			"LINE1L",		"Line In",
> +			"LINE1R",		"Line In",
> +			"MIC3R",		"Microphone Jack",
> +			"Microphone Jack",	"Mic Bias";
> +		simple-audio-card,format = "dsp_b";
> +		simple-audio-card,bitclock-master = <&sound_master>;
> +		simple-audio-card,frame-master = <&sound_master>;
> +		simple-audio-card,bitclock-inversion;
> +
> +		simple-audio-card,cpu {
> +			sound-dai = <&mcasp1>;
> +		};
> +
> +		sound_master: simple-audio-card,codec {
> +			sound-dai = <&tlv320aic3106>;
> +			clocks = <&tlv320_mclk>;
> +		};
> +	};
>  };
>  
>  &main_pmx0 {
> @@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
>  			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
>  		>;
>  	};
> +
> +	main_mcasp1_pins_default: main-mcasp1-pins-default {
> +		pinctrl-single,pins = <
> +			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
> +			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
> +			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
> +			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
> +		>;
> +	};
>  };
>  
>  &wkup_uart0 {
> @@ -205,6 +249,19 @@ &main_i2c1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&main_i2c1_pins_default>;
>  	clock-frequency = <400000>;
> +
> +	tlv320aic3106: audio-codec@1b {
> +		#sound-dai-cells = <0>;
> +		compatible = "ti,tlv320aic3106";
> +		reg = <0x1b>;
> +		ai3x-micbias-vg = <1>;	/* 2.0V */
> +
> +		/* Regulators */
> +		AVDD-supply = <&vcc_3v3_sys>;
> +		IOVDD-supply = <&vcc_3v3_sys>;
> +		DRVDD-supply = <&vcc_3v3_sys>;
> +		DVDD-supply = <&vcc_1v8>;
> +	};
>  };
>  
>  &sdhci0 {
> @@ -272,3 +329,23 @@ &usb1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&main_usb1_pins_default>;
>  };
> +
> +&mcasp1 {
> +	status = "okay";
> +	#sound-dai-cells = <0>;
> +
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&main_mcasp1_pins_default>;
> +
> +	op-mode = <0>;          /* MCASP_IIS_MODE */
> +	tdm-slots = <2>;
> +
> +	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
> +	       1 0 2 0
> +	       0 0 0 0
> +	       0 0 0 0
> +	       0 0 0 0
> +	>;
> +	tx-num-evt = <32>;
> +	rx-num-evt = <32>;
> +};
> 
> -- 
> 2.40.0
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

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

* Re: [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
@ 2023-03-28 13:32     ` Nishanth Menon
  0 siblings, 0 replies; 20+ messages in thread
From: Nishanth Menon @ 2023-03-28 13:32 UTC (permalink / raw)
  To: Jai Luthra
  Cc: Vignesh Raghavendra, Tero Kristo, Catalin Marinas, Will Deacon,
	Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, linux-kernel,
	devicetree, Aradhya Bhatia, Devarsh Thakkar, Jayesh Choudhary,
	Andrew Davis

On 18:59-20230328, Jai Luthra wrote:
> Add nodes for audio codec and sound card, enable the audio serializer
> (McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.
> 
> Keep all audio related nodes in the common dtsi as they are exactly the
> same between SK-AM62 and SK-AM62-LP.
> 
> Link: https://www.ti.com/lit/zip/sprr448 [1]
> Signed-off-by: Jai Luthra <j-luthra@ti.com>
> Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
>  arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
>  arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
>  3 files changed, 99 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> index b2ca19e3042e..5ed6b1abe87d 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> @@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
>  		states = <1800000 0x0>,
>  			 <3300000 0x1>;
>  	};
> +
> +	vcc_1v8: regulator-5 {
> +		/* output of TPS62824DMQ */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc_1v8";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		vin-supply = <&vcc_3v3_sys>;
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
>  };
>  
>  &main_pmx0 {
> diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> index cdc0858dd1b2..2b861681e548 100644
> --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> @@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
>  		states = <1800000 0x0>,
>  			 <3300000 0x1>;
>  	};
> +
> +	vcc_1v8: regulator-5 {
> +		/* output of TPS6282518DMQ */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc_1v8";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		vin-supply = <&vcc_3v3_sys>;
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
>  };

If the regulators are common, maybe we should first move the regulators
to common dtsi?

>  
>  &main_pmx0 {
> diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> index 54318a07d50c..2500cb9ba323 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> @@ -81,6 +81,41 @@ led-0 {
>  			default-state = "off";
>  		};
>  	};
> +
> +	tlv320_mclk: clk-0 {
> +		#clock-cells = <0>;
> +		compatible = "fixed-clock";
> +		clock-frequency = <12288000>;
> +	};
> +
> +	codec_audio: sound {
> +		compatible = "simple-audio-card";
> +		simple-audio-card,name = "AM62x-SKEVM";
> +		simple-audio-card,widgets =
> +			"Headphone",	"Headphone Jack",
> +			"Line",		"Line In",
> +			"Microphone",	"Microphone Jack";
> +		simple-audio-card,routing =
> +			"Headphone Jack",	"HPLOUT",
> +			"Headphone Jack",	"HPROUT",
> +			"LINE1L",		"Line In",
> +			"LINE1R",		"Line In",
> +			"MIC3R",		"Microphone Jack",
> +			"Microphone Jack",	"Mic Bias";
> +		simple-audio-card,format = "dsp_b";
> +		simple-audio-card,bitclock-master = <&sound_master>;
> +		simple-audio-card,frame-master = <&sound_master>;
> +		simple-audio-card,bitclock-inversion;
> +
> +		simple-audio-card,cpu {
> +			sound-dai = <&mcasp1>;
> +		};
> +
> +		sound_master: simple-audio-card,codec {
> +			sound-dai = <&tlv320aic3106>;
> +			clocks = <&tlv320_mclk>;
> +		};
> +	};
>  };
>  
>  &main_pmx0 {
> @@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
>  			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
>  		>;
>  	};
> +
> +	main_mcasp1_pins_default: main-mcasp1-pins-default {
> +		pinctrl-single,pins = <
> +			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
> +			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
> +			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
> +			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
> +		>;
> +	};
>  };
>  
>  &wkup_uart0 {
> @@ -205,6 +249,19 @@ &main_i2c1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&main_i2c1_pins_default>;
>  	clock-frequency = <400000>;
> +
> +	tlv320aic3106: audio-codec@1b {
> +		#sound-dai-cells = <0>;
> +		compatible = "ti,tlv320aic3106";
> +		reg = <0x1b>;
> +		ai3x-micbias-vg = <1>;	/* 2.0V */
> +
> +		/* Regulators */
> +		AVDD-supply = <&vcc_3v3_sys>;
> +		IOVDD-supply = <&vcc_3v3_sys>;
> +		DRVDD-supply = <&vcc_3v3_sys>;
> +		DVDD-supply = <&vcc_1v8>;
> +	};
>  };
>  
>  &sdhci0 {
> @@ -272,3 +329,23 @@ &usb1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&main_usb1_pins_default>;
>  };
> +
> +&mcasp1 {
> +	status = "okay";
> +	#sound-dai-cells = <0>;
> +
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&main_mcasp1_pins_default>;
> +
> +	op-mode = <0>;          /* MCASP_IIS_MODE */
> +	tdm-slots = <2>;
> +
> +	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
> +	       1 0 2 0
> +	       0 0 0 0
> +	       0 0 0 0
> +	       0 0 0 0
> +	>;
> +	tx-num-evt = <32>;
> +	rx-num-evt = <32>;
> +};
> 
> -- 
> 2.40.0
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
  2023-03-28 13:32     ` Nishanth Menon
@ 2023-03-28 13:51       ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:51 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra
  Cc: Tero Kristo, Catalin Marinas, Will Deacon, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, linux-kernel, devicetree,
	Aradhya Bhatia, Devarsh Thakkar, Jayesh Choudhary, Andrew Davis

[-- Attachment #1: Type: text/plain, Size: 6116 bytes --]

Hi Nishanth,

On Mar 28, 2023 at 08:32:25 -0500, Nishanth Menon wrote:
> On 18:59-20230328, Jai Luthra wrote:
> > Add nodes for audio codec and sound card, enable the audio serializer
> > (McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.
> > 
> > Keep all audio related nodes in the common dtsi as they are exactly the
> > same between SK-AM62 and SK-AM62-LP.
> > 
> > Link: https://www.ti.com/lit/zip/sprr448 [1]
> > Signed-off-by: Jai Luthra <j-luthra@ti.com>
> > Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
> > ---
> >  arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
> >  3 files changed, 99 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > index b2ca19e3042e..5ed6b1abe87d 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > @@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS62824DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > index cdc0858dd1b2..2b861681e548 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > @@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS6282518DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> 
> If the regulators are common, maybe we should first move the regulators
> to common dtsi?
> 

The part number of this particular regulator is different in the 
schematics for the two boards.

For rest of the regulators I did not check, but I see the PMIC 
(TPS65219x) is present on SK-AM62-LP but missing on SK-AM62.

Thanks,
Jai

> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > index 54318a07d50c..2500cb9ba323 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > @@ -81,6 +81,41 @@ led-0 {
> >  			default-state = "off";
> >  		};
> >  	};
> > +
> > +	tlv320_mclk: clk-0 {
> > +		#clock-cells = <0>;
> > +		compatible = "fixed-clock";
> > +		clock-frequency = <12288000>;
> > +	};
> > +
> > +	codec_audio: sound {
> > +		compatible = "simple-audio-card";
> > +		simple-audio-card,name = "AM62x-SKEVM";
> > +		simple-audio-card,widgets =
> > +			"Headphone",	"Headphone Jack",
> > +			"Line",		"Line In",
> > +			"Microphone",	"Microphone Jack";
> > +		simple-audio-card,routing =
> > +			"Headphone Jack",	"HPLOUT",
> > +			"Headphone Jack",	"HPROUT",
> > +			"LINE1L",		"Line In",
> > +			"LINE1R",		"Line In",
> > +			"MIC3R",		"Microphone Jack",
> > +			"Microphone Jack",	"Mic Bias";
> > +		simple-audio-card,format = "dsp_b";
> > +		simple-audio-card,bitclock-master = <&sound_master>;
> > +		simple-audio-card,frame-master = <&sound_master>;
> > +		simple-audio-card,bitclock-inversion;
> > +
> > +		simple-audio-card,cpu {
> > +			sound-dai = <&mcasp1>;
> > +		};
> > +
> > +		sound_master: simple-audio-card,codec {
> > +			sound-dai = <&tlv320aic3106>;
> > +			clocks = <&tlv320_mclk>;
> > +		};
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > @@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
> >  			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
> >  		>;
> >  	};
> > +
> > +	main_mcasp1_pins_default: main-mcasp1-pins-default {
> > +		pinctrl-single,pins = <
> > +			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
> > +			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
> > +			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
> > +			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
> > +		>;
> > +	};
> >  };
> >  
> >  &wkup_uart0 {
> > @@ -205,6 +249,19 @@ &main_i2c1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_i2c1_pins_default>;
> >  	clock-frequency = <400000>;
> > +
> > +	tlv320aic3106: audio-codec@1b {
> > +		#sound-dai-cells = <0>;
> > +		compatible = "ti,tlv320aic3106";
> > +		reg = <0x1b>;
> > +		ai3x-micbias-vg = <1>;	/* 2.0V */
> > +
> > +		/* Regulators */
> > +		AVDD-supply = <&vcc_3v3_sys>;
> > +		IOVDD-supply = <&vcc_3v3_sys>;
> > +		DRVDD-supply = <&vcc_3v3_sys>;
> > +		DVDD-supply = <&vcc_1v8>;
> > +	};
> >  };
> >  
> >  &sdhci0 {
> > @@ -272,3 +329,23 @@ &usb1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_usb1_pins_default>;
> >  };
> > +
> > +&mcasp1 {
> > +	status = "okay";
> > +	#sound-dai-cells = <0>;
> > +
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&main_mcasp1_pins_default>;
> > +
> > +	op-mode = <0>;          /* MCASP_IIS_MODE */
> > +	tdm-slots = <2>;
> > +
> > +	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
> > +	       1 0 2 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	>;
> > +	tx-num-evt = <32>;
> > +	rx-num-evt = <32>;
> > +};
> > 
> > -- 
> > 2.40.0
> > 
> 
> -- 
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
@ 2023-03-28 13:51       ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-28 13:51 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra
  Cc: Tero Kristo, Catalin Marinas, Will Deacon, Rob Herring,
	Krzysztof Kozlowski, linux-arm-kernel, linux-kernel, devicetree,
	Aradhya Bhatia, Devarsh Thakkar, Jayesh Choudhary, Andrew Davis


[-- Attachment #1.1: Type: text/plain, Size: 6116 bytes --]

Hi Nishanth,

On Mar 28, 2023 at 08:32:25 -0500, Nishanth Menon wrote:
> On 18:59-20230328, Jai Luthra wrote:
> > Add nodes for audio codec and sound card, enable the audio serializer
> > (McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.
> > 
> > Keep all audio related nodes in the common dtsi as they are exactly the
> > same between SK-AM62 and SK-AM62-LP.
> > 
> > Link: https://www.ti.com/lit/zip/sprr448 [1]
> > Signed-off-by: Jai Luthra <j-luthra@ti.com>
> > Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
> > ---
> >  arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
> >  3 files changed, 99 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > index b2ca19e3042e..5ed6b1abe87d 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > @@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS62824DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > index cdc0858dd1b2..2b861681e548 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > @@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS6282518DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> 
> If the regulators are common, maybe we should first move the regulators
> to common dtsi?
> 

The part number of this particular regulator is different in the 
schematics for the two boards.

For rest of the regulators I did not check, but I see the PMIC 
(TPS65219x) is present on SK-AM62-LP but missing on SK-AM62.

Thanks,
Jai

> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > index 54318a07d50c..2500cb9ba323 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > @@ -81,6 +81,41 @@ led-0 {
> >  			default-state = "off";
> >  		};
> >  	};
> > +
> > +	tlv320_mclk: clk-0 {
> > +		#clock-cells = <0>;
> > +		compatible = "fixed-clock";
> > +		clock-frequency = <12288000>;
> > +	};
> > +
> > +	codec_audio: sound {
> > +		compatible = "simple-audio-card";
> > +		simple-audio-card,name = "AM62x-SKEVM";
> > +		simple-audio-card,widgets =
> > +			"Headphone",	"Headphone Jack",
> > +			"Line",		"Line In",
> > +			"Microphone",	"Microphone Jack";
> > +		simple-audio-card,routing =
> > +			"Headphone Jack",	"HPLOUT",
> > +			"Headphone Jack",	"HPROUT",
> > +			"LINE1L",		"Line In",
> > +			"LINE1R",		"Line In",
> > +			"MIC3R",		"Microphone Jack",
> > +			"Microphone Jack",	"Mic Bias";
> > +		simple-audio-card,format = "dsp_b";
> > +		simple-audio-card,bitclock-master = <&sound_master>;
> > +		simple-audio-card,frame-master = <&sound_master>;
> > +		simple-audio-card,bitclock-inversion;
> > +
> > +		simple-audio-card,cpu {
> > +			sound-dai = <&mcasp1>;
> > +		};
> > +
> > +		sound_master: simple-audio-card,codec {
> > +			sound-dai = <&tlv320aic3106>;
> > +			clocks = <&tlv320_mclk>;
> > +		};
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > @@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
> >  			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
> >  		>;
> >  	};
> > +
> > +	main_mcasp1_pins_default: main-mcasp1-pins-default {
> > +		pinctrl-single,pins = <
> > +			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
> > +			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
> > +			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
> > +			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
> > +		>;
> > +	};
> >  };
> >  
> >  &wkup_uart0 {
> > @@ -205,6 +249,19 @@ &main_i2c1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_i2c1_pins_default>;
> >  	clock-frequency = <400000>;
> > +
> > +	tlv320aic3106: audio-codec@1b {
> > +		#sound-dai-cells = <0>;
> > +		compatible = "ti,tlv320aic3106";
> > +		reg = <0x1b>;
> > +		ai3x-micbias-vg = <1>;	/* 2.0V */
> > +
> > +		/* Regulators */
> > +		AVDD-supply = <&vcc_3v3_sys>;
> > +		IOVDD-supply = <&vcc_3v3_sys>;
> > +		DRVDD-supply = <&vcc_3v3_sys>;
> > +		DVDD-supply = <&vcc_1v8>;
> > +	};
> >  };
> >  
> >  &sdhci0 {
> > @@ -272,3 +329,23 @@ &usb1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_usb1_pins_default>;
> >  };
> > +
> > +&mcasp1 {
> > +	status = "okay";
> > +	#sound-dai-cells = <0>;
> > +
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&main_mcasp1_pins_default>;
> > +
> > +	op-mode = <0>;          /* MCASP_IIS_MODE */
> > +	tdm-slots = <2>;
> > +
> > +	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
> > +	       1 0 2 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	>;
> > +	tx-num-evt = <32>;
> > +	rx-num-evt = <32>;
> > +};
> > 
> > -- 
> > 2.40.0
> > 
> 
> -- 
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
  2023-03-28 13:32     ` Nishanth Menon
@ 2023-03-29  8:04       ` Jai Luthra
  -1 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-29  8:04 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Vignesh Raghavendra, Tero Kristo, Catalin Marinas, Will Deacon,
	Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, linux-kernel,
	devicetree, Aradhya Bhatia, Devarsh Thakkar, Jayesh Choudhary,
	Andrew Davis

[-- Attachment #1: Type: text/plain, Size: 6192 bytes --]

Hi,

On Mar 28, 2023 at 08:32:25 -0500, Nishanth Menon wrote:
> On 18:59-20230328, Jai Luthra wrote:
> > Add nodes for audio codec and sound card, enable the audio serializer
> > (McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.
> > 
> > Keep all audio related nodes in the common dtsi as they are exactly the
> > same between SK-AM62 and SK-AM62-LP.
> > 
> > Link: https://www.ti.com/lit/zip/sprr448 [1]
> > Signed-off-by: Jai Luthra <j-luthra@ti.com>
> > Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
> > ---
> >  arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
> >  3 files changed, 99 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > index b2ca19e3042e..5ed6b1abe87d 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > @@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS62824DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > index cdc0858dd1b2..2b861681e548 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > @@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS6282518DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> 
> If the regulators are common, maybe we should first move the regulators
> to common dtsi?

Sorry, please disregard this patch, I went over the schematics again and 
found that I made a mistake here.

On SK-AM62-LP the audio codec gets the 1.8V from PMIC and not from a 
dedicated on-board regulator. On SK-AM62 we do have a dedicated on-board 
regulator for that.

Will fix this in next version.

Thanks,
Jai

> 
> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > index 54318a07d50c..2500cb9ba323 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > @@ -81,6 +81,41 @@ led-0 {
> >  			default-state = "off";
> >  		};
> >  	};
> > +
> > +	tlv320_mclk: clk-0 {
> > +		#clock-cells = <0>;
> > +		compatible = "fixed-clock";
> > +		clock-frequency = <12288000>;
> > +	};
> > +
> > +	codec_audio: sound {
> > +		compatible = "simple-audio-card";
> > +		simple-audio-card,name = "AM62x-SKEVM";
> > +		simple-audio-card,widgets =
> > +			"Headphone",	"Headphone Jack",
> > +			"Line",		"Line In",
> > +			"Microphone",	"Microphone Jack";
> > +		simple-audio-card,routing =
> > +			"Headphone Jack",	"HPLOUT",
> > +			"Headphone Jack",	"HPROUT",
> > +			"LINE1L",		"Line In",
> > +			"LINE1R",		"Line In",
> > +			"MIC3R",		"Microphone Jack",
> > +			"Microphone Jack",	"Mic Bias";
> > +		simple-audio-card,format = "dsp_b";
> > +		simple-audio-card,bitclock-master = <&sound_master>;
> > +		simple-audio-card,frame-master = <&sound_master>;
> > +		simple-audio-card,bitclock-inversion;
> > +
> > +		simple-audio-card,cpu {
> > +			sound-dai = <&mcasp1>;
> > +		};
> > +
> > +		sound_master: simple-audio-card,codec {
> > +			sound-dai = <&tlv320aic3106>;
> > +			clocks = <&tlv320_mclk>;
> > +		};
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > @@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
> >  			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
> >  		>;
> >  	};
> > +
> > +	main_mcasp1_pins_default: main-mcasp1-pins-default {
> > +		pinctrl-single,pins = <
> > +			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
> > +			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
> > +			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
> > +			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
> > +		>;
> > +	};
> >  };
> >  
> >  &wkup_uart0 {
> > @@ -205,6 +249,19 @@ &main_i2c1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_i2c1_pins_default>;
> >  	clock-frequency = <400000>;
> > +
> > +	tlv320aic3106: audio-codec@1b {
> > +		#sound-dai-cells = <0>;
> > +		compatible = "ti,tlv320aic3106";
> > +		reg = <0x1b>;
> > +		ai3x-micbias-vg = <1>;	/* 2.0V */
> > +
> > +		/* Regulators */
> > +		AVDD-supply = <&vcc_3v3_sys>;
> > +		IOVDD-supply = <&vcc_3v3_sys>;
> > +		DRVDD-supply = <&vcc_3v3_sys>;
> > +		DVDD-supply = <&vcc_1v8>;
> > +	};
> >  };
> >  
> >  &sdhci0 {
> > @@ -272,3 +329,23 @@ &usb1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_usb1_pins_default>;
> >  };
> > +
> > +&mcasp1 {
> > +	status = "okay";
> > +	#sound-dai-cells = <0>;
> > +
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&main_mcasp1_pins_default>;
> > +
> > +	op-mode = <0>;          /* MCASP_IIS_MODE */
> > +	tdm-slots = <2>;
> > +
> > +	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
> > +	       1 0 2 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	>;
> > +	tx-num-evt = <32>;
> > +	rx-num-evt = <32>;
> > +};
> > 
> > -- 
> > 2.40.0
> > 
> 
> -- 
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
@ 2023-03-29  8:04       ` Jai Luthra
  0 siblings, 0 replies; 20+ messages in thread
From: Jai Luthra @ 2023-03-29  8:04 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Vignesh Raghavendra, Tero Kristo, Catalin Marinas, Will Deacon,
	Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, linux-kernel,
	devicetree, Aradhya Bhatia, Devarsh Thakkar, Jayesh Choudhary,
	Andrew Davis


[-- Attachment #1.1: Type: text/plain, Size: 6192 bytes --]

Hi,

On Mar 28, 2023 at 08:32:25 -0500, Nishanth Menon wrote:
> On 18:59-20230328, Jai Luthra wrote:
> > Add nodes for audio codec and sound card, enable the audio serializer
> > (McASP1) under use from SK-AM62 E2 [1] onwards and update pinmux.
> > 
> > Keep all audio related nodes in the common dtsi as they are exactly the
> > same between SK-AM62 and SK-AM62-LP.
> > 
> > Link: https://www.ti.com/lit/zip/sprr448 [1]
> > Signed-off-by: Jai Luthra <j-luthra@ti.com>
> > Reviewed-by: Jayesh Choudhary <j-choudhary@ti.com>
> > ---
> >  arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts       | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am625-sk.dts         | 11 ++++
> >  arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 77 ++++++++++++++++++++++++++
> >  3 files changed, 99 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > index b2ca19e3042e..5ed6b1abe87d 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
> > @@ -70,6 +70,17 @@ vddshv_sdio: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS62824DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > index cdc0858dd1b2..2b861681e548 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> > @@ -87,6 +87,17 @@ vdd_sd_dv: regulator-4 {
> >  		states = <1800000 0x0>,
> >  			 <3300000 0x1>;
> >  	};
> > +
> > +	vcc_1v8: regulator-5 {
> > +		/* output of TPS6282518DMQ */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc_1v8";
> > +		regulator-min-microvolt = <1800000>;
> > +		regulator-max-microvolt = <1800000>;
> > +		vin-supply = <&vcc_3v3_sys>;
> > +		regulator-always-on;
> > +		regulator-boot-on;
> > +	};
> >  };
> 
> If the regulators are common, maybe we should first move the regulators
> to common dtsi?

Sorry, please disregard this patch, I went over the schematics again and 
found that I made a mistake here.

On SK-AM62-LP the audio codec gets the 1.8V from PMIC and not from a 
dedicated on-board regulator. On SK-AM62 we do have a dedicated on-board 
regulator for that.

Will fix this in next version.

Thanks,
Jai

> 
> >  
> >  &main_pmx0 {
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > index 54318a07d50c..2500cb9ba323 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > @@ -81,6 +81,41 @@ led-0 {
> >  			default-state = "off";
> >  		};
> >  	};
> > +
> > +	tlv320_mclk: clk-0 {
> > +		#clock-cells = <0>;
> > +		compatible = "fixed-clock";
> > +		clock-frequency = <12288000>;
> > +	};
> > +
> > +	codec_audio: sound {
> > +		compatible = "simple-audio-card";
> > +		simple-audio-card,name = "AM62x-SKEVM";
> > +		simple-audio-card,widgets =
> > +			"Headphone",	"Headphone Jack",
> > +			"Line",		"Line In",
> > +			"Microphone",	"Microphone Jack";
> > +		simple-audio-card,routing =
> > +			"Headphone Jack",	"HPLOUT",
> > +			"Headphone Jack",	"HPROUT",
> > +			"LINE1L",		"Line In",
> > +			"LINE1R",		"Line In",
> > +			"MIC3R",		"Microphone Jack",
> > +			"Microphone Jack",	"Mic Bias";
> > +		simple-audio-card,format = "dsp_b";
> > +		simple-audio-card,bitclock-master = <&sound_master>;
> > +		simple-audio-card,frame-master = <&sound_master>;
> > +		simple-audio-card,bitclock-inversion;
> > +
> > +		simple-audio-card,cpu {
> > +			sound-dai = <&mcasp1>;
> > +		};
> > +
> > +		sound_master: simple-audio-card,codec {
> > +			sound-dai = <&tlv320aic3106>;
> > +			clocks = <&tlv320_mclk>;
> > +		};
> > +	};
> >  };
> >  
> >  &main_pmx0 {
> > @@ -175,6 +210,15 @@ main_usb1_pins_default: main-usb1-pins-default {
> >  			AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */
> >  		>;
> >  	};
> > +
> > +	main_mcasp1_pins_default: main-mcasp1-pins-default {
> > +		pinctrl-single,pins = <
> > +			AM62X_IOPAD(0x090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
> > +			AM62X_IOPAD(0x098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
> > +			AM62X_IOPAD(0x08c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
> > +			AM62X_IOPAD(0x084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
> > +		>;
> > +	};
> >  };
> >  
> >  &wkup_uart0 {
> > @@ -205,6 +249,19 @@ &main_i2c1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_i2c1_pins_default>;
> >  	clock-frequency = <400000>;
> > +
> > +	tlv320aic3106: audio-codec@1b {
> > +		#sound-dai-cells = <0>;
> > +		compatible = "ti,tlv320aic3106";
> > +		reg = <0x1b>;
> > +		ai3x-micbias-vg = <1>;	/* 2.0V */
> > +
> > +		/* Regulators */
> > +		AVDD-supply = <&vcc_3v3_sys>;
> > +		IOVDD-supply = <&vcc_3v3_sys>;
> > +		DRVDD-supply = <&vcc_3v3_sys>;
> > +		DVDD-supply = <&vcc_1v8>;
> > +	};
> >  };
> >  
> >  &sdhci0 {
> > @@ -272,3 +329,23 @@ &usb1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&main_usb1_pins_default>;
> >  };
> > +
> > +&mcasp1 {
> > +	status = "okay";
> > +	#sound-dai-cells = <0>;
> > +
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&main_mcasp1_pins_default>;
> > +
> > +	op-mode = <0>;          /* MCASP_IIS_MODE */
> > +	tdm-slots = <2>;
> > +
> > +	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
> > +	       1 0 2 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	       0 0 0 0
> > +	>;
> > +	tx-num-evt = <32>;
> > +	rx-num-evt = <32>;
> > +};
> > 
> > -- 
> > 2.40.0
> > 
> 
> -- 
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-03-29  8:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 13:29 [PATCH v8 0/6] arm64: ti: Enable audio on AM62 and AM62A Jai Luthra
2023-03-28 13:29 ` Jai Luthra
2023-03-28 13:29 ` [PATCH v8 1/6] arm64: defconfig: Enable audio drivers for TI K3 SoCs Jai Luthra
2023-03-28 13:29   ` Jai Luthra
2023-03-28 13:29 ` [PATCH v8 2/6] arm64: dts: ti: k3-am62-main: Add McASP nodes Jai Luthra
2023-03-28 13:29   ` Jai Luthra
2023-03-28 13:29 ` [PATCH v8 3/6] arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK Jai Luthra
2023-03-28 13:29   ` Jai Luthra
2023-03-28 13:32   ` Nishanth Menon
2023-03-28 13:32     ` Nishanth Menon
2023-03-28 13:51     ` Jai Luthra
2023-03-28 13:51       ` Jai Luthra
2023-03-29  8:04     ` Jai Luthra
2023-03-29  8:04       ` Jai Luthra
2023-03-28 13:29 ` [PATCH v8 4/6] arm64: dts: ti: k3-am62a-main: Add nodes for McASP Jai Luthra
2023-03-28 13:29   ` Jai Luthra
2023-03-28 13:29 ` [PATCH v8 5/6] arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators Jai Luthra
2023-03-28 13:29   ` Jai Luthra
2023-03-28 13:29 ` [PATCH v8 6/6] arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A Jai Luthra
2023-03-28 13:29   ` Jai Luthra

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.