summaryrefslogtreecommitdiff
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-01-08 15:08:49 -0800
committerOlof Johansson <olof@lixom.net>2013-01-08 15:08:59 -0800
commit96e61b8e34ea4982ce57319c19ab73e9e5d74165 (patch)
tree5a92e274069225396051e3b12d6b82d6cdd8175b /drivers/clocksource
parentd1c3ed669a2d452cacfb48c2d171a1f364dae2ed (diff)
parentec6691239373395d64fb73f50444f09a6f29d5ef (diff)
Merge tag 'ux500-cpufreq-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/drivers
From Linus Walleij: These are cpufreq updates for the ux500 - Updates to the ux500 cpufreq driver - Support for delay timers in the MTU clksrc - Consequential updates to the cpufreq driver * tag 'ux500-cpufreq-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson: cpufreq: db8500: set CPUFREQ_CONST_LOOPS clocksource: nomadik-mtu: support timer-based delay cpufreq: dbx500: Update file header cpufreq: dbx500: Minor code cleanup cpufreq: dbx500: Move clk_get to probe mfd: db8500: Update cpufreq device name cpufreq: Give driver used for dbx500 family a more generic name Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/clocksource')
-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 8914c3c1c88b..5f3c8dbf360f 100644
--- a/drivers/clocksource/nomadik-mtu.c
+++ b/drivers/clocksource/nomadik-mtu.c
@@ -15,6 +15,7 @@
#include <linux/clocksource.h>
#include <linux/clk.h>
#include <linux/jiffies.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/platform_data/clocksource-nomadik-mtu.h>
#include <asm/mach/time.h>
@@ -64,6 +65,7 @@ static void __iomem *mtu_base;
static bool clkevt_periodic;
static u32 clk_prescale;
static u32 nmdk_cycle; /* write-once */
+static struct delay_timer mtu_delay_timer;
#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
/*
@@ -80,6 +82,11 @@ static u32 notrace nomadik_read_sched_clock(void)
}
#endif
+static unsigned long nmdk_timer_read_current_timer(void)
+{
+ return ~readl_relaxed(mtu_base + MTU_VAL(0));
+}
+
/* Clockevent device: use one-shot mode */
static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
{
@@ -227,4 +234,8 @@ void __init nmdk_timer_init(void __iomem *base, int irq)
setup_irq(irq, &nmdk_timer_irq);
nmdk_clkevt.cpumask = cpumask_of(0);
clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU);
+
+ mtu_delay_timer.read_current_timer = &nmdk_timer_read_current_timer;
+ mtu_delay_timer.freq = rate;
+ register_current_timer_delay(&mtu_delay_timer);
}