]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
clocksource/drivers/ixp4xx: Implement delay timer
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 23 May 2019 18:16:02 +0000 (20:16 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 25 Jun 2019 17:49:18 +0000 (19:49 +0200)
This adds delay timer functionality to the IXP4xx
timer driver.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/timer-ixp4xx.c

index 5c2190b654cdf1f9822ce56763a5f8113eef895e..9396745e1c1790e9693ee74d2fb412ba7fd19502 100644 (file)
@@ -75,14 +75,19 @@ to_ixp4xx_timer(struct clock_event_device *evt)
        return container_of(evt, struct ixp4xx_timer, clkevt);
 }
 
-static u64 notrace ixp4xx_read_sched_clock(void)
+static unsigned long ixp4xx_read_timer(void)
 {
        return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET);
 }
 
+static u64 notrace ixp4xx_read_sched_clock(void)
+{
+       return ixp4xx_read_timer();
+}
+
 static u64 ixp4xx_clocksource_read(struct clocksource *c)
 {
-       return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET);
+       return ixp4xx_read_timer();
 }
 
 static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
@@ -224,6 +229,13 @@ static __init int ixp4xx_timer_register(void __iomem *base,
 
        sched_clock_register(ixp4xx_read_sched_clock, 32, timer_freq);
 
+#ifdef CONFIG_ARM
+       /* Also use this timer for delays */
+       tmr->delay_timer.read_current_timer = ixp4xx_read_timer;
+       tmr->delay_timer.freq = timer_freq;
+       register_current_timer_delay(&tmr->delay_timer);
+#endif
+
        return 0;
 }