Commit beb1e7b3 authored by Lucien Zhao's avatar Lucien Zhao Committed by Benjamin Cabé
Browse files

drivers: clock_control: update clock_control_mcux_ccm_rev2.c driver

Due to clock designed on RT1180 has some different with other platforms,
so add macro and handle the clock difference in mcux_ccm_get_subsys_rate.
TPM1 use Bus_Aon as clock root.
TPM3 use Bus_Wakeup as clock root.
Other instances have independent clock root.

Signed-off-by: default avatarLucien Zhao <lucien.zhao@nxp.com>
parent 523d6842
Loading
Loading
Loading
Loading
+19 −1
Changes for drivers/clock_control/clock_control_mcux_ccm_rev2.c: 19 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -178,11 +178,29 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,

		return 0;
#endif
#ifdef CONFIG_COUNTER_MCUX_TPM
#if defined(CONFIG_COUNTER_MCUX_TPM) || defined(CONFIG_PWM_MCUX_TPM)
#if defined(CONFIG_SOC_SERIES_IMXRT118X)
	case IMX_CCM_TPM_CLK:
		switch (instance) {
		case 0:
			clock_root = kCLOCK_Root_Bus_Aon;
			break;
		case 1:
			clock_root = kCLOCK_Root_Tpm2;
			break;
		case 2:
			clock_root = kCLOCK_Root_Bus_Wakeup;
			break;
		default:
			clock_root = (kCLOCK_Root_Tpm4 + instance - 3);
		}
		break;
#else
	case IMX_CCM_TPM_CLK:
		clock_root = kCLOCK_Root_Tpm1 + instance;
		break;
#endif
#endif

#ifdef CONFIG_MCUX_FLEXIO
	case IMX_CCM_FLEXIO1_CLK: