drivers: syscon: update syscon driver to add lpi2c clock

Add lpi2c clock support

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
This commit is contained in:
Neil Chen 2024-12-04 16:35:25 +08:00 committed by Benjamin Cabé
parent 2c271cbfbd
commit 89c9dc7f59
2 changed files with 20 additions and 0 deletions

View file

@ -428,6 +428,21 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
*rate = CLOCK_GetLpuartClkFreq(4);
break;
#endif /* defined(CONFIG_UART_MCUX_LPUART) */
#if (defined(CONFIG_I2C_MCUX_LPI2C) && CONFIG_SOC_SERIES_MCXA)
case MCUX_LPI2C0_CLK:
*rate = CLOCK_GetLpi2cClkFreq(0);
break;
case MCUX_LPI2C1_CLK:
*rate = CLOCK_GetLpi2cClkFreq(1);
break;
case MCUX_LPI2C2_CLK:
*rate = CLOCK_GetLpi2cClkFreq(2);
break;
case MCUX_LPI2C3_CLK:
*rate = CLOCK_GetLpi2cClkFreq(3);
break;
#endif /* defined(CONFIG_I2C_MCUX_LPI2C) */
}
return 0;

View file

@ -98,4 +98,9 @@
#define MCUX_LPUART3_CLK MCUX_LPC_CLK_ID(0x13, 0x03)
#define MCUX_LPUART4_CLK MCUX_LPC_CLK_ID(0x13, 0x04)
#define MCUX_LPI2C0_CLK MCUX_LPC_CLK_ID(0x14, 0x00)
#define MCUX_LPI2C1_CLK MCUX_LPC_CLK_ID(0x14, 0x01)
#define MCUX_LPI2C2_CLK MCUX_LPC_CLK_ID(0x14, 0x02)
#define MCUX_LPI2C3_CLK MCUX_LPC_CLK_ID(0x14, 0x03)
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_MCUX_LPC_SYSCON_H_ */