Skip to content

Commit 36427f8

Browse files
galaknashif
authored andcommitted
drivers: timer: Move Dual Timer API to unified interface
The CMSDK Dual Timer can be used as a timer or as a counter. The unified interface proposed in #8340 unifies counter.h and rtc.h to provide a common interface. This patch modifies the timer implementation of the dual timer to make it compliant with the new proposed interface. Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
1 parent 6fca18d commit 36427f8

File tree

7 files changed

+68
-250
lines changed

7 files changed

+68
-250
lines changed

boards/arm/mps2_an385/Kconfig.defconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ config TIMER_TMR_CMSDK_APB_1
5757

5858
endif # TIMER_TMR_CMSDK_APB
5959

60-
if COUNTER_DTMR_CMSDK_APB
61-
62-
config COUNTER_DTMR_CMSDK_APB_0
63-
default y
64-
65-
endif # COUNTER_DTMR_CMSDK_APB
66-
6760
if TIMER_DTMR_CMSDK_APB
6861

6962
config TIMER_DTMR_CMSDK_APB_0

boards/arm/v2m_beetle/Kconfig.defconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ config TIMER_TMR_CMSDK_APB_1
6666

6767
endif # TIMER_TMR_CMSDK_APB
6868

69-
if COUNTER_DTMR_CMSDK_APB
70-
71-
config COUNTER_DTMR_CMSDK_APB_0
72-
default y
73-
74-
endif # COUNTER_DTMR_CMSDK_APB
75-
7669
if TIMER_DTMR_CMSDK_APB
7770

7871
config TIMER_DTMR_CMSDK_APB_0

boards/arm/v2m_musca/Kconfig.defconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ config TIMER_TMR_CMSDK_APB_1
5050

5151
endif # TIMER_TMR_CMSDK_APB
5252

53-
if COUNTER_DTMR_CMSDK_APB
54-
55-
config COUNTER_DTMR_CMSDK_APB_0
56-
def_bool y
57-
58-
endif # COUNTER_DTMR_CMSDK_APB
59-
6053
if TIMER_DTMR_CMSDK_APB
6154

6255
config TIMER_DTMR_CMSDK_APB_0

drivers/counter/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ zephyr_library()
33
zephyr_library_sources_ifdef(CONFIG_AON_COUNTER_QMSI counter_qmsi_aon.c)
44
zephyr_library_sources_ifdef(CONFIG_AON_TIMER_QMSI counter_qmsi_aonpt.c)
55
zephyr_library_sources_ifdef(CONFIG_TIMER_TMR_CMSDK_APB timer_tmr_cmsdk_apb.c)
6-
zephyr_library_sources_ifdef(CONFIG_COUNTER_DTMR_CMSDK_APB counter_dtmr_cmsdk_apb.c)
76
zephyr_library_sources_ifdef(CONFIG_TIMER_DTMR_CMSDK_APB timer_dtmr_cmsdk_apb.c)
87
zephyr_library_sources_ifdef(CONFIG_COUNTER_IMX_EPIT counter_imx_epit.c)
98
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_RTC counter_mcux_rtc.c)

drivers/counter/Kconfig.dtmr_cmsdk_apb

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ config TIMER_DTMR_CMSDK_APB_0
2323
help
2424
Enable support for Timer 0.
2525

26-
config TIMER_DTMR_CMSDK_APB_0_DEV_NAME
27-
string "Timer 0 Device Name"
28-
depends on TIMER_DTMR_CMSDK_APB_0
29-
default "TIMER_0"
30-
help
31-
Specify the device name for Timer 0 driver.
32-
3326
config TIMER_DTMR_CMSDK_APB_0_IRQ_PRI
3427
int "Interrupt Priority for Timer 0"
3528
depends on TIMER_DTMR_CMSDK_APB_0
@@ -39,29 +32,4 @@ config TIMER_DTMR_CMSDK_APB_0_IRQ_PRI
3932

4033
endif # TIMER_DTMR_CMSDK_APB
4134

42-
config COUNTER_DTMR_CMSDK_APB
43-
bool "ARM CMSDK (Cortex-M System Design Kit) DTMR Counter driver"
44-
help
45-
The dualtimer (DTMR) present in the platform is used as a counter.
46-
This option enables the support for the counter.
47-
48-
if COUNTER_DTMR_CMSDK_APB
49-
50-
# ---------- Counter 0 ----------
51-
52-
config COUNTER_DTMR_CMSDK_APB_0
53-
bool "Counter 0 driver"
54-
depends on !TIMER_DTMR_CMSDK_APB_0
55-
help
56-
Enable support for Counter 0.
57-
58-
config COUNTER_DTMR_CMSDK_APB_0_DEV_NAME
59-
string "Counter 0 Device Name"
60-
depends on COUNTER_DTMR_CMSDK_APB_0
61-
default "COUNTER_0"
62-
help
63-
Specify the device name for Counter 0 driver.
64-
65-
endif # COUNTER_DTMR_CMSDK_APB
66-
6735
endif # SOC_FAMILY_ARM

drivers/counter/counter_dtmr_cmsdk_apb.c

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)