[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/44] hw/timer/npcm7xx_timer: Use new clock_ns_to_ticks()
From: |
Peter Maydell |
Subject: |
[PATCH 04/44] hw/timer/npcm7xx_timer: Use new clock_ns_to_ticks() |
Date: |
Fri, 19 Feb 2021 14:45:37 +0000 |
Use the new clock_ns_to_ticks() function in npcm7xx_timer where
appropriate.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
---
hw/timer/npcm7xx_timer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/timer/npcm7xx_timer.c b/hw/timer/npcm7xx_timer.c
index 4efdf135b82..32f5e021f85 100644
--- a/hw/timer/npcm7xx_timer.c
+++ b/hw/timer/npcm7xx_timer.c
@@ -138,8 +138,8 @@ static int64_t npcm7xx_timer_count_to_ns(NPCM7xxTimer *t,
uint32_t count)
/* Convert a time interval in nanoseconds to a timer cycle count. */
static uint32_t npcm7xx_timer_ns_to_count(NPCM7xxTimer *t, int64_t ns)
{
- return ns / clock_ticks_to_ns(t->ctrl->clock,
- npcm7xx_tcsr_prescaler(t->tcsr));
+ return clock_ns_to_ticks(t->ctrl->clock, ns) /
+ npcm7xx_tcsr_prescaler(t->tcsr);
}
static uint32_t npcm7xx_watchdog_timer_prescaler(const NPCM7xxWatchdogTimer *t)
--
2.20.1
- [PATCH 00/44] hw/arm: New board model mps3-an547, Peter Maydell, 2021/02/19
- [PATCH 02/44] clock: Add ClockPreUpdate callback event type, Peter Maydell, 2021/02/19
- [PATCH 01/44] clock: Add ClockEvent parameter to callbacks, Peter Maydell, 2021/02/19
- [PATCH 03/44] clock: Add clock_ns_to_ticks() function, Peter Maydell, 2021/02/19
- [PATCH 04/44] hw/timer/npcm7xx_timer: Use new clock_ns_to_ticks(),
Peter Maydell <=
- [PATCH 06/44] hw/misc/iotkit-sysctl: Remove is_sse200 flag, Peter Maydell, 2021/02/19
- [PATCH 07/44] hw/misc/iotkit-secctl.c: Implement SSE-300 PID register values, Peter Maydell, 2021/02/19
- [PATCH 10/44] hw/misc/iotkit-sysinfo.c: Implement SYS_CONFIG1 and IIDR, Peter Maydell, 2021/02/19
- [PATCH 11/44] hw/timer/sse-counter: Model the SSE Subsystem System Counter, Peter Maydell, 2021/02/19
- [PATCH 13/44] hw/misc/iotkit-sysctl: Add SSE-300 cases which match SSE-200 behaviour, Peter Maydell, 2021/02/19
- [PATCH 05/44] hw/arm/armsse: Introduce SSE subsystem version property, Peter Maydell, 2021/02/19
- [PATCH 12/44] hw/timer/sse-timer: Model the SSE Subsystem System Timer, Peter Maydell, 2021/02/19
- [PATCH 09/44] hw/arm/armsse.c: Use correct SYS_CONFIG0 register value for SSE-300, Peter Maydell, 2021/02/19
- [PATCH 08/44] hw/misc/iotkit-sysinfo.c: Implement SSE-300 PID register values, Peter Maydell, 2021/02/19
- [PATCH 14/44] hw/misc/iotkit-sysctl: Handle CPU_WAIT, NMI_ENABLE for SSE-300, Peter Maydell, 2021/02/19