aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorNathan Lynch <nathan_lynch@mentor.com>2014-09-28 19:50:06 -0400
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-09-28 19:59:26 -0400
commite1ce5c7adc735ce96a35806ca32ceb78e607a283 (patch)
treef64460684e1eb8139a65e108f7ebc49b1163d521 /drivers/clocksource
parent8b8dde00347ef409b29abd97e5833ffdb4ed7508 (diff)
clocksource: arm_arch_timer: Consolidate arch_timer_evtstrm_enable
The arch_timer_evtstrm_enable hooks in arm and arm64 are substantially similar, the only difference being a CONFIG_COMPAT-conditional section which is relevant only for arm64. Copy the arm64 version to the driver, removing the arch-specific hooks. Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/arm_arch_timer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 42bd4455daca..2133f9d59d06 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -299,6 +299,21 @@ static void __arch_timer_setup(unsigned type,
299 clockevents_config_and_register(clk, arch_timer_rate, 0xf, 0x7fffffff); 299 clockevents_config_and_register(clk, arch_timer_rate, 0xf, 0x7fffffff);
300} 300}
301 301
302static void arch_timer_evtstrm_enable(int divider)
303{
304 u32 cntkctl = arch_timer_get_cntkctl();
305
306 cntkctl &= ~ARCH_TIMER_EVT_TRIGGER_MASK;
307 /* Set the divider and enable virtual event stream */
308 cntkctl |= (divider << ARCH_TIMER_EVT_TRIGGER_SHIFT)
309 | ARCH_TIMER_VIRT_EVT_EN;
310 arch_timer_set_cntkctl(cntkctl);
311 elf_hwcap |= HWCAP_EVTSTRM;
312#ifdef CONFIG_COMPAT
313 compat_elf_hwcap |= COMPAT_HWCAP_EVTSTRM;
314#endif
315}
316
302static void arch_timer_configure_evtstream(void) 317static void arch_timer_configure_evtstream(void)
303{ 318{
304 int evt_stream_div, pos; 319 int evt_stream_div, pos;