From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Baluta Subject: [PATCH v3 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524 Date: Wed, 15 May 2019 14:42:29 +0000 Message-ID: <20190515144210.25596-3-daniel.baluta@nxp.com> References: <20190515144210.25596-1-daniel.baluta@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20190515144210.25596-1-daniel.baluta@nxp.com> Content-Language: en-US Content-ID: <127BF082BBC1824D9BA7AEC6678EAD49@eurprd04.prod.outlook.com> Sender: linux-kernel-owner@vger.kernel.org To: "shawnguo@kernel.org" Cc: "mark.rutland@arm.com" , "robh+dt@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , Aisheng Dong , Anson Huang , "S.j. Wang" , Peng Fan , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "m.felsch@pengutronix.de" , Daniel Baluta List-Id: devicetree@vger.kernel.org i.MX8MM has one wm8524 audio codec connected with SAI3 digital audio interface. This patch uses simple-card machine driver in order to enable wm8524 codec. We need to set: * SAI3 pinctrl configuration * codec reset gpio pinctrl configuration * clock hierarchy * codec node * simple-card configuration Signed-off-by: Daniel Baluta --- arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 55 ++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mm-evk.dts index 2d5d89475b76..7c578d8762b9 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts @@ -37,6 +37,37 @@ gpio =3D <&gpio2 19 GPIO_ACTIVE_HIGH>; enable-active-high; }; + + wm8524: audio-codec { + #sound-dai-cells =3D <0>; + compatible =3D "wlf,wm8524"; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&pinctrl_gpio_wlf>; + wlf,mute-gpios =3D <&gpio5 21 GPIO_ACTIVE_LOW>; + }; + + sound-wm8524 { + compatible =3D "simple-audio-card"; + simple-audio-card,name =3D "wm8524-audio"; + simple-audio-card,format =3D "i2s"; + simple-audio-card,frame-master =3D <&cpudai>; + simple-audio-card,bitclock-master =3D <&cpudai>; + simple-audio-card,widgets =3D + "Line", "Left Line Out Jack", + "Line", "Right Line Out Jack"; + simple-audio-card,routing =3D + "Left Line Out Jack", "LINEVOUTL", + "Right Line Out Jack", "LINEVOUTR"; + + cpudai: simple-audio-card,cpu { + sound-dai =3D <&sai3>; + }; + + simple-audio-card,codec { + sound-dai =3D <&wm8524>; + clocks =3D <&clk IMX8MM_CLK_SAI3_ROOT>; + }; + }; }; =20 &fec1 { @@ -61,6 +92,15 @@ }; }; =20 +&sai3 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&pinctrl_sai3>; + assigned-clocks =3D <&clk IMX8MM_CLK_SAI3>; + assigned-clock-parents =3D <&clk IMX8MM_AUDIO_PLL1_OUT>; + assigned-clock-rates =3D <24576000>; + status =3D "okay"; +}; + &uart2 { /* console */ pinctrl-names =3D "default"; pinctrl-0 =3D <&pinctrl_uart2>; @@ -124,12 +164,27 @@ >; }; =20 + pinctrl_gpio_wlf: gpiowlfgrp { + fsl,pins =3D < + MX8MM_IOMUXC_I2C4_SDA_GPIO5_IO21 0xd6 + >; + }; + pinctrl_reg_usdhc2_vmmc: regusdhc2vmmc { fsl,pins =3D < MX8MM_IOMUXC_SD2_RESET_B_GPIO2_IO19 0x41 >; }; =20 + pinctrl_sai3: sai3grp { + fsl,pins =3D < + MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6 + MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6 + MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK 0xd6 + MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6 + >; + }; + pinctrl_uart2: uart2grp { fsl,pins =3D < MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX 0x140 --=20 2.17.1