2023-08-07 20:45:07

by Francesco Dolcini

[permalink] [raw]
Subject: [PATCH v3 0/4] arm64: dts: ti: Enable Audio on Verdin AM62

From: Francesco Dolcini <[email protected]>

Add AM62x AUDIO_REFCLKx to AM62x SoC dtsi, and after doing it, enable audio
support for Toradex Verdin AM62.

DT bindings updates, related to the audio codec used here, are already merged
in next [2][3].

For correct functionality this fix [1] is also required.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/

v3:
- added Reviewed-by: Jai Luthra <[email protected]>
- removed changes on k3-am62a-main.dtsi that were introducing warnings
v2:
- s/clock/clock-controller/ on audio refclk nodes name.

Francesco Dolcini (3):
arm64: dts: ti: verdin-am62: Set I2S_1 MCLK rate
arm64: dts: ti: verdin-am62: dev: add sound card
arm64: dts: ti: verdin-am62: dahlia: add sound card

Jai Luthra (1):
arm64: dts: ti: k3-am62: Enable AUDIO_REFCLKx

arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 +++++++
.../boot/dts/ti/k3-am62-verdin-dahlia.dtsi | 53 +++++++++++++++++++
.../arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi | 45 ++++++++++++++++
arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 5 ++
4 files changed, 121 insertions(+)

--
2.25.1



2023-08-07 20:45:07

by Francesco Dolcini

[permalink] [raw]
Subject: [PATCH v3 4/4] arm64: dts: ti: verdin-am62: dahlia: add sound card

From: Francesco Dolcini <[email protected]>

Add WM8904 based analog sound card to Dahlia carrier board.

Reviewed-by: Jai Luthra <[email protected]>
Signed-off-by: Francesco Dolcini <[email protected]>
---
.../boot/dts/ti/k3-am62-verdin-dahlia.dtsi | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi
index 33c8f6ffaa30..013357d17d48 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi
@@ -8,6 +8,43 @@
* https://www.toradex.com/products/carrier-board/dahlia-carrier-board-kit
*/

