aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorAndrew Bresticker <abrestic@chromium.org>2014-10-20 15:04:05 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 01:45:16 -0500
commitb695d8e6ad6fba3d72b309b0d62128b04cf57160 (patch)
tree755f59a45101d7b2183e5a6450cff350acd7017b /drivers/clocksource
parente4752dbbc300939e14029583ba2a0b235b147649 (diff)
clocksource: mips-gic: Use clockevents_config_and_register
Use clockevents_config_and_register to setup the clock_event_device based on frequency and min/max ticks instead of doing it ourselves. Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Qais Yousef <qais.yousef@imgtec.com> Cc: John Crispin <blogic@openwrt.org> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/8140/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/mips-gic-timer.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index 3ce992bc574f..84fbb7ae4db2 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -15,8 +15,6 @@
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/time.h> 16#include <linux/time.h>
17 17
18#include <asm/time.h>
19
20static DEFINE_PER_CPU(struct clock_event_device, gic_clockevent_device); 18static DEFINE_PER_CPU(struct clock_event_device, gic_clockevent_device);
21static int gic_timer_irq; 19static int gic_timer_irq;
22static unsigned int gic_frequency; 20static unsigned int gic_frequency;
@@ -63,19 +61,13 @@ static void gic_clockevent_cpu_init(struct clock_event_device *cd)
63 cd->features = CLOCK_EVT_FEAT_ONESHOT | 61 cd->features = CLOCK_EVT_FEAT_ONESHOT |
64 CLOCK_EVT_FEAT_C3STOP; 62 CLOCK_EVT_FEAT_C3STOP;
65 63
66 clockevent_set_clock(cd, gic_frequency);
67
68 /* Calculate the min / max delta */
69 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
70 cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
71
72 cd->rating = 300; 64 cd->rating = 300;
73 cd->irq = gic_timer_irq; 65 cd->irq = gic_timer_irq;
74 cd->cpumask = cpumask_of(cpu); 66 cd->cpumask = cpumask_of(cpu);
75 cd->set_next_event = gic_next_event; 67 cd->set_next_event = gic_next_event;
76 cd->set_mode = gic_set_clock_mode; 68 cd->set_mode = gic_set_clock_mode;
77 69
78 clockevents_register_device(cd); 70 clockevents_config_and_register(cd, gic_frequency, 0x300, 0x7fffffff);
79 71
80 enable_percpu_irq(gic_timer_irq, IRQ_TYPE_NONE); 72 enable_percpu_irq(gic_timer_irq, IRQ_TYPE_NONE);
81} 73}