Skip to content

Commit

Permalink
drivers: timer: Move Dual Timer API to unified interface
Browse files Browse the repository at this point in the history
The CMSDK Dual Timer can be used as a timer or as a counter.
The unified interface proposed in zephyrproject-rtos#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]>
  • Loading branch information
galak committed Feb 5, 2019
1 parent 1653dc0 commit 4d8e9fc
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 250 deletions.
7 changes: 0 additions & 7 deletions boards/arm/mps2_an385/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ config TIMER_TMR_CMSDK_APB_1

endif # TIMER_TMR_CMSDK_APB

if COUNTER_DTMR_CMSDK_APB

config COUNTER_DTMR_CMSDK_APB_0
default y

endif # COUNTER_DTMR_CMSDK_APB

if TIMER_DTMR_CMSDK_APB

config TIMER_DTMR_CMSDK_APB_0
Expand Down
7 changes: 0 additions & 7 deletions boards/arm/v2m_beetle/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ config TIMER_TMR_CMSDK_APB_1

endif # TIMER_TMR_CMSDK_APB

if COUNTER_DTMR_CMSDK_APB

config COUNTER_DTMR_CMSDK_APB_0
default y

endif # COUNTER_DTMR_CMSDK_APB

if TIMER_DTMR_CMSDK_APB

config TIMER_DTMR_CMSDK_APB_0
Expand Down
7 changes: 0 additions & 7 deletions boards/arm/v2m_musca/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ config TIMER_TMR_CMSDK_APB_1

endif # TIMER_TMR_CMSDK_APB

if COUNTER_DTMR_CMSDK_APB

config COUNTER_DTMR_CMSDK_APB_0
def_bool y

endif # COUNTER_DTMR_CMSDK_APB

if TIMER_DTMR_CMSDK_APB

config TIMER_DTMR_CMSDK_APB_0
Expand Down
1 change: 0 additions & 1 deletion drivers/counter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ zephyr_library()
zephyr_library_sources_ifdef(CONFIG_AON_COUNTER_QMSI counter_qmsi_aon.c)
zephyr_library_sources_ifdef(CONFIG_AON_TIMER_QMSI counter_qmsi_aonpt.c)
zephyr_library_sources_ifdef(CONFIG_TIMER_TMR_CMSDK_APB timer_tmr_cmsdk_apb.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_DTMR_CMSDK_APB counter_dtmr_cmsdk_apb.c)
zephyr_library_sources_ifdef(CONFIG_TIMER_DTMR_CMSDK_APB timer_dtmr_cmsdk_apb.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_IMX_EPIT counter_imx_epit.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_RTC counter_mcux_rtc.c)
Expand Down
32 changes: 0 additions & 32 deletions drivers/counter/Kconfig.dtmr_cmsdk_apb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ config TIMER_DTMR_CMSDK_APB_0
help
Enable support for Timer 0.

config TIMER_DTMR_CMSDK_APB_0_DEV_NAME
string "Timer 0 Device Name"
depends on TIMER_DTMR_CMSDK_APB_0
default "TIMER_0"
help
Specify the device name for Timer 0 driver.

config TIMER_DTMR_CMSDK_APB_0_IRQ_PRI
int "Interrupt Priority for Timer 0"
depends on TIMER_DTMR_CMSDK_APB_0
Expand All @@ -39,29 +32,4 @@ config TIMER_DTMR_CMSDK_APB_0_IRQ_PRI

endif # TIMER_DTMR_CMSDK_APB

config COUNTER_DTMR_CMSDK_APB
bool "ARM CMSDK (Cortex-M System Design Kit) DTMR Counter driver"
help
The dualtimer (DTMR) present in the platform is used as a counter.
This option enables the support for the counter.

if COUNTER_DTMR_CMSDK_APB

# ---------- Counter 0 ----------

config COUNTER_DTMR_CMSDK_APB_0
bool "Counter 0 driver"
depends on !TIMER_DTMR_CMSDK_APB_0
help
Enable support for Counter 0.

config COUNTER_DTMR_CMSDK_APB_0_DEV_NAME
string "Counter 0 Device Name"
depends on COUNTER_DTMR_CMSDK_APB_0
default "COUNTER_0"
help
Specify the device name for Counter 0 driver.

endif # COUNTER_DTMR_CMSDK_APB

endif # SOC_FAMILY_ARM
120 changes: 0 additions & 120 deletions drivers/counter/counter_dtmr_cmsdk_apb.c

This file was deleted.

Loading

0 comments on commit 4d8e9fc

Please sign in to comment.