]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: dts: imx8mp: Add analog audio output on i.MX8MP EVK
authorMarek Vasut <marex@denx.de>
Mon, 8 May 2023 11:42:36 +0000 (13:42 +0200)
committerShawn Guo <shawnguo@kernel.org>
Mon, 15 May 2023 01:41:01 +0000 (09:41 +0800)
Enable SAI3 on i.MX8MP EVK, add WM8960 codec binding and regulator.
This is all that is needed to get analog audio output operational
on i.MX8MP EVK.

Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mp-evk.dts

index 7816853162b3fa3388d1b93b2a2ad3b41d146243..fa37ce89f8d3d76da32017bd5b6d55a0ab279b57 100644 (file)
                clock-frequency = <100000000>;
        };
 
+       reg_audio_pwr: regulator-audio-pwr {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_audio_pwr_reg>;
+               regulator-name = "audio-pwr";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
        reg_can1_stby: regulator-can1-stby {
                compatible = "regulator-fixed";
                regulator-name = "can1-stby";
                gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
                enable-active-high;
        };
+
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "wm8960-audio";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,frame-master = <&cpudai>;
+               simple-audio-card,bitclock-master = <&cpudai>;
+               simple-audio-card,widgets =
+                       "Headphone", "Headphone Jack",
+                       "Speaker", "External Speaker",
+                       "Microphone", "Mic Jack";
+               simple-audio-card,routing =
+                       "Headphone Jack", "HP_L",
+                       "Headphone Jack", "HP_R",
+                       "External Speaker", "SPK_LP",
+                       "External Speaker", "SPK_LN",
+                       "External Speaker", "SPK_RP",
+                       "External Speaker", "SPK_RN",
+                       "LINPUT1", "Mic Jack",
+                       "LINPUT3", "Mic Jack",
+                       "Mic Jack", "MICB";
+
+               cpudai: simple-audio-card,cpu {
+                       sound-dai = <&sai3>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&wm8960>;
+               };
+
+       };
 };
 
 &flexspi {
        pinctrl-0 = <&pinctrl_i2c3>;
        status = "okay";
 
+       wm8960: codec@1a {
+               compatible = "wlf,wm8960";
+               reg = <0x1a>;
+               #sound-dai-cells = <0>;
+               clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>;
+               clock-names = "mclk";
+               wlf,shared-lrclk;
+               wlf,hp-cfg = <3 2 3>;
+               wlf,gpio-cfg = <1 3>;
+               SPKVDD1-supply = <&reg_audio_pwr>;
+       };
+
        pca6416: gpio@20 {
                compatible = "ti,tca6416";
                reg = <0x20>;
        status = "okay";
 };
 
+&sai3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai3>;
+       assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
+       assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <12288000>;
+       fsl,sai-mclk-direction-output;
+       status = "okay";
+};
+
 &snvs_pwrkey {
        status = "okay";
 };
 };
 
 &iomuxc {
+       pinctrl_audio_pwr_reg: audiopwrreggrp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29               0xd6
+               >;
+       };
+
        pinctrl_eqos: eqosgrp {
                fsl,pins = <
                        MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC                             0x2
                >;
        };
 
+       pinctrl_sai3: sai3grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC   0xd6
+                       MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK    0xd6
+                       MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00  0xd6
+                       MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00  0xd6
+                       MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK      0xd6
+               >;
+       };
+
        pinctrl_uart2: uart2grp {
                fsl,pins = <
                        MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX    0x140