Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200100
b: refs/heads/master
c: abb24f4
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Jun 2, 2010
1 parent 47f6e9e commit 209a70f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b3fb4e79cc3e40ec033a77f1b3d81e7851a6cf5
refs/heads/master: abb24f4846d1537d73605e8576de8359a98e5ced
22 changes: 11 additions & 11 deletions trunk/drivers/usb/gadget/m66592-udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,61 +537,61 @@ struct m66592 {
/*-------------------------------------------------------------------------*/
static inline u16 m66592_read(struct m66592 *m66592, unsigned long offset)
{
return inw((unsigned long)m66592->reg + offset);
return ioread16(m66592->reg + offset);
}

static inline void m66592_read_fifo(struct m66592 *m66592,
unsigned long offset,
void *buf, unsigned long len)
{
unsigned long fifoaddr = (unsigned long)m66592->reg + offset;
void __iomem *fifoaddr = m66592->reg + offset;

if (m66592->pdata->on_chip) {
len = (len + 3) / 4;
insl(fifoaddr, buf, len);
ioread32_rep(fifoaddr, buf, len);
} else {
len = (len + 1) / 2;
insw(fifoaddr, buf, len);
ioread16_rep(fifoaddr, buf, len);
}
}

static inline void m66592_write(struct m66592 *m66592, u16 val,
unsigned long offset)
{
outw(val, (unsigned long)m66592->reg + offset);
iowrite16(val, m66592->reg + offset);
}

static inline void m66592_write_fifo(struct m66592 *m66592,
unsigned long offset,
void *buf, unsigned long len)
{
unsigned long fifoaddr = (unsigned long)m66592->reg + offset;
void __iomem *fifoaddr = m66592->reg + offset;

if (m66592->pdata->on_chip) {
unsigned long count;
unsigned char *pb;
int i;

count = len / 4;
outsl(fifoaddr, buf, count);
iowrite32_rep(fifoaddr, buf, count);

if (len & 0x00000003) {
pb = buf + count * 4;
for (i = 0; i < (len & 0x00000003); i++) {
if (m66592_read(m66592, M66592_CFBCFG)) /* le */
outb(pb[i], fifoaddr + (3 - i));
iowrite8(pb[i], fifoaddr + (3 - i));
else
outb(pb[i], fifoaddr + i);
iowrite8(pb[i], fifoaddr + i);
}
}
} else {
unsigned long odd = len & 0x0001;

len = len / 2;
outsw(fifoaddr, buf, len);
iowrite16_rep(fifoaddr, buf, len);
if (odd) {
unsigned char *p = buf + len*2;
outb(*p, fifoaddr);
iowrite8(*p, fifoaddr);
}
}
}
Expand Down

0 comments on commit 209a70f

Please sign in to comment.