diff options
Diffstat (limited to 'drivers/clocksource/rk_timer.c')
-rw-r--r-- | drivers/clocksource/rk_timer.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/clocksource/rk_timer.c b/drivers/clocksource/rk_timer.c index baa517c62f..eb6c886af0 100644 --- a/drivers/clocksource/rk_timer.c +++ b/drivers/clocksource/rk_timer.c @@ -10,12 +10,20 @@ #include <clock.h> #include <init.h> #include <io.h> -#include <mach/timer.h> #include <stdio.h> -#include <mach/hardware.h> -#include <mach/cru_rk3288.h> +#include <mach/rockchip/hardware.h> +#include <mach/rockchip/cru_rk3288.h> #include <common.h> +struct rk_timer { + unsigned int timer_load_count0; + unsigned int timer_load_count1; + unsigned int timer_curr_value0; + unsigned int timer_curr_value1; + unsigned int timer_ctrl_reg; + unsigned int timer_int_status; +}; + struct rk_timer *timer_ptr; static uint64_t rockchip_get_ticks(void) @@ -32,9 +40,10 @@ static struct clocksource rkcs = { .read = rockchip_get_ticks, .mask = CLOCKSOURCE_MASK(32), .shift = 10, + .priority = 80, }; -static int rockchip_timer_probe(struct device_d *dev) +static int rockchip_timer_probe(struct device *dev) { struct resource *iores; @@ -59,15 +68,12 @@ static __maybe_unused struct of_device_id rktimer_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, rktimer_dt_ids); -static struct driver_d rktimer_driver = { +static struct driver rktimer_driver = { .name = "rockchip-timer", .probe = rockchip_timer_probe, .of_compatible = DRV_OF_COMPAT(rktimer_dt_ids), }; -static int rktimer_init(void) -{ - return platform_driver_register(&rktimer_driver); -} -core_initcall(rktimer_init); +core_platform_driver(rktimer_driver); |