arm64: dts: ti: var-som-am62p: Add support for WM8904 audio codec

The VAR-SOM-AM62P can integrate the WM8904, a high-performance
ultra-low-power stereo codec optimized for portable audio applications.

This patch adds the WM8904 device to the appropriate I2C bus, enables
the McASP1 peripheral, and introduces the sound node to expose the
sound card to the system.

Signed-off-by: Stefano Radaelli <stefano.radaelli21@gmail.com>
Link: https://patch.msgid.link/20251003125031.30539-3-stefano.radaelli21@gmail.com
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
This commit is contained in:
Stefano Radaelli 2025-10-03 14:50:28 +02:00 committed by Vignesh Raghavendra
parent 1d10e0e78c
commit 6f41007cf8

View File

@ -112,6 +112,38 @@ reg_3v3_phy: regulator-3v3-phy {
enable-active-high;
regulator-always-on;
};
sound {
compatible = "simple-audio-card";
simple-audio-card,bitclock-master = <&codec_dai>;
simple-audio-card,format = "dsp_b";
simple-audio-card,frame-master = <&codec_dai>;
simple-audio-card,name = "wm8904-audio";
simple-audio-card,mclk-fs = <256>;
simple-audio-card,routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPOUTR",
"IN2L", "Line In Jack",
"IN2R", "Line In Jack",
"IN1L", "Microphone Jack",
"IN1R", "Microphone Jack";
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Headphone", "Headphone Jack",
"Line", "Line In Jack";
codec_dai: simple-audio-card,codec {
sound-dai = <&wm8904>;
};
simple-audio-card,cpu {
sound-dai = <&mcasp1>;
};
};
};
&audio_refclk1 {
assigned-clock-rates = <100000000>;
};
&cpsw3g {
@ -149,6 +181,19 @@ &main_i2c2 {
pinctrl-0 = <&pinctrl_i2c2>;
clock-frequency = <400000>;
status = "okay";
wm8904: audio-codec@1a {
compatible = "wlf,wm8904";
reg = <0x1a>;
#sound-dai-cells = <0>;
clocks = <&audio_refclk1>;
clock-names = "mclk";
AVDD-supply = <&reg_1v8>;
CPVDD-supply = <&reg_1v8>;
DBVDD-supply = <&reg_3v3>;
DCVDD-supply = <&reg_1v8>;
MICVDD-supply = <&reg_1v8>;
};
};
&main_i2c3 {
@ -179,6 +224,16 @@ AM62PX_IOPAD(0x01d4, PIN_INPUT_PULLUP, 2) /* (C22) UART0_RTSn.I2C3_SDA */
>;
};
pinctrl_mcasp1: main-mcasp1-default-pins {
pinctrl-single,pins = <
AM62PX_IOPAD(0x0090, PIN_INPUT, 2) /* (U24) GPMC0_BE0n_CLE.MCASP1_ACLKX */
AM62PX_IOPAD(0x0098, PIN_INPUT, 2) /* (AA24) GPMC0_WAIT0.MCASP1_AFSX */
AM62PX_IOPAD(0x008c, PIN_OUTPUT, 2) /* (T25) GPMC0_WEn.MCASP1_AXR0 */
AM62PX_IOPAD(0x0084, PIN_INPUT, 2) /* (R25) GPMC0_ADVn_ALE.MCASP1_AXR2 */
AM62PX_IOPAD(0x00a0, PIN_OUTPUT, 1) /* (P24) GPMC0_WPn.AUDIO_EXT_REFCLK1 */
>;
};
pinctrl_mdio1: main-mdio1-default-pins {
pinctrl-single,pins = <
AM62PX_IOPAD(0x0160, PIN_OUTPUT, 0) /* (F17) MDIO0_MDC */
@ -280,6 +335,23 @@ bluetooth {
};
};
&mcasp1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mcasp1>;
op-mode = <0>; /* MCASP_IIS_MODE */
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
1 0 2 0
0 0 0 0
0 0 0 0
0 0 0 0
>;
tdm-slots = <2>;
tx-num-evt = <0>;
rx-num-evt = <0>;
#sound-dai-cells = <0>;
status = "okay";
};
&sdhci0 {
/* On-module eMMC */
ti,driver-strength-ohm = <50>;