summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/samsung_pwm_timer.c
diff options
context:
space:
mode:
authorTomasz Figa <tomasz.figa@gmail.com>2013-06-17 00:13:06 +0200
committerTomasz Figa <tomasz.figa@gmail.com>2013-08-06 01:21:43 +0200
commit6792e636d5bfc1b26c25e7ed056b358e1144c6df (patch)
tree96d83eca6d4485aed66bf8d605455800b36170a8 /drivers/clocksource/samsung_pwm_timer.c
parentclocksource: samsung_pwm_timer: Cache clocksource register address (diff)
downloadlinux-6792e636d5bfc1b26c25e7ed056b358e1144c6df.tar.xz
linux-6792e636d5bfc1b26c25e7ed056b358e1144c6df.zip
clocksource: samsung_pwm_timer: Do not use clocksource_mmio
In case of Samsung PWM timer, clocksource MMIO can not be used, because custom suspend/resume callbacks are required. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Mark Brown <broonie@linaro.org> Tested-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/clocksource/samsung_pwm_timer.c')
-rw-r--r--drivers/clocksource/samsung_pwm_timer.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
index 0c005f4fa296..b3112dc293ba 100644
--- a/drivers/clocksource/samsung_pwm_timer.c
+++ b/drivers/clocksource/samsung_pwm_timer.c
@@ -298,6 +298,18 @@ static void __init samsung_clockevent_init(void)
}
}
+static cycle_t samsung_clocksource_read(struct clocksource *c)
+{
+ return ~readl_relaxed(pwm.source_reg);
+}
+
+static struct clocksource samsung_clocksource = {
+ .name = "samsung_clocksource_timer",
+ .rating = 250,
+ .read = samsung_clocksource_read,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
/*
* Override the global weak sched_clock symbol with this
* local implementation which uses the clocksource to get some
@@ -307,7 +319,7 @@ static void __init samsung_clockevent_init(void)
*/
static u32 notrace samsung_read_sched_clock(void)
{
- return ~__raw_readl(pwm.source_reg);
+ return samsung_clocksource_read(NULL);
}
static void __init samsung_clocksource_init(void)
@@ -334,9 +346,8 @@ static void __init samsung_clocksource_init(void)
setup_sched_clock(samsung_read_sched_clock,
pwm.variant.bits, clock_rate);
- ret = clocksource_mmio_init(pwm.source_reg, "samsung_clocksource_timer",
- clock_rate, 250, pwm.variant.bits,
- clocksource_mmio_readl_down);
+ samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
+ ret = clocksource_register_hz(&samsung_clocksource, clock_rate);
if (ret)
panic("samsung_clocksource_timer: can't register clocksource\n");
}