+/ {
+ reg_1v8_sw: regulator-1v8-sw {
+ compatible = "regulator-fixed";
+ regulator-max-microvolt = <1800000>;
+ regulator-min-microvolt = <1800000>;
+ regulator-name = "On-carrier +V1.8_SW";
+ };
+
+ sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,bitclock-master = <&codec_dai>;
+ simple-audio-card,format = "i2s";
+ simple-audio-card,frame-master = <&codec_dai>;
+ simple-audio-card,name = "verdin-wm8904";
+ simple-audio-card,routing =
+ "Headphone Jack", "HPOUTL",
+ "Headphone Jack", "HPOUTR",
+ "IN2L", "Line In Jack",
+ "IN2R", "Line In Jack",
+ "Headphone Jack", "MICBIAS",
+ "IN1L", "Headphone Jack";
+ simple-audio-card,widgets =
+ "Microphone", "Headphone Jack",
+ "Headphone", "Headphone Jack",
+ "Line", "Line In Jack";
+
+ codec_dai: simple-audio-card,codec {
+ clocks = <&audio_refclk1>;
+ sound-dai = <&wm8904_1a>;
+ };
+
+ simple-audio-card,cpu {
+ sound-dai = <&mcasp0>;
+ };
+ };
+};
+
/* Verdin ETHs */
&cpsw3g {
status = "okay";
@@ -46,6 +83,22 @@ &main_gpio0 {
&main_i2c1 {
status = "okay";

+ /* Audio Codec */
+ wm8904_1a: audio-codec@1a {
+ compatible = "wlf,wm8904";
+ reg = <0x1a>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2s1_mclk>;
+ #sound-dai-cells = <0>;
+ clocks = <&audio_refclk1>;
+ clock-names = "mclk";
+ AVDD-supply = <&reg_1v8_sw>;
+ CPVDD-supply = <&reg_1v8_sw>;
+ DBVDD-supply = <&reg_1v8_sw>;
+ DCVDD-supply = <&reg_1v8_sw>;
+ MICVDD-supply = <&reg_1v8_sw>;
+ };
+
/* Current measurement into module VCC */
hwmon@40 {
compatible = "ti,ina219";
--
2.25.1


2023-08-07 20:45:32

by Francesco Dolcini

[permalink] [raw]
Subject: [PATCH v3 1/4] arm64: dts: ti: k3-am62: Enable AUDIO_REFCLKx

From: Jai Luthra <[email protected]>

On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
external peripherals when configured through CTRL_MMR, so add the
clock nodes.

Signed-off-by: Jai Luthra <[email protected]>
Signed-off-by: Francesco Dolcini <[email protected]>
---
v3:
- removed k3-am62a-main.dtsi changes
v2:
- s/clock/clock-controller/ on audio refclk nodes name.
---
arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
index ef90b2bc81eb..5f19ef46d44c 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -60,6 +60,24 @@ epwm_tbclk: clock-controller@4130 {
reg = <0x4130 0x4>;
#clock-cells = <1>;
};
+
+ audio_refclk0: clock-controller@82e0 {
+ compatible = "ti,am62-audio-refclk";
+ reg = <0x82e0 0x4>;
+ clocks = <&k3_clks 157 0>;
+ assigned-clocks = <&k3_clks 157 0>;
+ assigned-clock-parents = <&k3_clks 157 8>;
+ #clock-cells = <0>;
+ };
+
+ audio_refclk1: clock-controller@82e4 {
+ compatible = "ti,am62-audio-refclk";
+ reg = <0x82e4 0x4>;
+ clocks = <&k3_clks 157 10>;
+ assigned-clocks = <&k3_clks 157 10>;
+ assigned-clock-parents = <&k3_clks 157 18>;
+ #clock-cells = <0>;
+ };
};

dmss: bus@48000000 {
--
2.25.1


2023-08-07 20:45:34

by Francesco Dolcini

[permalink] [raw]
Subject: [PATCH v3 2/4] arm64: dts: ti: verdin-am62: Set I2S_1 MCLK rate

From: Francesco Dolcini <[email protected]>

Set AUDIO_EXT_REFCLK1, used as I2S_1_MCLK on Verdin AM62 family, to 25MHz
(this is the only valid option according to TI [1]).

[1] https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1188051/am625-audio_ext_refclk1-clock-output---dts-support/4476322#4476322

Reviewed-by: Jai Luthra <[email protected]>
Signed-off-by: Francesco Dolcini <[email protected]>
---
arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
index 12dd1d64eac9..5db9ef2dc7e5 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
@@ -768,6 +768,11 @@ AM62X_MCU_IOPAD(0x0028, PIN_OUTPUT, 0) /* (C5) WKUP_UART0_TXD */ /* SODIM
};
};

+/* VERDIN I2S_1_MCLK */
+&audio_refclk1 {
+ assigned-clock-rates = <25000000>;
+};
+
&cpsw3g {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_rgmii1>;
--
2.25.1


2023-08-07 20:59:29

by Francesco Dolcini

[permalink] [raw]
Subject: [PATCH v3 3/4] arm64: dts: ti: verdin-am62: dev: add sound card

From: Francesco Dolcini <[email protected]>

Add NAU8822 based analog sound card to Development carrier board.

Reviewed-by: Jai Luthra <[email protected]>
Signed-off-by: Francesco Dolcini <[email protected]>
---
.../arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi
index 8205081fda33..6701cb8974bb 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-verdin-dev.dtsi
@@ -8,6 +8,42 @@
* https://www.toradex.com/products/carrier-board/verdin-development-board-kit
*/

+/ {
+ sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,bitclock-master = <&codec_dai>;
+ simple-audio-card,format = "i2s";
+ simple-audio-card,frame-master = <&codec_dai>;
+ simple-audio-card,name = "verdin-nau8822";
+ simple-audio-card,routing =
+ "Headphones", "LHP",
+ "Headphones", "RHP",
+ "Speaker", "LSPK",
+ "Speaker", "RSPK",
+ "Line Out", "AUXOUT1",
+ "Line Out", "AUXOUT2",
+ "LAUX", "Line In",
+ "RAUX", "Line In",
+ "LMICP", "Mic In",
+ "RMICP", "Mic In";
+ simple-audio-card,widgets =
+ "Headphones", "Headphones",
+ "Line Out", "Line Out",
+ "Speaker", "Speaker",
+ "Microphone", "Mic In",
+ "Line", "Line In";
+
+ codec_dai: simple-audio-card,codec {
+ clocks = <&audio_refclk1>;
+ sound-dai = <&nau8822_1a>;
+ };
+
+ simple-audio-card,cpu {
+ sound-dai = <&mcasp0>;
+ };
+ };
+};
+
/* Verdin ETHs */
&cpsw3g {
pinctrl-names = "default";
@@ -65,6 +101,15 @@ &main_gpio0 {
&main_i2c1 {
status = "okay";

+ /* Audio Codec */
+ nau8822_1a: audio-codec@1a {
+ compatible = "nuvoton,nau8822";
+ reg = <0x1a>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2s1_mclk>;
+ #sound-dai-cells = <0>;
+ };
+
/* IO Expander */
gpio_expander_21: gpio@21 {
compatible = "nxp,pcal6416";
--
2.25.1


2023-08-08 18:44:12

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH v3 0/4] arm64: dts: ti: Enable Audio on Verdin AM62

Hi Francesco Dolcini,

On Mon, 07 Aug 2023 22:21:55 +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <[email protected]>
>
> Add AM62x AUDIO_REFCLKx to AM62x SoC dtsi, and after doing it, enable audio
> support for Toradex Verdin AM62.
>
> DT bindings updates, related to the audio codec used here, are already merged
> in next [2][3].
>
> [...]

Note: wlf,wm8904 converted to yaml and #sound-dai-cells fixup are
present in linux-next next-20230808 tag, and the dtbs_checks is clean
there. while the syscon cleanups need to take place, the expectation
is that the changes for syscon should keep this node and driver
functional. if anything changes, please let me know and we can take
appropriate measures.

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

[1/4] arm64: dts: ti: k3-am62: Enable AUDIO_REFCLKx
commit: 6111ac92f93415eaa680e7ef43ee4fa78b1eb7f2
[2/4] arm64: dts: ti: verdin-am62: Set I2S_1 MCLK rate
commit: 0bf6d62cb5173d85113f4f759cad3191845e15fa
[3/4] arm64: dts: ti: verdin-am62: dev: add sound card
commit: c90658201cbeb7aae072ab3da4e255f47d9e25b3
[4/4] arm64: dts: ti: verdin-am62: dahlia: add sound card
commit: f5bf894c865b26ea8ec43186e87bb08d092b6fa1

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] https://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