Skip to content

Commit 585a85a

Browse files
lucien-nxpdanieldegrasse
authored andcommitted
drivers: clock_control: support rt700 getting sai clock
There are multi sai instance shared on clock source on cm33_cpu0, clock driver don't need index parameter, so modify clock driver to adapt clock driver. Signed-off-by: Lucien Zhao <[email protected]>
1 parent 7101c72 commit 585a85a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/clock_control/clock_control_mcux_syscon.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
428428
#endif /* CONFIG_MEMC_MCUX_FLEXSPI */
429429

430430
#if defined(CONFIG_I2S_MCUX_SAI)
431+
#if defined(CONFIG_SOC_SERIES_IMXRT7XX)
432+
case MCUX_SAI0_CLK:
433+
case MCUX_SAI1_CLK:
434+
case MCUX_SAI2_CLK:
435+
*rate = CLOCK_GetSaiClkFreq();
436+
break;
437+
#else
431438
case MCUX_SAI0_CLK:
432439
#if (FSL_FEATURE_SOC_I2S_COUNT == 1)
433440
*rate = CLOCK_GetSaiClkFreq();
@@ -440,6 +447,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
440447
*rate = CLOCK_GetSaiClkFreq(1);
441448
break;
442449
#endif
450+
#endif /* CONFIG_SOC_SERIES_IMXRT7XX */
443451
#endif /* CONFIG_I2S_MCUX_SAI */
444452

445453
#ifdef CONFIG_ETH_NXP_ENET_QOS

include/zephyr/dt-bindings/clock/mcux_lpc_syscon_clock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124

125125
#define MCUX_SAI0_CLK MCUX_LPC_CLK_ID(0x16, 0x00)
126126
#define MCUX_SAI1_CLK MCUX_LPC_CLK_ID(0x16, 0x01)
127+
#define MCUX_SAI2_CLK MCUX_LPC_CLK_ID(0x16, 0x02)
127128

128129
#define MCUX_LPSPI0_CLK MCUX_LPC_CLK_ID(0x17, 0x00)
129130
#define MCUX_LPSPI1_CLK MCUX_LPC_CLK_ID(0x17, 0x01)

0 commit comments

Comments
 (0)