Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: dts: ti: k3-am625-phyboard-lyra-rdk: Add Audio Codec

The Audio Codec runs over the MCASP (Multichannel Audio Serial Port).

Add pinmux for the Audio Reference Clock and MCASP2.

Add DT nodes for Audio Codec, MCASP2, VCC 1v8 and VCC 3v3 regulators.

Additionally, create a sound node that connects our sound card and the
MCASP2.

Signed-off-by: Garrett Giordano <ggiordano@phytec.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
Link: https://lore.kernel.org/r/20240404184250.3772829-1-ggiordano@phytec.com
Signed-off-by: Nishanth Menon <nm@ti.com>

authored by

Garrett Giordano and committed by
Nishanth Menon
28c0cf16 b3f62948

+99
+99
arch/arm64/boot/dts/ti/k3-am625-phyboard-lyra-rdk.dts
··· 66 66 }; 67 67 }; 68 68 69 + sound { 70 + compatible = "simple-audio-card"; 71 + simple-audio-card,name = "phyBOARD-Lyra"; 72 + simple-audio-card,widgets = 73 + "Microphone", "Mic Jack", 74 + "Headphone", "Headphone Jack", 75 + "Speaker", "External Speaker"; 76 + simple-audio-card,routing = 77 + "MIC3R", "Mic Jack", 78 + "Mic Jack", "Mic Bias", 79 + "Headphone Jack", "HPLOUT", 80 + "Headphone Jack", "HPROUT", 81 + "External Speaker", "SPOP", 82 + "External Speaker", "SPOM"; 83 + simple-audio-card,format = "dsp_b"; 84 + simple-audio-card,bitclock-master = <&sound_master>; 85 + simple-audio-card,frame-master = <&sound_master>; 86 + simple-audio-card,bitclock-inversion; 87 + 88 + simple-audio-card,cpu { 89 + sound-dai = <&mcasp2>; 90 + }; 91 + 92 + sound_master: simple-audio-card,codec { 93 + sound-dai = <&audio_codec>; 94 + clocks = <&audio_refclk1>; 95 + }; 96 + }; 97 + 69 98 leds { 70 99 compatible = "gpio-leds"; 71 100 pinctrl-names = "default"; ··· 111 82 }; 112 83 }; 113 84 85 + vcc_1v8: regulator-vcc-1v8 { 86 + compatible = "regulator-fixed"; 87 + regulator-name = "VCC_1V8"; 88 + regulator-min-microvolt = <1800000>; 89 + regulator-max-microvolt = <1800000>; 90 + regulator-always-on; 91 + regulator-boot-on; 92 + }; 93 + 114 94 vcc_3v3_mmc: regulator-vcc-3v3-mmc { 115 95 compatible = "regulator-fixed"; 116 96 regulator-name = "VCC_3V3_MMC"; ··· 128 90 regulator-always-on; 129 91 regulator-boot-on; 130 92 }; 93 + 94 + vcc_3v3_sw: regulator-vcc-3v3-sw { 95 + compatible = "regulator-fixed"; 96 + regulator-name = "VCC_3V3_SW"; 97 + regulator-min-microvolt = <3300000>; 98 + regulator-max-microvolt = <3300000>; 99 + regulator-always-on; 100 + regulator-boot-on; 101 + }; 131 102 }; 132 103 133 104 &main_pmx0 { 105 + audio_ext_refclk1_pins_default: audio-ext-refclk1-default-pins { 106 + pinctrl-single,pins = < 107 + AM62X_IOPAD(0x0a0, PIN_OUTPUT, 1) /* (K25) GPMC0_WPn.AUDIO_EXT_REFCLK1 */ 108 + >; 109 + }; 110 + 134 111 gpio_keys_pins_default: gpio-keys-default-pins { 135 112 pinctrl-single,pins = < 136 113 AM62X_IOPAD(0x1d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */ ··· 200 147 pinctrl-single,pins = < 201 148 AM62X_IOPAD(0x1dc, PIN_INPUT, 0) /* (E15) MCAN0_RX */ 202 149 AM62X_IOPAD(0x1d8, PIN_OUTPUT, 0) /* (C15) MCAN0_TX */ 150 + >; 151 + }; 152 + 153 + main_mcasp2_pins_default: main-mcasp2-default-pins { 154 + pinctrl-single,pins = < 155 + AM62X_IOPAD(0x070, PIN_INPUT, 3) /* (T24) GPMC0_AD13.MCASP2_ACLKX */ 156 + AM62X_IOPAD(0x06c, PIN_INPUT, 3) /* (T22) GPMC0_AD12.MCASP2_AFSX */ 157 + AM62X_IOPAD(0x064, PIN_OUTPUT, 3) /* (T25) GPMC0_AD10.MCASP2_AXR2 */ 158 + AM62X_IOPAD(0x068, PIN_INPUT, 3) /* (R21) GPMC0_AD11.MCASP2_AXR3 */ 203 159 >; 204 160 }; 205 161 ··· 316 254 clock-frequency = <100000>; 317 255 status = "okay"; 318 256 257 + audio_codec: audio-codec@18 { 258 + pinctrl-names = "default"; 259 + pinctrl-0 = <&audio_ext_refclk1_pins_default>; 260 + 261 + #sound-dai-cells = <0>; 262 + compatible = "ti,tlv320aic3007"; 263 + reg = <0x18>; 264 + ai3x-micbias-vg = <2>; 265 + 266 + AVDD-supply = <&vcc_3v3_sw>; 267 + IOVDD-supply = <&vcc_3v3_sw>; 268 + DRVDD-supply = <&vcc_3v3_sw>; 269 + DVDD-supply = <&vcc_1v8>; 270 + }; 271 + 319 272 gpio_exp: gpio-expander@21 { 320 273 pinctrl-names = "default"; 321 274 pinctrl-0 = <&gpio_exp_int_pins_default>; ··· 403 326 pinctrl-names = "default"; 404 327 pinctrl-0 = <&main_uart1_pins_default>; 405 328 /* Main UART1 may be used by TIFS firmware */ 329 + status = "okay"; 330 + }; 331 + 332 + &mcasp2 { 333 + #sound-dai-cells = <0>; 334 + 335 + pinctrl-names = "default"; 336 + pinctrl-0 = <&main_mcasp2_pins_default>; 337 + 338 + /* MCASP_IIS_MODE */ 339 + op-mode = <0>; 340 + tdm-slots = <2>; 341 + 342 + /* 0: INACTIVE, 1: TX, 2: RX */ 343 + serial-dir = < 344 + 0 0 1 2 345 + 0 0 0 0 346 + 0 0 0 0 347 + 0 0 0 0 348 + >; 349 + tx-num-evt = <32>; 350 + rx-num-evt = <32>; 406 351 status = "okay"; 407 352 }; 408 353