Skip to content

Commit 6fca18d

Browse files
galaknashif
authored andcommitted
drivers: timer: Move Timer API to unified interface
The CMSDK 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 single 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 3edafc2 commit 6fca18d

File tree

8 files changed

+87
-314
lines changed

8 files changed

+87
-314
lines changed

boards/arm/mps2_an385/Kconfig.defconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ endif # WATCHDOG
4747

4848
if COUNTER
4949

50-
if COUNTER_TMR_CMSDK_APB
51-
52-
config COUNTER_TMR_CMSDK_APB_0
53-
default y
54-
55-
config COUNTER_TMR_CMSDK_APB_1
56-
default y
57-
58-
endif # COUNTER_TMR_CMSDK_APB
59-
6050
if TIMER_TMR_CMSDK_APB
6151

6252
config TIMER_TMR_CMSDK_APB_0

boards/arm/v2m_beetle/Kconfig.defconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@ endif # WATCHDOG
5656

5757
if COUNTER
5858

59-
if COUNTER_TMR_CMSDK_APB
60-
61-
config COUNTER_TMR_CMSDK_APB_0
62-
default y
63-
64-
config COUNTER_TMR_CMSDK_APB_1
65-
default y
66-
67-
endif # COUNTER_TMR_CMSDK_APB
68-
6959
if TIMER_TMR_CMSDK_APB
7060

7161
config TIMER_TMR_CMSDK_APB_0

boards/arm/v2m_musca/Kconfig.defconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ endif # SERIAL
4040

4141
if COUNTER
4242

43-
if COUNTER_TMR_CMSDK_APB
44-
45-
config COUNTER_TMR_CMSDK_APB_0
46-
def_bool y
47-
48-
config COUNTER_TMR_CMSDK_APB_1
49-
def_bool y
50-
51-
endif # COUNTER_TMR_CMSDK_APB
52-
5343
if TIMER_TMR_CMSDK_APB
5444

5545
config TIMER_TMR_CMSDK_APB_0

drivers/counter/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ zephyr_library()
22

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)
5-
zephyr_library_sources_ifdef(CONFIG_COUNTER_TMR_CMSDK_APB counter_tmr_cmsdk_apb.c)
65
zephyr_library_sources_ifdef(CONFIG_TIMER_TMR_CMSDK_APB timer_tmr_cmsdk_apb.c)
76
zephyr_library_sources_ifdef(CONFIG_COUNTER_DTMR_CMSDK_APB counter_dtmr_cmsdk_apb.c)
87
zephyr_library_sources_ifdef(CONFIG_TIMER_DTMR_CMSDK_APB timer_dtmr_cmsdk_apb.c)

drivers/counter/Kconfig.tmr_cmsdk_apb

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

26-
config TIMER_TMR_CMSDK_APB_0_DEV_NAME
27-
string "Timer 0 Device Name"
28-
depends on TIMER_TMR_CMSDK_APB_0
29-
default "TIMER_0"
30-
help
31-
Specify the device name for Timer 0 driver.
32-
3326
config TIMER_TMR_CMSDK_APB_0_IRQ_PRI
3427
int "Interrupt Priority for Timer 0"
3528
depends on TIMER_TMR_CMSDK_APB_0
@@ -44,13 +37,6 @@ config TIMER_TMR_CMSDK_APB_1
4437
help
4538
Enable support for Timer 1.
4639

47-
config TIMER_TMR_CMSDK_APB_1_DEV_NAME
48-
string "Timer 1 Device Name"
49-
depends on TIMER_TMR_CMSDK_APB_1
50-
default "TIMER_1"
51-
help
52-
Specify the device name for Timer 1 driver.
53-
5440
config TIMER_TMR_CMSDK_APB_1_IRQ_PRI
5541
int "Interrupt Priority for Timer 1"
5642
depends on TIMER_TMR_CMSDK_APB_1
@@ -60,44 +46,4 @@ config TIMER_TMR_CMSDK_APB_1_IRQ_PRI
6046

6147
endif # TIMER_TMR_CMSDK_APB
6248

63-
config COUNTER_TMR_CMSDK_APB
64-
bool "ARM CMSDK (Cortex-M System Design Kit) Counter driver"
65-
help
66-
The timers (TMR) present in the platform are used as counters.
67-
This option enables the support for the counters.
68-
69-
if COUNTER_TMR_CMSDK_APB
70-
71-
# ---------- Counter 0 ----------
72-
73-
config COUNTER_TMR_CMSDK_APB_0
74-
bool "Counter 0 driver"
75-
depends on !TIMER_TMR_CMSDK_APB_0
76-
help
77-
Enable support for Counter 0.
78-
79-
config COUNTER_TMR_CMSDK_APB_0_DEV_NAME
80-
string "Counter 0 Device Name"
81-
depends on COUNTER_TMR_CMSDK_APB_0
82-
default "COUNTER_0"
83-
help
84-
Specify the device name for Counter 0 driver.
85-
86-
# ---------- Counter 1 ----------
87-
88-
config COUNTER_TMR_CMSDK_APB_1
89-
bool "Counter 1 driver"
90-
depends on !TIMER_TMR_CMSDK_APB_1
91-
help
92-
Enable support for Counter 1.
93-
94-
config COUNTER_TMR_CMSDK_APB_1_DEV_NAME
95-
string "Counter 1 Device Name"
96-
depends on COUNTER_TMR_CMSDK_APB_1
97-
default "COUNTER_1"
98-
help
99-
Specify the device name for Counter 1 driver.
100-
101-
endif # COUNTER_TMR_CMSDK_APB
102-
10349
endif # SOC_FAMILY_ARM

drivers/counter/counter_tmr_cmsdk_apb.c

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

0 commit comments

Comments
 (0)