2023-03-30 09:46:55

by Jai Luthra

[permalink] [raw]
Subject: [PATCH v10 0/3] arm64: ti: Enable audio on AM62

This patch series adds support for audio via headphone jack on SK-AM62
(E2+) and SK-AM62-LP 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 <[email protected]>
---

Changes in v10:
- Drop AM62A patches [4-6/6]
- Fix defconfig to match output of savedefconfig, and move it to the end
of the series
- Reword commit messages
- Link to v9: https://lore.kernel.org/r/[email protected]

Below is the range-diff from v9:

1: 05c92990b854 < -: ------------ arm64: defconfig: Enable audio drivers for TI K3 SoCs
2: 962c58a419d5 = 1: 0bbee413da91 arm64: dts: ti: k3-am62-main: Add McASP nodes
3: b0e710c14878 ! 2: f624443bacf1 arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
@@ Metadata
Author: Jai Luthra <[email protected]>

## Commit message ##
- arm64: dts: ti: k3-am625-sk: Enable audio on AM62 SK
+ arm64: dts: ti: Enable audio on SK-AM62(-LP)

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.
+ same between SK-AM62 and SK-AM62-LP [2].

Link: https://www.ti.com/lit/zip/sprr448 [1]
+ Link: https://www.ti.com/lit/zip/sprr471 [2]
Signed-off-by: Jai Luthra <[email protected]>
Reviewed-by: Jayesh Choudhary <[email protected]>

4: 42ebd41e357f < -: ------------ arm64: dts: ti: k3-am62a-main: Add nodes for McASP
5: 3ad21f2419fc < -: ------------ arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators
6: edd909d78e67 < -: ------------ arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A
-: ------------ > 3: 4d3ec922758a arm64: defconfig: Enable audio drivers for SK-AM62

---
Jai Luthra (2):
arm64: dts: ti: Enable audio on SK-AM62(-LP)
arm64: defconfig: Enable audio drivers for SK-AM62

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

arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts | 4 ++
arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 60 ++++++++++++++++++++
arch/arm64/boot/dts/ti/k3-am625-sk.dts | 15 +++++
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 76 ++++++++++++++++++++++++++
arch/arm64/configs/defconfig | 2 +
5 files changed, 157 insertions(+)
---
base-commit: f3910d4b06af57669b77c0afe829deca6d5a3ed2
change-id: 20230313-mcasp_upstream-0e137013059b

Best regards,
--
Jai Luthra <[email protected]>


2023-03-30 09:47:23

by Jai Luthra

[permalink] [raw]
Subject: [PATCH v10 3/3] arm64: defconfig: Enable audio drivers for SK-AM62

TI's K3 platform uses McASP as the digital audio interface on the SoCs.
SK-AM62, SK-AM62-LP and SK-AM62A also use the TLV320AIC3106 codec with a
3.5mm jack for analog audio input and output.

Signed-off-by: Jai Luthra <[email protected]>
Reviewed-by: Devarsh Thakkar <[email protected]>
---
arch/arm64/configs/defconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index ca3569261713..a13119aecaa1 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -877,6 +877,7 @@ CONFIG_SND_SOC_TEGRA210_AMX=m
CONFIG_SND_SOC_TEGRA210_ADX=m
CONFIG_SND_SOC_TEGRA210_MIXER=m
CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD=m
+CONFIG_SND_SOC_DAVINCI_MCASP=m
CONFIG_SND_SOC_AK4613=m
CONFIG_SND_SOC_ES7134=m
CONFIG_SND_SOC_ES7241=m
@@ -891,6 +892,7 @@ CONFIG_SND_SOC_SIMPLE_MUX=m
CONFIG_SND_SOC_TAS2552=m
CONFIG_SND_SOC_TAS571X=m
CONFIG_SND_SOC_TLV320AIC32X4_I2C=m
+CONFIG_SND_SOC_TLV320AIC3X_I2C=m
CONFIG_SND_SOC_WCD9335=m
CONFIG_SND_SOC_WCD934X=m
CONFIG_SND_SOC_WM8524=m

--
2.34.1

2023-03-30 09:47:25

by Jai Luthra

[permalink] [raw]
Subject: [PATCH v10 2/3] arm64: dts: ti: Enable audio on SK-AM62(-LP)

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 [2].

Link: https://www.ti.com/lit/zip/sprr448 [1]
Link: https://www.ti.com/lit/zip/sprr471 [2]
Signed-off-by: Jai Luthra <[email protected]>
Reviewed-by: Jayesh Choudhary <[email protected]>
---
arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts | 4 ++
arch/arm64/boot/dts/ti/k3-am625-sk.dts | 15 +++++
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 76 ++++++++++++++++++++++++++
3 files changed, 95 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..4b94f7a86316 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts
@@ -225,3 +225,7 @@ ldo4_reg: ldo4 {
};
};
};
+
+&tlv320aic3106 {
+ DVDD-supply = <&buck2_reg>;
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
index cdc0858dd1b2..2a1adda9bff6 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 {
@@ -256,3 +267,7 @@ partition@3fc0000 {
};
};
};
+
+&tlv320aic3106 {
+ DVDD-supply = <&vcc_1v8>;
+};
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..e197ea5fa448 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,18 @@ &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>;
+ };
};

&sdhci0 {
@@ -272,3 +328,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.34.1

2023-03-30 22:08:51

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH v10 0/3] arm64: ti: Enable audio on AM62

Hi Jai Luthra,

On Thu, 30 Mar 2023 15:14:04 +0530, Jai Luthra wrote:
> This patch series adds support for audio via headphone jack on SK-AM62
> (E2+) and SK-AM62-LP 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.
>
>
> [...]

I have applied the following to branch ti-k3-dts-next on [1].
Thank you!

[1/3] arm64: dts: ti: k3-am62-main: Add McASP nodes
commit: d4b0379af83b67ef85bf90639cd38eb910dc507d
[2/3] arm64: dts: ti: Enable audio on SK-AM62(-LP)
commit: b94b43715e91646a7023e5837941a514c9e2f934

I have applied the following to branch ti-k3-config-next on [1].
[3/3] arm64: defconfig: Enable audio drivers for SK-AM62
commit: 44b263bf040a8e819da11c45f14a80de8866461a

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D