diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2014-02-19 15:05:26 -0500 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2014-03-11 18:05:05 -0400 |
commit | c8af34b4dbc211f1e08a7ea513dc399046825866 (patch) | |
tree | c41d244fac5ea714367945f2b67053f8f06a7a73 /drivers/clocksource/time-armada-370-xp.c | |
parent | 0a54a069585bb875d37494c434f36a19bcc05df9 (diff) |
clocksource: armada-370-xp: Use atomic access for shared registers
Replace the driver-specific thread-safe shared register API
by the recently introduced atomic_io_clear_set().
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource/time-armada-370-xp.c')
-rw-r--r-- | drivers/clocksource/time-armada-370-xp.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c index ee8691b89944..0451e62fac7a 100644 --- a/drivers/clocksource/time-armada-370-xp.c +++ b/drivers/clocksource/time-armada-370-xp.c | |||
@@ -85,12 +85,6 @@ static u32 ticks_per_jiffy; | |||
85 | 85 | ||
86 | static struct clock_event_device __percpu *armada_370_xp_evt; | 86 | static struct clock_event_device __percpu *armada_370_xp_evt; |
87 | 87 | ||
88 | static void timer_ctrl_clrset(u32 clr, u32 set) | ||
89 | { | ||
90 | writel((readl(timer_base + TIMER_CTRL_OFF) & ~clr) | set, | ||
91 | timer_base + TIMER_CTRL_OFF); | ||
92 | } | ||
93 | |||
94 | static void local_timer_ctrl_clrset(u32 clr, u32 set) | 88 | static void local_timer_ctrl_clrset(u32 clr, u32 set) |
95 | { | 89 | { |
96 | writel((readl(local_base + TIMER_CTRL_OFF) & ~clr) | set, | 90 | writel((readl(local_base + TIMER_CTRL_OFF) & ~clr) | set, |
@@ -245,7 +239,7 @@ static void __init armada_370_xp_timer_common_init(struct device_node *np) | |||
245 | clr = TIMER0_25MHZ; | 239 | clr = TIMER0_25MHZ; |
246 | enable_mask = TIMER0_EN | TIMER0_DIV(TIMER_DIVIDER_SHIFT); | 240 | enable_mask = TIMER0_EN | TIMER0_DIV(TIMER_DIVIDER_SHIFT); |
247 | } | 241 | } |
248 | timer_ctrl_clrset(clr, set); | 242 | atomic_io_modify(timer_base + TIMER_CTRL_OFF, clr | set, set); |
249 | local_timer_ctrl_clrset(clr, set); | 243 | local_timer_ctrl_clrset(clr, set); |
250 | 244 | ||
251 | /* | 245 | /* |
@@ -263,7 +257,9 @@ static void __init armada_370_xp_timer_common_init(struct device_node *np) | |||
263 | writel(0xffffffff, timer_base + TIMER0_VAL_OFF); | 257 | writel(0xffffffff, timer_base + TIMER0_VAL_OFF); |
264 | writel(0xffffffff, timer_base + TIMER0_RELOAD_OFF); | 258 | writel(0xffffffff, timer_base + TIMER0_RELOAD_OFF); |
265 | 259 | ||
266 | timer_ctrl_clrset(0, TIMER0_RELOAD_EN | enable_mask); | 260 | atomic_io_modify(timer_base + TIMER_CTRL_OFF, |
261 | TIMER0_RELOAD_EN | enable_mask, | ||
262 | TIMER0_RELOAD_EN | enable_mask); | ||
267 | 263 | ||
268 | /* | 264 | /* |
269 | * Set scale and timer for sched_clock. | 265 | * Set scale and timer for sched_clock. |