diff options
author | Doug Anderson <dianders@chromium.org> | 2014-07-04 17:43:20 -0400 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2014-07-23 06:02:40 -0400 |
commit | fdb06f66d53e3c9ba7eeab3c0629c450aee76937 (patch) | |
tree | 11a27107749d914ad555e51e75a59380d1bf5b69 | |
parent | a38b1f60b5245a3f610baac2019c0ecd8abd8752 (diff) |
clocksource: exynos_mct: Use readl_relaxed/writel_relaxed
Using the __raw functions is discouraged. Update the file to
consistently use the proper functions.
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r-- | drivers/clocksource/exynos_mct.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index ab51bf20a3ed..2df03e238c1b 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c | |||
@@ -94,7 +94,7 @@ static void exynos4_mct_write(unsigned int value, unsigned long offset) | |||
94 | u32 mask; | 94 | u32 mask; |
95 | u32 i; | 95 | u32 i; |
96 | 96 | ||
97 | __raw_writel(value, reg_base + offset); | 97 | writel_relaxed(value, reg_base + offset); |
98 | 98 | ||
99 | if (likely(offset >= EXYNOS4_MCT_L_BASE(0))) { | 99 | if (likely(offset >= EXYNOS4_MCT_L_BASE(0))) { |
100 | stat_addr = (offset & ~EXYNOS4_MCT_L_MASK) + MCT_L_WSTAT_OFFSET; | 100 | stat_addr = (offset & ~EXYNOS4_MCT_L_MASK) + MCT_L_WSTAT_OFFSET; |
@@ -144,8 +144,8 @@ static void exynos4_mct_write(unsigned int value, unsigned long offset) | |||
144 | 144 | ||
145 | /* Wait maximum 1 ms until written values are applied */ | 145 | /* Wait maximum 1 ms until written values are applied */ |
146 | for (i = 0; i < loops_per_jiffy / 1000 * HZ; i++) | 146 | for (i = 0; i < loops_per_jiffy / 1000 * HZ; i++) |
147 | if (__raw_readl(reg_base + stat_addr) & mask) { | 147 | if (readl_relaxed(reg_base + stat_addr) & mask) { |
148 | __raw_writel(mask, reg_base + stat_addr); | 148 | writel_relaxed(mask, reg_base + stat_addr); |
149 | return; | 149 | return; |
150 | } | 150 | } |
151 | 151 | ||
@@ -157,7 +157,7 @@ static void exynos4_mct_frc_start(void) | |||
157 | { | 157 | { |
158 | u32 reg; | 158 | u32 reg; |
159 | 159 | ||
160 | reg = __raw_readl(reg_base + EXYNOS4_MCT_G_TCON); | 160 | reg = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON); |
161 | reg |= MCT_G_TCON_START; | 161 | reg |= MCT_G_TCON_START; |
162 | exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); | 162 | exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); |
163 | } | 163 | } |
@@ -165,12 +165,12 @@ static void exynos4_mct_frc_start(void) | |||
165 | static cycle_t notrace _exynos4_frc_read(void) | 165 | static cycle_t notrace _exynos4_frc_read(void) |
166 | { | 166 | { |
167 | unsigned int lo, hi; | 167 | unsigned int lo, hi; |
168 | u32 hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U); | 168 | u32 hi2 = readl_relaxed(reg_base + EXYNOS4_MCT_G_CNT_U); |
169 | 169 | ||
170 | do { | 170 | do { |
171 | hi = hi2; | 171 | hi = hi2; |
172 | lo = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_L); | 172 | lo = readl_relaxed(reg_base + EXYNOS4_MCT_G_CNT_L); |
173 | hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U); | 173 | hi2 = readl_relaxed(reg_base + EXYNOS4_MCT_G_CNT_U); |
174 | } while (hi != hi2); | 174 | } while (hi != hi2); |
175 | 175 | ||
176 | return ((cycle_t)hi << 32) | lo; | 176 | return ((cycle_t)hi << 32) | lo; |
@@ -225,7 +225,7 @@ static void exynos4_mct_comp0_stop(void) | |||
225 | { | 225 | { |
226 | unsigned int tcon; | 226 | unsigned int tcon; |
227 | 227 | ||
228 | tcon = __raw_readl(reg_base + EXYNOS4_MCT_G_TCON); | 228 | tcon = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON); |
229 | tcon &= ~(MCT_G_TCON_COMP0_ENABLE | MCT_G_TCON_COMP0_AUTO_INC); | 229 | tcon &= ~(MCT_G_TCON_COMP0_ENABLE | MCT_G_TCON_COMP0_AUTO_INC); |
230 | 230 | ||
231 | exynos4_mct_write(tcon, EXYNOS4_MCT_G_TCON); | 231 | exynos4_mct_write(tcon, EXYNOS4_MCT_G_TCON); |
@@ -238,7 +238,7 @@ static void exynos4_mct_comp0_start(enum clock_event_mode mode, | |||
238 | unsigned int tcon; | 238 | unsigned int tcon; |
239 | cycle_t comp_cycle; | 239 | cycle_t comp_cycle; |
240 | 240 | ||
241 | tcon = __raw_readl(reg_base + EXYNOS4_MCT_G_TCON); | 241 | tcon = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON); |
242 | 242 | ||
243 | if (mode == CLOCK_EVT_MODE_PERIODIC) { | 243 | if (mode == CLOCK_EVT_MODE_PERIODIC) { |
244 | tcon |= MCT_G_TCON_COMP0_AUTO_INC; | 244 | tcon |= MCT_G_TCON_COMP0_AUTO_INC; |
@@ -327,7 +327,7 @@ static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt) | |||
327 | unsigned long mask = MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START; | 327 | unsigned long mask = MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START; |
328 | unsigned long offset = mevt->base + MCT_L_TCON_OFFSET; | 328 | unsigned long offset = mevt->base + MCT_L_TCON_OFFSET; |
329 | 329 | ||
330 | tmp = __raw_readl(reg_base + offset); | 330 | tmp = readl_relaxed(reg_base + offset); |
331 | if (tmp & mask) { | 331 | if (tmp & mask) { |
332 | tmp &= ~mask; | 332 | tmp &= ~mask; |
333 | exynos4_mct_write(tmp, offset); | 333 | exynos4_mct_write(tmp, offset); |
@@ -349,7 +349,7 @@ static void exynos4_mct_tick_start(unsigned long cycles, | |||
349 | /* enable MCT tick interrupt */ | 349 | /* enable MCT tick interrupt */ |
350 | exynos4_mct_write(0x1, mevt->base + MCT_L_INT_ENB_OFFSET); | 350 | exynos4_mct_write(0x1, mevt->base + MCT_L_INT_ENB_OFFSET); |
351 | 351 | ||
352 | tmp = __raw_readl(reg_base + mevt->base + MCT_L_TCON_OFFSET); | 352 | tmp = readl_relaxed(reg_base + mevt->base + MCT_L_TCON_OFFSET); |
353 | tmp |= MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START | | 353 | tmp |= MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START | |
354 | MCT_L_TCON_INTERVAL_MODE; | 354 | MCT_L_TCON_INTERVAL_MODE; |
355 | exynos4_mct_write(tmp, mevt->base + MCT_L_TCON_OFFSET); | 355 | exynos4_mct_write(tmp, mevt->base + MCT_L_TCON_OFFSET); |
@@ -401,7 +401,7 @@ static int exynos4_mct_tick_clear(struct mct_clock_event_device *mevt) | |||
401 | exynos4_mct_tick_stop(mevt); | 401 | exynos4_mct_tick_stop(mevt); |
402 | 402 | ||
403 | /* Clear the MCT tick interrupt */ | 403 | /* Clear the MCT tick interrupt */ |
404 | if (__raw_readl(reg_base + mevt->base + MCT_L_INT_CSTAT_OFFSET) & 1) { | 404 | if (readl_relaxed(reg_base + mevt->base + MCT_L_INT_CSTAT_OFFSET) & 1) { |
405 | exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET); | 405 | exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET); |
406 | return 1; | 406 | return 1; |
407 | } else { | 407 | } else { |