aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/nomadik-mtu.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:12:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:12:18 -0500
commit5ce7aba976ebdfbf467e3cbcd3a7536ebdec4b11 (patch)
treea31ceb4a167035aad73fd116ee8512fca905fd7b /drivers/clocksource/nomadik-mtu.c
parent7ae1c76ee5b58fe5bd55a07f99a3359333270b86 (diff)
parentb6a03d0492dedb5c10b8a5708ee92e04b0590c07 (diff)
Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver specific changes from Arnd Bergmann: - Updates to the ux500 cpufreq code - Moving the u300 DMA controller driver to drivers/dma - Moving versatile express drivers out of arch/arm for sharing with arch/arm64 - Device tree bindings for the OMAP General Purpose Memory Controller * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (27 commits) ARM: OMAP2+: gpmc: Add device tree documentation for elm handle ARM: OMAP2+: gpmc: add DT bindings for OneNAND ARM: OMAP2+: gpmc-onenand: drop __init annotation mtd: omap-onenand: pass device_node in platform data ARM: OMAP2+: Prevent potential crash if GPMC probe fails ARM: OMAP2+: gpmc: Remove unneeded of_node_put() arm: Move sp810.h to include/linux/amba/ ARM: OMAP: gpmc: add DT bindings for GPMC timings and NAND ARM: OMAP: gpmc: enable hwecc for AM33xx SoCs ARM: OMAP: gpmc-nand: drop __init annotation mtd: omap-nand: pass device_node in platform data ARM: OMAP: gpmc: don't create devices from initcall on DT dma: coh901318: cut down on platform data abstraction dma: coh901318: merge header files dma: coh901318: push definitions into driver dma: coh901318: push header down into the DMA subsystem dma: coh901318: skip hard-coded addresses dma: coh901318: remove hardcoded target addresses dma: coh901318: push platform data into driver dma: coh901318: create a proper platform data file ...
Diffstat (limited to 'drivers/clocksource/nomadik-mtu.c')
-rw-r--r--drivers/clocksource/nomadik-mtu.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c
index 025afc6dd324..435e54d55bbd 100644
--- a/drivers/clocksource/nomadik-mtu.c
+++ b/drivers/clocksource/nomadik-mtu.c
@@ -15,6 +15,7 @@
15#include <linux/clocksource.h> 15#include <linux/clocksource.h>
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/jiffies.h> 17#include <linux/jiffies.h>
18#include <linux/delay.h>
18#include <linux/err.h> 19#include <linux/err.h>
19#include <linux/platform_data/clocksource-nomadik-mtu.h> 20#include <linux/platform_data/clocksource-nomadik-mtu.h>
20#include <asm/mach/time.h> 21#include <asm/mach/time.h>
@@ -64,6 +65,7 @@ static void __iomem *mtu_base;
64static bool clkevt_periodic; 65static bool clkevt_periodic;
65static u32 clk_prescale; 66static u32 clk_prescale;
66static u32 nmdk_cycle; /* write-once */ 67static u32 nmdk_cycle; /* write-once */
68static struct delay_timer mtu_delay_timer;
67 69
68#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK 70#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
69/* 71/*
@@ -80,6 +82,11 @@ static u32 notrace nomadik_read_sched_clock(void)
80} 82}
81#endif 83#endif
82 84
85static unsigned long nmdk_timer_read_current_timer(void)
86{
87 return ~readl_relaxed(mtu_base + MTU_VAL(0));
88}
89
83/* Clockevent device: use one-shot mode */ 90/* Clockevent device: use one-shot mode */
84static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev) 91static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
85{ 92{
@@ -234,4 +241,8 @@ void __init nmdk_timer_init(void __iomem *base, int irq)
234 setup_irq(irq, &nmdk_timer_irq); 241 setup_irq(irq, &nmdk_timer_irq);
235 nmdk_clkevt.cpumask = cpumask_of(0); 242 nmdk_clkevt.cpumask = cpumask_of(0);
236 clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU); 243 clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU);
244
245 mtu_delay_timer.read_current_timer = &nmdk_timer_read_current_timer;
246 mtu_delay_timer.freq = rate;
247 register_current_timer_delay(&mtu_delay_timer);
237} 248}