drivers: clock_control_mcux_syscon: Add MRT subsys

Add code to handle MRT subsys clock to LPC syscon driver

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
Declan Snyder 2023-11-03 10:30:14 -05:00 committed by Carles Cufí
parent 0b5e48985d
commit c83037cece
2 changed files with 15 additions and 3 deletions

View file

@ -19,12 +19,19 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
clock_control_subsys_t sub_system)
{
#if defined(CONFIG_CAN_MCUX_MCAN)
uint32_t clock_name = (uint32_t)sub_system;
if (clock_name == MCUX_MCAN_CLK) {
if ((uint32_t)sub_system == MCUX_MCAN_CLK) {
CLOCK_EnableClock(kCLOCK_Mcan);
}
#endif /* defined(CONFIG_CAN_MCUX_MCAN) */
#if defined(CONFIG_COUNTER_NXP_MRT)
if ((uint32_t)sub_system == MCUX_MRT_CLK) {
#if defined(CONFIG_SOC_FAMILY_LPC)
CLOCK_EnableClock(kCLOCK_Mrt);
#elif defined(CONFIG_SOC_FAMILY_IMX)
CLOCK_EnableClock(kCLOCK_Mrt0);
#endif
}
#endif /* defined(CONFIG_COUNTER_NXP_MRT) */
return 0;
}
@ -145,6 +152,9 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(
break;
#endif
#if defined(CONFIG_COUNTER_NXP_MRT)
case MCUX_MRT_CLK:
#endif
#if defined(CONFIG_PWM_MCUX_SCTIMER)
case MCUX_SCTIMER_CLK:
#endif

View file

@ -51,4 +51,6 @@
#define MCUX_SCTIMER_CLK 34
#define MCUX_MRT_CLK 40
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_MCUX_LPC_SYSCON_H_ */