linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output
@ 2022-04-27  8:50 Jai Luthra
  2022-04-27  8:50 ` [PATCH v3 1/2] arm64: dts: ti: k3-am62-main: Add McASP nodes Jai Luthra
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jai Luthra @ 2022-04-27  8:50 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Rob Herring, Krzysztof Kozlowski
  Cc: linux-kernel, linux-arm-kernel, devicetree, Jayesh Choudhary, Jai Luthra

This patch series adds support for audio output via headphone jack on the 
AM62-SK board. The jack is wired to TLV320AIC3106 (codec), which is 
connected to McASP (serializer).

The same 3.5mm jack can be used for combined playback+recording, but audio 
input is currently disabled on McASP until further testing and debugging.

For testing, please apply this series on top of 
https://lore.kernel.org/all/20220427072954.8821-1-vigneshr@ti.com/ and
https://lore.kernel.org/alsa-devel/20220422054001.3738-1-j-luthra@ti.com/

v3:
Fix regulator, clock and codec node names

v2:
Move out the patch for sound/soc/ti/davinici-mcasp.c into a separate series

v2: https://lore.kernel.org/all/20220422060052.8548-1-j-luthra@ti.com/
v1: https://lore.kernel.org/all/20220421132224.8601-1-j-luthra@ti.com/

Jai Luthra (1):
  arm64: dts: ti: am625-sk: Add audio output support

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

 arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 51 ++++++++++++++
 arch/arm64/boot/dts/ti/k3-am625-sk.dts   | 89 ++++++++++++++++++++++++
 2 files changed, 140 insertions(+)

-- 
2.17.1


_______________________________________________
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] 5+ messages in thread

* [PATCH v3 1/2] arm64: dts: ti: k3-am62-main: Add McASP nodes
  2022-04-27  8:50 [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output Jai Luthra
@ 2022-04-27  8:50 ` Jai Luthra
  2022-06-18  1:16   ` Nishanth Menon
  2022-04-27  8:50 ` [PATCH v3 2/2] arm64: dts: ti: am625-sk: Add audio output support Jai Luthra
  2022-05-05  6:09 ` [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output Devarsh Thakkar
  2 siblings, 1 reply; 5+ messages in thread
From: Jai Luthra @ 2022-04-27  8:50 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Rob Herring, Krzysztof Kozlowski
  Cc: linux-kernel, linux-arm-kernel, devicetree, Jayesh Choudhary, Jai Luthra

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

Add the nodes for McASP 0-2.

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

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
index eec8dae65e7c..942e00f34bfa 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -530,4 +530,55 @@
 		ti,mbox-num-users = <4>;
 		ti,mbox-num-fifos = <16>;
 	};
+
+	mcasp0: mcasp@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";
+		power-domains = <&k3_pds 190 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	mcasp1: mcasp@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";
+		power-domains = <&k3_pds 191 TI_SCI_PD_EXCLUSIVE>;
+	};
+
+	mcasp2: mcasp@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";
+		power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>;
+	};
 };
-- 
2.17.1


_______________________________________________
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] 5+ messages in thread

* [PATCH v3 2/2] arm64: dts: ti: am625-sk: Add audio output support
  2022-04-27  8:50 [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output Jai Luthra
  2022-04-27  8:50 ` [PATCH v3 1/2] arm64: dts: ti: k3-am62-main: Add McASP nodes Jai Luthra
@ 2022-04-27  8:50 ` Jai Luthra
  2022-05-05  6:09 ` [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output Devarsh Thakkar
  2 siblings, 0 replies; 5+ messages in thread
From: Jai Luthra @ 2022-04-27  8:50 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Rob Herring, Krzysztof Kozlowski
  Cc: linux-kernel, linux-arm-kernel, devicetree, Jayesh Choudhary, Jai Luthra

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

Audio input is currently not working properly, so the RX port on McASP1
is disabled for now, until the issue is debugged.

The serializer is shared between HDMI and codec. By default codec is
used for output, but it can be toggled to HDMI using a FET switch
connected to the MCASP1_FET_SEL (J24) header on the board.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am625-sk.dts | 89 ++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
index 5c38ee5ff9b2..d082099b4efb 100644
--- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
@@ -121,6 +121,46 @@
 			 <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;
+	};
+
+	tlv320_mclk: clk-0 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		clock-frequency = <12288000>;
+	};
+
+	sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "AM62x-SKEVM";
+		simple-audio-card,widgets =
+			"Headphone", "Headphone Jack";
+		simple-audio-card,routing =
+			"Headphone Jack",	"HPLOUT",
+			"Headphone Jack",	"HPROUT";
+		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>;
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
@@ -266,6 +306,15 @@
 			AM62X_IOPAD(0x01d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */
 		>;
 	};
+
+	main_mcasp1_pins_default: main-mcasp1-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x0090, PIN_INPUT, 2) /* (M24) GPMC0_BE0N_CLE.MCASP1_ACLKX */
+			AM62X_IOPAD(0x0098, PIN_INPUT, 2) /* (U23) GPMC0_WAIT0.MCASP1_AFSX */
+			AM62X_IOPAD(0x008c, PIN_OUTPUT, 2) /* (L25) GPMC0_WEN.MCASP1_AXR0 */
+			AM62X_IOPAD(0x0084, PIN_INPUT, 2) /* (L23) GPMC0_ADVN_ALE.MCASP1_AXR2 */
+		>;
+	};
 };
 
 &wkup_uart0 {
@@ -352,6 +401,18 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&main_gpio1_ioexp_intr_pins_default>;
 	};
