diff options
| author | Nathan Lynch <[email protected]> | 2014-09-28 23:50:06 +0000 |
|---|---|---|
| committer | Daniel Lezcano <[email protected]> | 2014-09-28 23:59:26 +0000 |
| commit | e1ce5c7adc735ce96a35806ca32ceb78e607a283 (patch) | |
| tree | f64460684e1eb8139a65e108f7ebc49b1163d521 /drivers/clocksource/arm_arch_timer.c | |
| parent | clocksource: arm_arch_timer: Enable counter access for 32-bit ARM (diff) | |
| download | kernel-e1ce5c7adc735ce96a35806ca32ceb78e607a283.tar.gz kernel-e1ce5c7adc735ce96a35806ca32ceb78e607a283.zip | |
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 <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Acked-by: Will Deacon <[email protected]>
Diffstat (limited to 'drivers/clocksource/arm_arch_timer.c')
| -rw-r--r-- | drivers/clocksource/arm_arch_timer.c | 15 |
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, clockevents_config_and_register(clk, arch_timer_rate, 0xf, 0x7fffffff); } +static void arch_timer_evtstrm_enable(int divider) +{ + u32 cntkctl = arch_timer_get_cntkctl(); + + cntkctl &= ~ARCH_TIMER_EVT_TRIGGER_MASK; + /* Set the divider and enable virtual event stream */ + cntkctl |= (divider << ARCH_TIMER_EVT_TRIGGER_SHIFT) + | ARCH_TIMER_VIRT_EVT_EN; + arch_timer_set_cntkctl(cntkctl); + elf_hwcap |= HWCAP_EVTSTRM; +#ifdef CONFIG_COMPAT + compat_elf_hwcap |= COMPAT_HWCAP_EVTSTRM; +#endif +} + static void arch_timer_configure_evtstream(void) { int evt_stream_div, pos; |
