Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200101
b: refs/heads/master
c: e8b4866
h: refs/heads/master
i:
  200099: 47f6e9e
v: v3
  • Loading branch information
Paul Mundt committed Jun 2, 2010
1 parent 209a70f commit d628766
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 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: abb24f4846d1537d73605e8576de8359a98e5ced
refs/heads/master: e8b48669de54d390644c77cd26d5c9fccbc1e0a1
4 changes: 2 additions & 2 deletions trunk/drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ static int __exit r8a66597_remove(struct platform_device *pdev)
struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev);

del_timer_sync(&r8a66597->timer);
iounmap((void *)r8a66597->reg);
iounmap(r8a66597->reg);
free_irq(platform_get_irq(pdev, 0), r8a66597);
r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req);
#ifdef CONFIG_HAVE_CLK
Expand Down Expand Up @@ -1578,7 +1578,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
init_timer(&r8a66597->timer);
r8a66597->timer.function = r8a66597_timer;
r8a66597->timer.data = (unsigned long)r8a66597;
r8a66597->reg = (unsigned long)reg;
r8a66597->reg = reg;

#ifdef CONFIG_HAVE_CLK
if (r8a66597->pdata->on_chip) {
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/usb/gadget/r8a66597-udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct r8a66597_ep {

struct r8a66597 {
spinlock_t lock;
unsigned long reg;
void __iomem *reg;

#ifdef CONFIG_HAVE_CLK
struct clk *clk;
Expand Down Expand Up @@ -127,15 +127,15 @@ struct r8a66597 {

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,
unsigned long offset,
unsigned char *buf,
int len)
{
unsigned long fifoaddr = r8a66597->reg + offset;
void __iomem *fifoaddr = r8a66597->reg + offset;
unsigned int data;
int i;

Expand All @@ -144,15 +144,15 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,

/* aligned buf case */
if (len >= 4 && !((unsigned long)buf & 0x03)) {
insl(fifoaddr, buf, len / 4);
ioread32_rep(fifoaddr, buf, len / 4);
buf += len & ~0x03;
len &= 0x03;
}

/* unaligned buf case */
for (i = 0; i < len; i++) {
if (!(i & 0x03))
data = inl(fifoaddr);
data = ioread32(fifoaddr);

buf[i] = (data >> ((i & 0x03) * 8)) & 0xff;
}
Expand All @@ -161,15 +161,15 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,

/* aligned buf case */
if (len >= 2 && !((unsigned long)buf & 0x01)) {
insw(fifoaddr, buf, len / 2);
ioread16_rep(fifoaddr, buf, len / 2);
buf += len & ~0x01;
len &= 0x01;
}

/* unaligned buf case */
for (i = 0; i < len; i++) {
if (!(i & 0x01))
data = inw(fifoaddr);
data = ioread16(fifoaddr);

buf[i] = (data >> ((i & 0x01) * 8)) & 0xff;
}
Expand All @@ -179,29 +179,29 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val,
unsigned long offset)
{
outw(val, r8a66597->reg + offset);
iowrite16(val, r8a66597->reg + offset);
}

static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
unsigned long offset,
unsigned char *buf,
int len)
{
unsigned long fifoaddr = r8a66597->reg + offset;
void __iomem *fifoaddr = r8a66597->reg + offset;
int adj = 0;
int i;

if (r8a66597->pdata->on_chip) {
/* 32-bit access only if buf is 32-bit aligned */
if (len >= 4 && !((unsigned long)buf & 0x03)) {
outsl(fifoaddr, buf, len / 4);
iowrite32_rep(fifoaddr, buf, len / 4);
buf += len & ~0x03;
len &= 0x03;
}
} else {
/* 16-bit access only if buf is 16-bit aligned */
if (len >= 2 && !((unsigned long)buf & 0x01)) {
outsw(fifoaddr, buf, len / 2);
iowrite16_rep(fifoaddr, buf, len / 2);
buf += len & ~0x01;
len &= 0x01;
}
Expand All @@ -216,7 +216,7 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
}

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,
Expand Down

0 comments on commit d628766

Please sign in to comment.