linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates
@ 2025-08-15 10:23 Shengjiu Wang
  2025-08-15 10:23 ` [PATCH v3 1/3] arm64: dts: imx8mm-evk: support more sample rates for wm8524 card Shengjiu Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Shengjiu Wang @ 2025-08-15 10:23 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	devicetree, imx, linux-arm-kernel, linux-kernel, shengjiu.wang

The wm8524 codec is connected to the SAI interface. There are two audio
plls on i.MX8MQ, i.MX8MM, i.MX8MN, 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.

changes in v3:
- Minor change in commit message for comments from Frank Li

changes in v2:
- Add more comments in commit message.

Shengjiu Wang (3):
  arm64: dts: imx8mm-evk: support more sample rates for wm8524 card
  arm64: dts: imx8mq-evk: support more sample rates for wm8524 card
  arm64: dts: imx8mn-evk: support more sample rates for wm8524 card

 arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 17 +++++++++++++----
 arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi |  5 +++++
 arch/arm64/boot/dts/freescale/imx8mq-evk.dts  |  8 +++++++-
 3 files changed, 25 insertions(+), 5 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/3] arm64: dts: imx8mm-evk: support more sample rates for wm8524 card
  2025-08-15 10:23 [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Shengjiu Wang
@ 2025-08-15 10:23 ` Shengjiu Wang
  2025-08-15 10:23 ` [PATCH v3 2/3] arm64: dts: imx8mq-evk: " Shengjiu Wang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2025-08-15 10:23 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	devicetree, imx, linux-arm-kernel, linux-kernel, shengjiu.wang

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 <shengjiu.wang@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
index 622caaa78eaf..ff7ca2075230 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
@@ -147,6 +147,7 @@ sound-wm8524 {
 		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 @@ cpudai: simple-audio-card,cpu {
 			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 @@ &sai2 {
 &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";
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 2/3] arm64: dts: imx8mq-evk: support more sample rates for wm8524 card
  2025-08-15 10:23 [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Shengjiu Wang
  2025-08-15 10:23 ` [PATCH v3 1/3] arm64: dts: imx8mm-evk: support more sample rates for wm8524 card Shengjiu Wang
@ 2025-08-15 10:23 ` Shengjiu Wang
  2025-08-15 10:23 ` [PATCH v3 3/3] arm64: dts: imx8mn-evk: " Shengjiu Wang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2025-08-15 10:23 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	devicetree, imx, linux-arm-kernel, linux-kernel, shengjiu.wang

