From e9e62b6aaa793810ee55e2df972bfc37313fcc79 Mon Sep 17 00:00:00 2001 From: Lucien Zhao Date: Wed, 24 Jul 2024 09:55:41 +0800 Subject: [PATCH] soc: nxp: imxrt: imxrt118x: Enable lpi2c0102/0304/0506 clock Enable lpi2c0102/0304/0506 clock Signed-off-by: Lucien Zhao --- soc/nxp/imxrt/imxrt118x/soc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/soc/nxp/imxrt/imxrt118x/soc.c b/soc/nxp/imxrt/imxrt118x/soc.c index 2183772694c..d721b834835 100644 --- a/soc/nxp/imxrt/imxrt118x/soc.c +++ b/soc/nxp/imxrt/imxrt118x/soc.c @@ -224,6 +224,24 @@ static ALWAYS_INLINE void clock_init(void) CLOCK_SetRootClock(kCLOCK_Root_Lpi2c0102, &rootCfg); #endif +#if defined(CONFIG_I2C_MCUX_LPI2C) && \ + (DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c3), okay) \ + || DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c4), okay)) + /* Configure LPI2C0304 using SYS_PLL3_DIV2_CLK */ + rootCfg.mux = kCLOCK_LPI2C0304_ClockRoot_MuxSysPll3Div2; + rootCfg.div = 4; + CLOCK_SetRootClock(kCLOCK_Root_Lpi2c0304, &rootCfg); +#endif + +#if defined(CONFIG_I2C_MCUX_LPI2C) && \ + (DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c5), okay) \ + || DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c6), okay)) + /* Configure LPI2C0506 using SYS_PLL3_DIV2_CLK */ + rootCfg.mux = kCLOCK_LPI2C0506_ClockRoot_MuxSysPll3Div2; + rootCfg.div = 4; + CLOCK_SetRootClock(kCLOCK_Root_Lpi2c0506, &rootCfg); +#endif + #if defined(CONFIG_SPI_MCUX_LPSPI) && \ (DT_NODE_HAS_STATUS(DT_NODELABEL(lpspi1), okay) \ || DT_NODE_HAS_STATUS(DT_NODELABEL(lpspi2), okay))