From 3e5a837e297832c2964836e6a35d354d04bd3101 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 20 Jan 2014 18:49:12 +0800 Subject: [PATCH] clocksource: rockchip_timer: support timer-based delay --- drivers/clocksource/rockchip_timer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c index 124869d37368..65fa2393cf77 100644 --- a/drivers/clocksource/rockchip_timer.c +++ b/drivers/clocksource/rockchip_timer.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -225,6 +226,11 @@ static void __init rk_timer_init_ce_timer(struct device_node *np, unsigned int c irq->handler = rk_timer_clockevent_interrupt; } +static struct delay_timer rk_delay_timer = { + .read_current_timer = (unsigned long (*)(void))rockchip_read_sched_clock, + .freq = 24000000, +}; + static int num_called; static void __init rk_timer_init(struct device_node *np) { @@ -233,6 +239,7 @@ static void __init rk_timer_init(struct device_node *np) rk_timer_init_clocksource(np); setup_sched_clock(rockchip_read_sched_clock, 32, 24000000); local_timer_register(&rk_local_timer_ops); + register_current_timer_delay(&rk_delay_timer); break; default: rk_timer_init_ce_timer(np, num_called - 1); -- 2.34.1