diff mbox series

[v3,6/6] arm64: dts: imx8mp: Add analog audio output on i.MX8MP EVK

Message ID 20220625013235.710346-6-marex@denx.de (mailing list archive)
State Not Applicable, archived
Headers show
Series [v3,1/6] clk: Introduce devm_clk_hw_register_mux_parent_data() | expand

Commit Message

Marek Vasut June 25, 2022, 1:32 a.m. UTC
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.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Abel Vesa <abel.vesa@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jacky Bai <ping.bai@nxp.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-clk@vger.kernel.org
Cc: linux-imx@nxp.com
---
V2: No change
V3: No change
---
 arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 60 ++++++++++++++++++++
 1 file changed, 60 insertions(+)

Comments

Luca Ceresoli Feb. 22, 2023, 5:22 p.m. UTC | #1
Hello Marek,

On Sat, 25 Jun 2022 03:32:35 +0200
Marek Vasut <marex@denx.de> wrote:

> 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.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Abel Vesa <abel.vesa@nxp.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Jacky Bai <ping.bai@nxp.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-clk@vger.kernel.org
> Cc: linux-imx@nxp.com

I'm sending in reply to this e-mail the device tree patch I have used
for my audio testing on the MSC SM2-MB-EP1 board. Feel free to add it to
your series if you want, it obviously depends on it.
Marek Vasut Feb. 23, 2023, 4:24 p.m. UTC | #2
On 2/22/23 18:22, Luca Ceresoli wrote:
> Hello Marek,

Hi,

> On Sat, 25 Jun 2022 03:32:35 +0200
> Marek Vasut <marex@denx.de> wrote:
> 
>> 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.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Abel Vesa <abel.vesa@nxp.com>
>> Cc: Fabio Estevam <festevam@gmail.com>
>> Cc: Jacky Bai <ping.bai@nxp.com>
>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Cc: Lucas Stach <l.stach@pengutronix.de>
>> Cc: Michael Turquette <mturquette@baylibre.com>
>> Cc: Shawn Guo <shawnguo@kernel.org>
>> Cc: Stephen Boyd <sboyd@kernel.org>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-clk@vger.kernel.org
>> Cc: linux-imx@nxp.com
> 
> I'm sending in reply to this e-mail the device tree patch I have used
> for my audio testing on the MSC SM2-MB-EP1 board. Feel free to add it to
> your series if you want, it obviously depends on it.

Lemme just mark this email locally and start with the MX8MP EVK . If the 
audio patches ever get upstream, then this one can be easily 
resubmitted. Does that work ?
Luca Ceresoli Feb. 24, 2023, 4:16 p.m. UTC | #3
Hi Marek,

On Thu, 23 Feb 2023 17:24:32 +0100
Marek Vasut <marex@denx.de> wrote:

> On 2/22/23 18:22, Luca Ceresoli wrote:
> > Hello Marek,  
> 
> Hi,
> 
> > On Sat, 25 Jun 2022 03:32:35 +0200
> > Marek Vasut <marex@denx.de> wrote:
> >   
> >> 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.
> >>
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >> Cc: Abel Vesa <abel.vesa@nxp.com>
> >> Cc: Fabio Estevam <festevam@gmail.com>
> >> Cc: Jacky Bai <ping.bai@nxp.com>
> >> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >> Cc: Lucas Stach <l.stach@pengutronix.de>
> >> Cc: Michael Turquette <mturquette@baylibre.com>
> >> Cc: Shawn Guo <shawnguo@kernel.org>
> >> Cc: Stephen Boyd <sboyd@kernel.org>
> >> Cc: linux-arm-kernel@lists.infradead.org
> >> Cc: linux-clk@vger.kernel.org
> >> Cc: linux-imx@nxp.com  
> > 
> > I'm sending in reply to this e-mail the device tree patch I have used
> > for my audio testing on the MSC SM2-MB-EP1 board. Feel free to add it to
> > your series if you want, it obviously depends on it.  
> 
> Lemme just mark this email locally and start with the MX8MP EVK . If the 
> audio patches ever get upstream, then this one can be easily 
> resubmitted. Does that work ?

Sure.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
index 2627d25ce7958..99731aaa3bcfb 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
@@ -40,6 +40,16 @@  pcie0_refclk: pcie0-refclk {
 			clock-frequency = <100000000>;
 	};
 
+	reg_audio_pwr: regulator-audio-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "audio-pwr";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	reg_can1_stby: regulator-can1-stby {
 		compatible = "regulator-fixed";
 		regulator-name = "can1-stby";
@@ -83,6 +93,23 @@  reg_usdhc2_vmmc: regulator-usdhc2 {
 		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
+
+	sound-wm8960 {
+		compatible = "fsl,imx-audio-wm8960";
+		model = "wm8960-audio";
+		audio-cpu = <&sai3>;
+		audio-codec = <&codec>;
+		audio-routing =
+			"Headphone Jack", "HP_L",
+			"Headphone Jack", "HP_R",
+			"Ext Spk", "SPK_LP",
+			"Ext Spk", "SPK_LN",
+			"Ext Spk", "SPK_RP",
+			"Ext Spk", "SPK_RN",
+			"LINPUT1", "Mic Jack",
+			"LINPUT3", "Mic Jack",
+			"Mic Jack", "MICB";
+	};
 };
 
 &A53_0 {
@@ -333,6 +360,17 @@  &i2c3 {
 	pinctrl-0 = <&pinctrl_i2c3>;
 	status = "okay";
 
+	codec: wm8960@1a {
+		compatible = "wlf,wm8960";
+		reg = <0x1a>;
+		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>;
@@ -402,6 +440,16 @@  &pcie{
 	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";
 };
@@ -594,6 +642,18 @@  MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19	0x41
 		>;
 	};
 
+	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
+			MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28		0xd6
+			MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29		0xd6
+		>;
+	};
+
 	pinctrl_uart2: uart2grp {
 		fsl,pins = <
 			MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX	0x49