+
+	tlv320aic3106: audio-codec@1b {
+		#sound-dai-cells = <0>;
+		compatible = "ti,tlv320aic3106";
+		reg = <0x1b>;
+
+		/* Regulators */
+		AVDD-supply = <&vcc_3v3_sys>;
+		IOVDD-supply = <&vcc_3v3_sys>;
+		DRVDD-supply = <&vcc_3v3_sys>;
+		DVDD-supply = <&vcc_1v8>;
+	};
 };
 
 &main_i2c2 {
@@ -412,6 +473,34 @@
 	};
 };
 
+&mcasp0 {
+	status = "disabled";
+};
+
+&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 0 0
+	       0 0 0 0
+	       0 0 0 0
+	       0 0 0 0
+	>;
+	tx-num-evt = <32>;
+	rx-num-evt = <32>;
+};
+
+&mcasp2 {
+	status = "disabled";
+};
+
 &mailbox0_cluster0 {
 	mbox_m4_0: mbox-m4-0 {
 		ti,mbox-rx = <0 0 0>;
-- 
2.17.1


_______________________________________________
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] 5+ messages in thread

* Re: [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output
  2022-04-27  8:50 [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output Jai Luthra
  2022-04-27  8:50 ` [PATCH v3 1/2] arm64: dts: ti: k3-am62-main: Add McASP nodes Jai Luthra
  2022-04-27  8:50 ` [PATCH v3 2/2] arm64: dts: ti: am625-sk: Add audio output support Jai Luthra
@ 2022-05-05  6:09 ` Devarsh Thakkar
  2 siblings, 0 replies; 5+ messages in thread
From: Devarsh Thakkar @ 2022-05-05  6:09 UTC (permalink / raw)
  To: Jai Luthra, Nishanth Menon, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-kernel, linux-arm-kernel, devicetree, Jayesh Choudhary

On 27/04/22 14:20, Jai Luthra wrote:
> This patch series adds support for audio output via headphone jack on the 
> AM62-SK board. The jack is wired to TLV320AIC3106 (codec), which is 
> connected to McASP (serializer).
>
> The same 3.5mm jack can be used for combined playback+recording, but audio 
> input is currently disabled on McASP until further testing and debugging.
>
> For testing, please apply this series on top of 
> https://lore.kernel.org/all/20220427072954.8821-1-vigneshr@ti.com/ and
> https://lore.kernel.org/alsa-devel/20220422054001.3738-1-j-luthra@ti.com/
>
> v3:
> Fix regulator, clock and codec node names

The series looks good to me.

Reviewed-by: Devarsh Thakkar <devarsht@ti.com>

>
> v2:
> Move out the patch for sound/soc/ti/davinici-mcasp.c into a separate series
>
> v2: https://lore.kernel.org/all/20220422060052.8548-1-j-luthra@ti.com/
> v1: https://lore.kernel.org/all/20220421132224.8601-1-j-luthra@ti.com/
>
> Jai Luthra (1):
>   arm64: dts: ti: am625-sk: Add audio output support
>
> Jayesh Choudhary (1):
>   arm64: dts: ti: k3-am62-main: Add McASP nodes
>
>  arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 51 ++++++++++++++
>  arch/arm64/boot/dts/ti/k3-am625-sk.dts   | 89 ++++++++++++++++++++++++
>  2 files changed, 140 insertions(+)
>

_______________________________________________
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] 5+ messages in thread

* Re: [PATCH v3 1/2] arm64: dts: ti: k3-am62-main: Add McASP nodes
  2022-04-27  8:50 ` [PATCH v3 1/2] arm64: dts: ti: k3-am62-main: Add McASP nodes Jai Luthra
@ 2022-06-18  1:16   ` Nishanth Menon
  0 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2022-06-18  1:16 UTC (permalink / raw)
  To: Jai Luthra
  Cc: Vignesh Raghavendra, Rob Herring, Krzysztof Kozlowski,
	linux-kernel, linux-arm-kernel, devicetree, Jayesh Choudhary

On 14:20-20220427, Jai Luthra wrote:
> From: Jayesh Choudhary <j-choudhary@ti.com>
> 
> Add the nodes for McASP 0-2.
> 
> Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
> Signed-off-by: Jai Luthra <j-luthra@ti.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 51 ++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> index eec8dae65e7c..942e00f34bfa 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> @@ -530,4 +530,55 @@
>  		ti,mbox-num-users = <4>;
>  		ti,mbox-num-fifos = <16>;
>  	};
> +
> +	mcasp0: mcasp@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";


McASP functional clock defaults to a non-audio friendly 100MHz
main_2_hsdivout8_clk clock source. Instead, switch to using a 96MHz
main_1_hsdivout6_clk.

Please add:
assigned-clocks = <&k3_clks 190 0>;
assigned-clock-parents = <&k3_clks 190 2>;


> +		power-domains = <&k3_pds 190 TI_SCI_PD_EXCLUSIVE>;
> +	};
> +
> +	mcasp1: mcasp@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>;
> +	};
> +
> +	mcasp2: mcasp@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>;
> +	};
>  };
> -- 
> 2.17.1
> 

-- 
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] 5+ messages in thread

end of thread, other threads:[~2022-06-18  1:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27  8:50 [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output Jai Luthra
2022-04-27  8:50 ` [PATCH v3 1/2] arm64: dts: ti: k3-am62-main: Add McASP nodes Jai Luthra
2022-06-18  1:16   ` Nishanth Menon
2022-04-27  8:50 ` [PATCH v3 2/2] arm64: dts: ti: am625-sk: Add audio output support Jai Luthra
2022-05-05  6:09 ` [PATCH v3 0/2] arm64: ti: k3-am62: Enable audio output Devarsh Thakkar

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).