From: 黄涛 Date: Mon, 20 Jan 2014 10:49:12 +0000 (+0800) Subject: clocksource: rockchip_timer: support timer-based delay X-Git-Tag: firefly_0821_release~6383 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3e5a837e297832c2964836e6a35d354d04bd3101;p=firefly-linux-kernel-4.4.55.git clocksource: rockchip_timer: support timer-based delay --- 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);