From 90986e7e22f42a45e25da84ef3e293f4171f9886 Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Mon, 3 Jun 2024 20:03:34 -0500 Subject: [PATCH] drivers: mcux_lptmr_timer: Fix compat string error Fix error due to compatible string changing in DT and forgetting to update this driver with the change. Also make the counter symbol hidden. Signed-off-by: Declan Snyder --- drivers/counter/Kconfig.mcux_lptmr | 2 +- drivers/timer/Kconfig.mcux_lptmr | 13 ++++++++++++- drivers/timer/mcux_lptmr_timer.c | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/counter/Kconfig.mcux_lptmr b/drivers/counter/Kconfig.mcux_lptmr index d6847a3ffbb..af961c790e1 100644 --- a/drivers/counter/Kconfig.mcux_lptmr +++ b/drivers/counter/Kconfig.mcux_lptmr @@ -12,7 +12,7 @@ config COUNTER_MCUX_LPTMR Enable support for the MCUX Low Power Timer (LPTMR). config COUNTER_MCUX_KINETIS_LPTMR - bool "Deprecated DT compatible" + bool default y depends on DT_HAS_NXP_KINETIS_LPTMR_ENABLED select DEPRECATED diff --git a/drivers/timer/Kconfig.mcux_lptmr b/drivers/timer/Kconfig.mcux_lptmr index 8879cb3b558..6182611f744 100644 --- a/drivers/timer/Kconfig.mcux_lptmr +++ b/drivers/timer/Kconfig.mcux_lptmr @@ -6,7 +6,8 @@ config MCUX_LPTMR_TIMER bool "MCUX LPTMR timer" default y - depends on DT_HAS_NXP_KINETIS_LPTMR_ENABLED + depends on DT_HAS_NXP_KINETIS_LPTMR_ENABLED || \ + MCUX_KINETIS_LPTMR depends on !COUNTER_MCUX_LPTMR depends on PM select SYSTEM_TIMER_HAS_DISABLE_SUPPORT @@ -14,3 +15,13 @@ config MCUX_LPTMR_TIMER This module implements a kernel device driver for the NXP MCUX Low Power Timer (LPTMR) and provides the standard "system clock driver" interfaces. + +config MCUX_KINETIS_LPTMR + bool + default y + depends on DT_HAS_NXP_KINETIS_LPTMR_ENABLED + select DEPRECATED + help + The compatible string "nxp,kinetis-lptmr" should + be swiched to "nxp,lptmr" in DT. The former will + be removed eventually. diff --git a/drivers/timer/mcux_lptmr_timer.c b/drivers/timer/mcux_lptmr_timer.c index e91c11112ff..930058f4ea4 100644 --- a/drivers/timer/mcux_lptmr_timer.c +++ b/drivers/timer/mcux_lptmr_timer.c @@ -4,7 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#if DT_HAS_COMPAT_STATUS_OKAY(nxp_kinetis_lptmr) #define DT_DRV_COMPAT nxp_kinetis_lptmr +#else +#define DT_DRV_COMPAT nxp_lptmr +#endif #include #include