From 0ec0ac109a2d43ee95d73c29e18775b404d027f6 Mon Sep 17 00:00:00 2001 From: Ruibin Chang Date: Mon, 28 Mar 2022 14:25:37 +0800 Subject: [PATCH] ITE drivers/timer: don't divide free run count We don't need to convert the free run clock count, that will be converted by the kernel (base on CONFIG_SYS_CLOCK_TICKS_PER_SEC), so we should return the HW register count value directly. Signed-off-by: Ruibin Chang --- drivers/timer/ite_it8xxx2_timer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/timer/ite_it8xxx2_timer.c b/drivers/timer/ite_it8xxx2_timer.c index 786fab94abe..3a3f392e7d3 100644 --- a/drivers/timer/ite_it8xxx2_timer.c +++ b/drivers/timer/ite_it8xxx2_timer.c @@ -289,7 +289,7 @@ uint32_t sys_clock_elapsed(void) uint32_t sys_clock_cycle_get_32(void) { /* - * Get free run observer count and transform unit to system tick + * Get free run observer count * * NOTE: Timer is counting down from 0xffffffff. In not combined * mode, the observer count value is the same as count, so after @@ -297,8 +297,7 @@ uint32_t sys_clock_cycle_get_32(void) * combined mode, the observer count value is the same as NOT * count operation. */ - uint32_t dticks = (~(IT8XXX2_EXT_CNTOX(FREE_RUN_TIMER))) - / HW_CNT_PER_SYS_TICK; + uint32_t dticks = ~(IT8XXX2_EXT_CNTOX(FREE_RUN_TIMER)); return dticks; }