]> Git Repo - linux.git/blobdiff - drivers/clocksource/qcom-timer.c
watchdog: Add watchdog enable/disable all functions
[linux.git] / drivers / clocksource / qcom-timer.c
index e807acf4c665eee3bb85e03c45e823d6609b0992..098c542e5c537dca3f159771960b453d61b578a8 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/of_irq.h>
 #include <linux/sched_clock.h>
 
+#include <asm/delay.h>
+
 #define TIMER_MATCH_VAL                        0x0000
 #define TIMER_COUNT_VAL                        0x0004
 #define TIMER_ENABLE                   0x0008
@@ -179,6 +181,15 @@ static u64 notrace msm_sched_clock_read(void)
        return msm_clocksource.read(&msm_clocksource);
 }
 
+static unsigned long msm_read_current_timer(void)
+{
+       return msm_clocksource.read(&msm_clocksource);
+}
+
+static struct delay_timer msm_delay_timer = {
+       .read_current_timer = msm_read_current_timer,
+};
+
 static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
                                  bool percpu)
 {
@@ -208,7 +219,7 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
                }
 
                /* Immediately configure the timer on the boot CPU */
-               msm_local_timer_setup(__this_cpu_ptr(msm_evt));
+               msm_local_timer_setup(raw_cpu_ptr(msm_evt));
        }
 
 err:
@@ -217,6 +228,8 @@ err:
        if (res)
                pr_err("clocksource_register failed\n");
        sched_clock_register(msm_sched_clock_read, sched_bits, dgt_hz);
+       msm_delay_timer.freq = dgt_hz;
+       register_current_timer_delay(&msm_delay_timer);
 }
 
 #ifdef CONFIG_ARCH_QCOM
This page took 0.031794 seconds and 4 git commands to generate.