summaryrefslogtreecommitdiff
path: root/drivers/clocksource/exynos_mct.c
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-05-08 12:02:43 +0200
committerChanho Park <chanho61.park@samsung.com>2014-08-08 14:35:27 +0900
commit61d2827ff2d4875b3f17a16c9c6b0c0a797aa556 (patch)
treeb7d06d75936428da8a2ed14dc847b108b9696e76 /drivers/clocksource/exynos_mct.c
parent2b4016684f7f6279a0aa93c4bdbcd066966c0e1d (diff)
downloadlinux-3.10-61d2827ff2d4875b3f17a16c9c6b0c0a797aa556.tar.gz
linux-3.10-61d2827ff2d4875b3f17a16c9c6b0c0a797aa556.tar.bz2
linux-3.10-61d2827ff2d4875b3f17a16c9c6b0c0a797aa556.zip
clocksource: exynos_mct: Register sched_clock
This patch adds sched_clock registration to Exynos MCT driver to improve scheduler precision by providing a high resolution clock source for scheduling purposes. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Conflicts: drivers/clocksource/exynos_mct.c
Diffstat (limited to 'drivers/clocksource/exynos_mct.c')
-rw-r--r--drivers/clocksource/exynos_mct.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index b7960185919..b5de04ec051 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -25,6 +25,7 @@
#include <linux/clocksource.h>
#include <asm/localtimer.h>
+#include <asm/sched_clock.h>
#include <asm/mach/time.h>
#define EXYNOS4_MCTREG(x) (x)
@@ -190,10 +191,17 @@ struct clocksource mct_frc = {
.resume = exynos4_frc_resume,
};
+static u32 notrace exynos4_mct_read_sched_clock(void)
+{
+ return __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_L);
+}
+
static void __init exynos4_clocksource_init(void)
{
exynos4_mct_frc_start(0, 0);
+ setup_sched_clock(exynos4_mct_read_sched_clock, 32, clk_rate);
+
if (clocksource_register_hz(&mct_frc, clk_rate))
panic("%s: can't register clocksource\n", mct_frc.name);
}