|
@@ -91,7 +91,7 @@ struct r8a66597_ep {
|
|
|
|
|
|
struct r8a66597 {
|
|
struct r8a66597 {
|
|
spinlock_t lock;
|
|
spinlock_t lock;
|
|
- unsigned long reg;
|
|
|
|
|
|
+ void __iomem *reg;
|
|
|
|
|
|
#ifdef CONFIG_HAVE_CLK
|
|
#ifdef CONFIG_HAVE_CLK
|
|
struct clk *clk;
|
|
struct clk *clk;
|
|
@@ -127,7 +127,7 @@ struct r8a66597 {
|
|
|
|
|
|
static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset)
|
|
static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset)
|
|
{
|
|
{
|
|
- return inw(r8a66597->reg + offset);
|
|
|
|
|
|
+ return ioread16(r8a66597->reg + offset);
|
|
}
|
|
}
|
|
|
|
|
|
static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
@@ -135,7 +135,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
unsigned char *buf,
|
|
unsigned char *buf,
|
|
int len)
|
|
int len)
|
|
{
|
|
{
|
|
- unsigned long fifoaddr = r8a66597->reg + offset;
|
|
|
|
|
|
+ void __iomem *fifoaddr = r8a66597->reg + offset;
|
|
unsigned int data;
|
|
unsigned int data;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
@@ -144,7 +144,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
|
|
|
|
/* aligned buf case */
|
|
/* aligned buf case */
|
|
if (len >= 4 && !((unsigned long)buf & 0x03)) {
|
|
if (len >= 4 && !((unsigned long)buf & 0x03)) {
|
|
- insl(fifoaddr, buf, len / 4);
|
|
|
|
|
|
+ ioread32_rep(fifoaddr, buf, len / 4);
|
|
buf += len & ~0x03;
|
|
buf += len & ~0x03;
|
|
len &= 0x03;
|
|
len &= 0x03;
|
|
}
|
|
}
|
|
@@ -152,7 +152,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
/* unaligned buf case */
|
|
/* unaligned buf case */
|
|
for (i = 0; i < len; i++) {
|
|
for (i = 0; i < len; i++) {
|
|
if (!(i & 0x03))
|
|
if (!(i & 0x03))
|
|
- data = inl(fifoaddr);
|
|
|
|
|
|
+ data = ioread32(fifoaddr);
|
|
|
|
|
|
buf[i] = (data >> ((i & 0x03) * 8)) & 0xff;
|
|
buf[i] = (data >> ((i & 0x03) * 8)) & 0xff;
|
|
}
|
|
}
|
|
@@ -161,7 +161,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
|
|
|
|
/* aligned buf case */
|
|
/* aligned buf case */
|
|
if (len >= 2 && !((unsigned long)buf & 0x01)) {
|
|
if (len >= 2 && !((unsigned long)buf & 0x01)) {
|
|
- insw(fifoaddr, buf, len / 2);
|
|
|
|
|
|
+ ioread16_rep(fifoaddr, buf, len / 2);
|
|
buf += len & ~0x01;
|
|
buf += len & ~0x01;
|
|
len &= 0x01;
|
|
len &= 0x01;
|
|
}
|
|
}
|
|
@@ -169,7 +169,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
/* unaligned buf case */
|
|
/* unaligned buf case */
|
|
for (i = 0; i < len; i++) {
|
|
for (i = 0; i < len; i++) {
|
|
if (!(i & 0x01))
|
|
if (!(i & 0x01))
|
|
- data = inw(fifoaddr);
|
|
|
|
|
|
+ data = ioread16(fifoaddr);
|
|
|
|
|
|
buf[i] = (data >> ((i & 0x01) * 8)) & 0xff;
|
|
buf[i] = (data >> ((i & 0x01) * 8)) & 0xff;
|
|
}
|
|
}
|
|
@@ -179,7 +179,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
|
static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val,
|
|
static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val,
|
|
unsigned long offset)
|
|
unsigned long offset)
|
|
{
|
|
{
|
|
- outw(val, r8a66597->reg + offset);
|
|
|
|
|
|
+ iowrite16(val, r8a66597->reg + offset);
|
|
}
|
|
}
|
|
|
|
|
|
static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
|
|
static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
|
|
@@ -187,21 +187,21 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
|
|
unsigned char *buf,
|
|
unsigned char *buf,
|
|
int len)
|
|
int len)
|
|
{
|
|
{
|
|
- unsigned long fifoaddr = r8a66597->reg + offset;
|
|
|
|
|
|
+ void __iomem *fifoaddr = r8a66597->reg + offset;
|
|
int adj = 0;
|
|
int adj = 0;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
if (r8a66597->pdata->on_chip) {
|
|
if (r8a66597->pdata->on_chip) {
|
|
/* 32-bit access only if buf is 32-bit aligned */
|
|
/* 32-bit access only if buf is 32-bit aligned */
|
|
if (len >= 4 && !((unsigned long)buf & 0x03)) {
|
|
if (len >= 4 && !((unsigned long)buf & 0x03)) {
|
|
- outsl(fifoaddr, buf, len / 4);
|
|
|
|
|
|
+ iowrite32_rep(fifoaddr, buf, len / 4);
|
|
buf += len & ~0x03;
|
|
buf += len & ~0x03;
|
|
len &= 0x03;
|
|
len &= 0x03;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
/* 16-bit access only if buf is 16-bit aligned */
|
|
/* 16-bit access only if buf is 16-bit aligned */
|
|
if (len >= 2 && !((unsigned long)buf & 0x01)) {
|
|
if (len >= 2 && !((unsigned long)buf & 0x01)) {
|
|
- outsw(fifoaddr, buf, len / 2);
|
|
|
|
|
|
+ iowrite16_rep(fifoaddr, buf, len / 2);
|
|
buf += len & ~0x01;
|
|
buf += len & ~0x01;
|
|
len &= 0x01;
|
|
len &= 0x01;
|
|
}
|
|
}
|
|
@@ -216,7 +216,7 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
|
|
}
|
|
}
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
for (i = 0; i < len; i++)
|
|
- outb(buf[i], fifoaddr + adj - (i & adj));
|
|
|
|
|
|
+ iowrite8(buf[i], fifoaddr + adj - (i & adj));
|
|
}
|
|
}
|
|
|
|
|
|
static inline void r8a66597_mdfy(struct r8a66597 *r8a66597,
|
|
static inline void r8a66597_mdfy(struct r8a66597 *r8a66597,
|