* [PATCH 4/7] clocksource: sh_*: restore big-endian operation.
@ 2012-03-09 16:38 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2012-03-09 16:38 UTC (permalink / raw)
To: linux-sh
As of 37b7a97884ba64bf7d403351ac2a9476ab4f1bba we have to use the
endianess-agnostic I/O accessor functions.
I have only tested sh_tmu on both litte-endian and big-endian sh7785lcr; I'm
changing the other two analoguously.
Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
drivers/clocksource/sh_cmt.c | 8 ++++----
drivers/clocksource/sh_mtu2.c | 12 ++++++------
drivers/clocksource/sh_tmu.c | 12 ++++++------
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index ca09bc4..157f684 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -77,10 +77,10 @@ static inline unsigned long sh_cmt_read(struct sh_cmt_priv *p, int reg_nr)
else {
offs <<= 2;
if ((reg_nr = CMCNT) || (reg_nr = CMCOR))
- return ioread32(base + offs);
+ return __raw_readl(base + offs);
}
- return ioread16(base + offs);
+ return __raw_readw(base + offs);
}
static inline void sh_cmt_write(struct sh_cmt_priv *p, int reg_nr,
@@ -101,12 +101,12 @@ static inline void sh_cmt_write(struct sh_cmt_priv *p, int reg_nr,
else {
offs <<= 2;
if ((reg_nr = CMCNT) || (reg_nr = CMCOR)) {
- iowrite32(value, base + offs);
+ __raw_writel(value, base + offs);
return;
}
}
- iowrite16(value, base + offs);
+ __raw_writew(value, base + offs);
}
static unsigned long sh_cmt_get_counter(struct sh_cmt_priv *p,
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
index db8d595..f61193e 100644
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -70,14 +70,14 @@ static inline unsigned long sh_mtu2_read(struct sh_mtu2_priv *p, int reg_nr)
unsigned long offs;
if (reg_nr = TSTR)
- return ioread8(base + cfg->channel_offset);
+ return __raw_readb(base + cfg->channel_offset);
offs = mtu2_reg_offs[reg_nr];
if ((reg_nr = TCNT) || (reg_nr = TGR))
- return ioread16(base + offs);
+ return __raw_readw(base + offs);
else
- return ioread8(base + offs);
+ return __raw_readb(base + offs);
}
static inline void sh_mtu2_write(struct sh_mtu2_priv *p, int reg_nr,
@@ -88,16 +88,16 @@ static inline void sh_mtu2_write(struct sh_mtu2_priv *p, int reg_nr,
unsigned long offs;
if (reg_nr = TSTR) {
- iowrite8(value, base + cfg->channel_offset);
+ __raw_writeb(value, base + cfg->channel_offset);
return;
}
offs = mtu2_reg_offs[reg_nr];
if ((reg_nr = TCNT) || (reg_nr = TGR))
- iowrite16(value, base + offs);
+ __raw_writew(value, base + offs);
else
- iowrite8(value, base + offs);
+ __raw_writeb(value, base + offs);
}
static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start)
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 079e96a..88c97f9 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -58,14 +58,14 @@ static inline unsigned long sh_tmu_read(struct sh_tmu_priv *p, int reg_nr)
unsigned long offs;
if (reg_nr = TSTR)
- return ioread8(base - cfg->channel_offset);
+ return __raw_readb(base - cfg->channel_offset);
offs = reg_nr << 2;
if (reg_nr = TCR)
- return ioread16(base + offs);
+ return __raw_readw(base + offs);
else
- return ioread32(base + offs);
+ return __raw_readl(base + offs);
}
static inline void sh_tmu_write(struct sh_tmu_priv *p, int reg_nr,
@@ -76,16 +76,16 @@ static inline void sh_tmu_write(struct sh_tmu_priv *p, int reg_nr,
unsigned long offs;
if (reg_nr = TSTR) {
- iowrite8(value, base - cfg->channel_offset);
+ __raw_writeb(value, base - cfg->channel_offset);
return;
}
offs = reg_nr << 2;
if (reg_nr = TCR)
- iowrite16(value, base + offs);
+ __raw_writew(value, base + offs);
else
- iowrite32(value, base + offs);
+ __raw_writel(value, base + offs);
}
static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start)
--
1.7.4.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-09 16:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09 16:38 [PATCH 4/7] clocksource: sh_*: restore big-endian operation Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).