Skip to content

Commit fdb06f6

Browse files
diandersdlezcano
authored andcommitted
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 <[email protected]> Signed-off-by: Kukjin Kim <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
1 parent a38b1f6 commit fdb06f6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/clocksource/exynos_mct.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static void exynos4_mct_write(unsigned int value, unsigned long offset)
9494
u32 mask;
9595
u32 i;
9696

97-
__raw_writel(value, reg_base + offset);
97+
writel_relaxed(value, reg_base + offset);
9898

9999
if (likely(offset >= EXYNOS4_MCT_L_BASE(0))) {
100100
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)
144144

145145
/* Wait maximum 1 ms until written values are applied */
146146
for (i = 0; i < loops_per_jiffy / 1000 * HZ; i++)
147-
if (__raw_readl(reg_base + stat_addr) & mask) {
148-
__raw_writel(mask, reg_base + stat_addr);
147+
if (readl_relaxed(reg_base + stat_addr) & mask) {
148+
writel_relaxed(mask, reg_base + stat_addr);
149149
return;
150150
}
151151

@@ -157,20 +157,20 @@ static void exynos4_mct_frc_start(void)
157157
{
158158
u32 reg;
159159

160-
reg = __raw_readl(reg_base + EXYNOS4_MCT_G_TCON);
160+
reg = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON);
161161
reg |= MCT_G_TCON_START;
162162
exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON);
163163
}
164164

165165
static cycle_t notrace _exynos4_frc_read(void)
166166
{
167167
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);
169169

170170
do {
171171
hi = hi2;
172-
lo = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_L);
173-
hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U);
172+
lo = readl_relaxed(reg_base + EXYNOS4_MCT_G_CNT_L);
173+
hi2 = readl_relaxed(reg_base + EXYNOS4_MCT_G_CNT_U);
174174
} while (hi != hi2);
175175

176176
return ((cycle_t)hi << 32) | lo;
@@ -225,7 +225,7 @@ static void exynos4_mct_comp0_stop(void)
225225
{
226226
unsigned int tcon;
227227

228-
tcon = __raw_readl(reg_base + EXYNOS4_MCT_G_TCON);
228+
tcon = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON);
229229
tcon &= ~(MCT_G_TCON_COMP0_ENABLE | MCT_G_TCON_COMP0_AUTO_INC);
230230

231231
exynos4_mct_write(tcon, EXYNOS4_MCT_G_TCON);
@@ -238,7 +238,7 @@ static void exynos4_mct_comp0_start(enum clock_event_mode mode,
238238
unsigned int tcon;
239239
cycle_t comp_cycle;
240240

241-
tcon = __raw_readl(reg_base + EXYNOS4_MCT_G_TCON);
241+
tcon = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON);
242242

243243
if (mode == CLOCK_EVT_MODE_PERIODIC) {
244244
tcon |= MCT_G_TCON_COMP0_AUTO_INC;
@@ -327,7 +327,7 @@ static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt)
327327
unsigned long mask = MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START;
328328
unsigned long offset = mevt->base + MCT_L_TCON_OFFSET;
329329

330-
tmp = __raw_readl(reg_base + offset);
330+
tmp = readl_relaxed(reg_base + offset);
331331
if (tmp & mask) {
332332
tmp &= ~mask;
333333
exynos4_mct_write(tmp, offset);
@@ -349,7 +349,7 @@ static void exynos4_mct_tick_start(unsigned long cycles,
349349
/* enable MCT tick interrupt */
350350
exynos4_mct_write(0x1, mevt->base + MCT_L_INT_ENB_OFFSET);
351351

352-
tmp = __raw_readl(reg_base + mevt->base + MCT_L_TCON_OFFSET);
352+
tmp = readl_relaxed(reg_base + mevt->base + MCT_L_TCON_OFFSET);
353353
tmp |= MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START |
354354
MCT_L_TCON_INTERVAL_MODE;
355355
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)
401401
exynos4_mct_tick_stop(mevt);
402402

403403
/* 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) {
405405
exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
406406
return 1;
407407
} else {

0 commit comments

Comments
 (0)