Skip to content

Commit 9609aaf

Browse files
soc: added nxp rw soc i2s clock init
I2S clock init was missing from the NXP RW soc file. I2S clock init was added to all five flexcomm interfaces. Signed-off-by: Joey Freeland <joey.freeland@dojofive.com>
1 parent 273d601 commit 9609aaf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

soc/nxp/rw/soc.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,28 @@ __weak __ramfunc void clock_init(void)
190190
CLOCK_AttachClk(kXTAL32K_to_CLK32K);
191191
#endif
192192

193+
/* Any flexcomm can be I2S */
194+
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm0), nxp_lpc_i2s, okay)) && CONFIG_I2S
195+
CLOCK_SetFRGClock(&(const clock_frg_clk_config_t){0, kCLOCK_FrgPllDiv, 255, 0});
196+
CLOCK_AttachClk(kFRG_to_FLEXCOMM0);
197+
#endif
198+
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm1), nxp_lpc_i2s, okay)) && CONFIG_I2S
199+
CLOCK_SetFRGClock(&(const clock_frg_clk_config_t){1, kCLOCK_FrgPllDiv, 255, 0});
200+
CLOCK_AttachClk(kFRG_to_FLEXCOMM1);
201+
#endif
202+
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm2), nxp_lpc_i2s, okay)) && CONFIG_I2S
203+
CLOCK_SetFRGClock(&(const clock_frg_clk_config_t){2, kCLOCK_FrgPllDiv, 255, 0});
204+
CLOCK_AttachClk(kFRG_to_FLEXCOMM2);
205+
#endif
206+
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm3), nxp_lpc_i2s, okay)) && CONFIG_I2S
207+
CLOCK_SetFRGClock(&(const clock_frg_clk_config_t){3, kCLOCK_FrgPllDiv, 255, 0});
208+
CLOCK_AttachClk(kFRG_to_FLEXCOMM3);
209+
#endif
210+
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm14), nxp_lpc_i2s, okay)) && CONFIG_I2S
211+
CLOCK_SetFRGClock(&(const clock_frg_clk_config_t){14, kCLOCK_FrgPllDiv, 255, 0});
212+
CLOCK_AttachClk(kFRG_to_FLEXCOMM14);
213+
#endif
214+
193215
/* Clock flexcomms when used as SPI */
194216
#ifdef CONFIG_SPI
195217
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm0), nxp_lpc_spi, okay))

0 commit comments

Comments
 (0)