The wm8524 codec is connected to the SAI interface. There are two audio
plls on i.MX8MQ, 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 <shengjiu.wang@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
index 43e45b0bd0d1..a88bc9034663 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
@@ -108,6 +108,7 @@ sound-wm8524 {
 		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";
@@ -117,11 +118,11 @@ sound-wm8524 {
 
 		cpudai: simple-audio-card,cpu {
 			sound-dai = <&sai2>;
+			system-clock-direction-out;
 		};
 
 		link_codec: simple-audio-card,codec {
 			sound-dai = <&wm8524>;
-			clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
 		};
 	};
 
@@ -440,6 +441,11 @@ &sai2 {
 	assigned-clocks = <&clk IMX8MQ_AUDIO_PLL1_BYPASS>, <&clk IMX8MQ_CLK_SAI2>;
 	assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1>, <&clk IMX8MQ_AUDIO_PLL1_OUT>;
 	assigned-clock-rates = <0>, <24576000>;
+	clocks = <&clk IMX8MQ_CLK_SAI2_IPG>, <&clk IMX8MQ_CLK_DUMMY>,
+		<&clk IMX8MQ_CLK_SAI2_ROOT>, <&clk IMX8MQ_CLK_DUMMY>,
+		<&clk IMX8MQ_CLK_DUMMY>, <&clk IMX8MQ_AUDIO_PLL1_OUT>,
+		<&clk IMX8MQ_AUDIO_PLL2_OUT>;
+	clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
 	status = "okay";
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 3/3] arm64: dts: imx8mn-evk: support more sample rates for wm8524 card
  2025-08-15 10:23 [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Shengjiu Wang
  2025-08-15 10:23 ` [PATCH v3 1/3] arm64: dts: imx8mm-evk: support more sample rates for wm8524 card Shengjiu Wang
  2025-08-15 10:23 ` [PATCH v3 2/3] arm64: dts: imx8mq-evk: " Shengjiu Wang
@ 2025-08-15 10:23 ` Shengjiu Wang
  2025-08-20  2:45 ` [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Peng Fan
  2025-08-22  2:50 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2025-08-15 10:23 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	devicetree, imx, linux-arm-kernel, linux-kernel, shengjiu.wang

The wm8524 codec is connected to the SAI interface. There are two audio
plls on i.MX8MN, 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.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
index 33d73f3dc187..145355ff91b4 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
@@ -387,6 +387,11 @@ &sai3 {
 	assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>;
 	assigned-clock-rates = <24576000>;
 	fsl,sai-mclk-direction-output;
+	clocks = <&clk IMX8MN_CLK_SAI3_IPG>, <&clk IMX8MN_CLK_DUMMY>,
+		<&clk IMX8MN_CLK_SAI3_ROOT>, <&clk IMX8MN_CLK_DUMMY>,
+		<&clk IMX8MN_CLK_DUMMY>, <&clk IMX8MN_AUDIO_PLL1_OUT>,
+		<&clk IMX8MN_AUDIO_PLL2_OUT>;
+	clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
 	status = "okay";
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates
  2025-08-15 10:23 [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Shengjiu Wang
                   ` (2 preceding siblings ...)
  2025-08-15 10:23 ` [PATCH v3 3/3] arm64: dts: imx8mn-evk: " Shengjiu Wang
@ 2025-08-20  2:45 ` Peng Fan
  2025-08-22  2:50 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Peng Fan @ 2025-08-20  2:45 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	devicetree, imx, linux-arm-kernel, linux-kernel, shengjiu.wang

On Fri, Aug 15, 2025 at 06:23:14PM +0800, Shengjiu Wang wrote:
>The wm8524 codec is connected to the SAI interface. There are two audio
>plls on i.MX8MQ, i.MX8MM, i.MX8MN, 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.
>
>changes in v3:
>- Minor change in commit message for comments from Frank Li
>
>changes in v2:
>- Add more comments in commit message.
>
>Shengjiu Wang (3):
>  arm64: dts: imx8mm-evk: support more sample rates for wm8524 card
>  arm64: dts: imx8mq-evk: support more sample rates for wm8524 card
>  arm64: dts: imx8mn-evk: support more sample rates for wm8524 card
>
> arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 17 +++++++++++++----
> arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi |  5 +++++
> arch/arm64/boot/dts/freescale/imx8mq-evk.dts  |  8 +++++++-
> 3 files changed, 25 insertions(+), 5 deletions(-)

Reviewed-by: Peng Fan <peng.fan@nxp.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates
  2025-08-15 10:23 [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Shengjiu Wang
                   ` (3 preceding siblings ...)
  2025-08-20  2:45 ` [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Peng Fan
@ 2025-08-22  2:50 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2025-08-22  2:50 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	devicetree, imx, linux-arm-kernel, linux-kernel, shengjiu.wang

On Fri, Aug 15, 2025 at 06:23:14PM +0800, Shengjiu Wang wrote:
> Shengjiu Wang (3):
>   arm64: dts: imx8mm-evk: support more sample rates for wm8524 card
>   arm64: dts: imx8mq-evk: support more sample rates for wm8524 card
>   arm64: dts: imx8mn-evk: support more sample rates for wm8524 card

Applied all, thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-22  2:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 10:23 [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Shengjiu Wang
2025-08-15 10:23 ` [PATCH v3 1/3] arm64: dts: imx8mm-evk: support more sample rates for wm8524 card Shengjiu Wang
2025-08-15 10:23 ` [PATCH v3 2/3] arm64: dts: imx8mq-evk: " Shengjiu Wang
2025-08-15 10:23 ` [PATCH v3 3/3] arm64: dts: imx8mn-evk: " Shengjiu Wang
2025-08-20  2:45 ` [PATCH v3 0/3] arm64: dts: imx8m: support more sample rates Peng Fan
2025-08-22  2:50 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).