From: Shengjiu Wang Date: Fri, 15 Aug 2025 10:23:15 +0000 (+0800) Subject: arm64: dts: imx8mm-evk: support more sample rates for wm8524 card X-Git-Tag: v6.18-rc1~147^2~20^2~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6aa41c8833c7871d9c94d3f56586a9dca42e94f5;p=thirdparty%2Fkernel%2Flinux.git arm64: dts: imx8mm-evk: support more sample rates for wm8524 card The wm8524 codec is connected to the SAI interface. There are two audio plls on i.MX8MM, one pll can be the clock source of 44kHz series rates, another pll can be clock source of 48kHz series rates. Previously it only supported 48kHz series rates, with this change the supported rates will include 44kHz series rates, from 8kHz to 192kHz. As commit 17cc308b1833 ("ASoC: wm8524: enable constraints when sysclk is configured.") make wm8524 release the constraint when codec's sysclk is not configured, so configure the cpu dai's sysclk to support more rates with the 'clocks' property removed. Add mclk-fs property for the sysclk ratio, which is required by calculating the sysclk, 256 is a common ratio for audio. 'system-clock-direction-out' is a required property after commit 5725bce709db ("ASoC: simple-card-utils: Unify clock direction by clk_direction") to specify the clock direction. Signed-off-by: Shengjiu Wang Reviewed-by: Frank Li Reviewed-by: Peng Fan Signed-off-by: Shawn Guo --- diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi index 622caaa78eaf1..ff7ca20752309 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi @@ -147,6 +147,7 @@ simple-audio-card,format = "i2s"; simple-audio-card,frame-master = <&cpudai>; simple-audio-card,bitclock-master = <&cpudai>; + simple-audio-card,mclk-fs = <256>; simple-audio-card,widgets = "Line", "Left Line Out Jack", "Line", "Right Line Out Jack"; @@ -158,11 +159,11 @@ sound-dai = <&sai3>; dai-tdm-slot-num = <2>; dai-tdm-slot-width = <32>; + system-clock-direction-out; }; simple-audio-card,codec { sound-dai = <&wm8524>; - clocks = <&clk IMX8MM_CLK_SAI3_ROOT>; }; }; @@ -570,9 +571,17 @@ &sai3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai3>; - assigned-clocks = <&clk IMX8MM_CLK_SAI3>; - assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>; - assigned-clock-rates = <24576000>; + assigned-clocks = <&clk IMX8MM_AUDIO_PLL1>, + <&clk IMX8MM_AUDIO_PLL2>, + <&clk IMX8MM_CLK_SAI3>; + assigned-clock-parents = <0>, <0>, <&clk IMX8MM_AUDIO_PLL1_OUT>; + assigned-clock-rates = <393216000>, <361267200>, <24576000>; + fsl,sai-mclk-direction-output; + clocks = <&clk IMX8MM_CLK_SAI3_IPG>, <&clk IMX8MM_CLK_DUMMY>, + <&clk IMX8MM_CLK_SAI3_ROOT>, <&clk IMX8MM_CLK_DUMMY>, + <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>, + <&clk IMX8MM_AUDIO_PLL2_OUT>; + clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k"; status = "okay"; };