Skip to content

Commit

Permalink
clocksource/drivers/samsung_pwm_timer: Fix endian accessors
Browse files Browse the repository at this point in the history
Fix the Samsung pwm timer access code to deal with kernels built for big
endian operation.

Signed-off-by: Matthew Leach <matthew@mattleach.net>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
  • Loading branch information
Matthew Leach authored and Daniel Lezcano committed Jun 28, 2016
1 parent 48419b1 commit 7cc0617
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/clocksource/samsung_pwm_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ static void samsung_time_stop(unsigned int channel)

spin_lock_irqsave(&samsung_pwm_lock, flags);

tcon = __raw_readl(pwm.base + REG_TCON);
tcon = readl_relaxed(pwm.base + REG_TCON);
tcon &= ~TCON_START(channel);
__raw_writel(tcon, pwm.base + REG_TCON);
writel_relaxed(tcon, pwm.base + REG_TCON);

spin_unlock_irqrestore(&samsung_pwm_lock, flags);
}
Expand All @@ -148,14 +148,14 @@ static void samsung_time_setup(unsigned int channel, unsigned long tcnt)

spin_lock_irqsave(&samsung_pwm_lock, flags);

tcon = __raw_readl(pwm.base + REG_TCON);
tcon = readl_relaxed(pwm.base + REG_TCON);

tcon &= ~(TCON_START(tcon_chan) | TCON_AUTORELOAD(tcon_chan));
tcon |= TCON_MANUALUPDATE(tcon_chan);

__raw_writel(tcnt, pwm.base + REG_TCNTB(channel));
__raw_writel(tcnt, pwm.base + REG_TCMPB(channel));
__raw_writel(tcon, pwm.base + REG_TCON);
writel_relaxed(tcnt, pwm.base + REG_TCNTB(channel));
writel_relaxed(tcnt, pwm.base + REG_TCMPB(channel));
writel_relaxed(tcon, pwm.base + REG_TCON);

spin_unlock_irqrestore(&samsung_pwm_lock, flags);
}
Expand All @@ -170,7 +170,7 @@ static void samsung_time_start(unsigned int channel, bool periodic)

spin_lock_irqsave(&samsung_pwm_lock, flags);

tcon = __raw_readl(pwm.base + REG_TCON);
tcon = readl_relaxed(pwm.base + REG_TCON);

tcon &= ~TCON_MANUALUPDATE(channel);
tcon |= TCON_START(channel);
Expand All @@ -180,7 +180,7 @@ static void samsung_time_start(unsigned int channel, bool periodic)
else
tcon &= ~TCON_AUTORELOAD(channel);

__raw_writel(tcon, pwm.base + REG_TCON);
writel_relaxed(tcon, pwm.base + REG_TCON);

spin_unlock_irqrestore(&samsung_pwm_lock, flags);
}
Expand Down

0 comments on commit 7cc0617

Please sign in to comment.