diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-06-02 03:32:12 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-06-02 03:32:12 -0400 |
commit | 019e2574f965b800ba76f319d817eae9405ae064 (patch) | |
tree | fbcf7ade183a8dd4a6c55a2596cf5cf47bbb76d4 /drivers/usb/gadget | |
parent | 4705b2e8047221142af2ed5e37f54ac4c7f80a7d (diff) | |
parent | 861160bfd097de7dbf3195bbef210e4f787327ab (diff) |
Merge branch 'sh/iomap'
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/m66592-udc.h | 22 | ||||
-rw-r--r-- | drivers/usb/gadget/r8a66597-udc.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/r8a66597-udc.h | 24 |
3 files changed, 25 insertions, 25 deletions
diff --git a/drivers/usb/gadget/m66592-udc.h b/drivers/usb/gadget/m66592-udc.h index 8b960deed680..c3caf1ac73ce 100644 --- a/drivers/usb/gadget/m66592-udc.h +++ b/drivers/usb/gadget/m66592-udc.h | |||
@@ -537,35 +537,35 @@ struct m66592 { | |||
537 | /*-------------------------------------------------------------------------*/ | 537 | /*-------------------------------------------------------------------------*/ |
538 | static inline u16 m66592_read(struct m66592 *m66592, unsigned long offset) | 538 | static inline u16 m66592_read(struct m66592 *m66592, unsigned long offset) |
539 | { | 539 | { |
540 | return inw((unsigned long)m66592->reg + offset); | 540 | return ioread16(m66592->reg + offset); |
541 | } | 541 | } |
542 | 542 | ||
543 | static inline void m66592_read_fifo(struct m66592 *m66592, | 543 | static inline void m66592_read_fifo(struct m66592 *m66592, |
544 | unsigned long offset, | 544 | unsigned long offset, |
545 | void *buf, unsigned long len) | 545 | void *buf, unsigned long len) |
546 | { | 546 | { |
547 | unsigned long fifoaddr = (unsigned long)m66592->reg + offset; | 547 | void __iomem *fifoaddr = m66592->reg + offset; |
548 | 548 | ||
549 | if (m66592->pdata->on_chip) { | 549 | if (m66592->pdata->on_chip) { |
550 | len = (len + 3) / 4; | 550 | len = (len + 3) / 4; |
551 | insl(fifoaddr, buf, len); | 551 | ioread32_rep(fifoaddr, buf, len); |
552 | } else { | 552 | } else { |
553 | len = (len + 1) / 2; | 553 | len = (len + 1) / 2; |
554 | insw(fifoaddr, buf, len); | 554 | ioread16_rep(fifoaddr, buf, len); |
555 | } | 555 | } |
556 | } | 556 | } |
557 | 557 | ||
558 | static inline void m66592_write(struct m66592 *m66592, u16 val, | 558 | static inline void m66592_write(struct m66592 *m66592, u16 val, |
559 | unsigned long offset) | 559 | unsigned long offset) |
560 | { | 560 | { |
561 | outw(val, (unsigned long)m66592->reg + offset); | 561 | iowrite16(val, m66592->reg + offset); |
562 | } | 562 | } |
563 | 563 | ||
564 | static inline void m66592_write_fifo(struct m66592 *m66592, | 564 | static inline void m66592_write_fifo(struct m66592 *m66592, |
565 | unsigned long offset, | 565 | unsigned long offset, |
566 | void *buf, unsigned long len) | 566 | void *buf, unsigned long len) |
567 | { | 567 | { |
568 | unsigned long fifoaddr = (unsigned long)m66592->reg + offset; | 568 | void __iomem *fifoaddr = m66592->reg + offset; |
569 | 569 | ||
570 | if (m66592->pdata->on_chip) { | 570 | if (m66592->pdata->on_chip) { |
571 | unsigned long count; | 571 | unsigned long count; |
@@ -573,25 +573,25 @@ static inline void m66592_write_fifo(struct m66592 *m66592, | |||
573 | int i; | 573 | int i; |
574 | 574 | ||
575 | count = len / 4; | 575 | count = len / 4; |
576 | outsl(fifoaddr, buf, count); | 576 | iowrite32_rep(fifoaddr, buf, count); |
577 | 577 | ||
578 | if (len & 0x00000003) { | 578 | if (len & 0x00000003) { |
579 | pb = buf + count * 4; | 579 | pb = buf + count * 4; |
580 | for (i = 0; i < (len & 0x00000003); i++) { | 580 | for (i = 0; i < (len & 0x00000003); i++) { |
581 | if (m66592_read(m66592, M66592_CFBCFG)) /* le */ | 581 | if (m66592_read(m66592, M66592_CFBCFG)) /* le */ |
582 | outb(pb[i], fifoaddr + (3 - i)); | 582 | iowrite8(pb[i], fifoaddr + (3 - i)); |
583 | else | 583 | else |
584 | outb(pb[i], fifoaddr + i); | 584 | iowrite8(pb[i], fifoaddr + i); |
585 | } | 585 | } |
586 | } | 586 | } |
587 | } else { | 587 | } else { |
588 | unsigned long odd = len & 0x0001; | 588 | unsigned long odd = len & 0x0001; |
589 | 589 | ||
590 | len = len / 2; | 590 | len = len / 2; |
591 | outsw(fifoaddr, buf, len); | 591 | iowrite16_rep(fifoaddr, buf, len); |
592 | if (odd) { | 592 | if (odd) { |
593 | unsigned char *p = buf + len*2; | 593 | unsigned char *p = buf + len*2; |
594 | outb(*p, fifoaddr); | 594 | iowrite8(*p, fifoaddr); |
595 | } | 595 | } |
596 | } | 596 | } |
597 | } | 597 | } |
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 888d8f166c0b..70a817842755 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c | |||
@@ -1500,7 +1500,7 @@ static int __exit r8a66597_remove(struct platform_device *pdev) | |||
1500 | struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev); | 1500 | struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev); |
1501 | 1501 | ||
1502 | del_timer_sync(&r8a66597->timer); | 1502 | del_timer_sync(&r8a66597->timer); |
1503 | iounmap((void *)r8a66597->reg); | 1503 | iounmap(r8a66597->reg); |
1504 | free_irq(platform_get_irq(pdev, 0), r8a66597); | 1504 | free_irq(platform_get_irq(pdev, 0), r8a66597); |
1505 | r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); | 1505 | r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); |
1506 | #ifdef CONFIG_HAVE_CLK | 1506 | #ifdef CONFIG_HAVE_CLK |
@@ -1578,7 +1578,7 @@ static int __init r8a66597_probe(struct platform_device *pdev) | |||
1578 | init_timer(&r8a66597->timer); | 1578 | init_timer(&r8a66597->timer); |
1579 | r8a66597->timer.function = r8a66597_timer; | 1579 | r8a66597->timer.function = r8a66597_timer; |
1580 | r8a66597->timer.data = (unsigned long)r8a66597; | 1580 | r8a66597->timer.data = (unsigned long)r8a66597; |
1581 | r8a66597->reg = (unsigned long)reg; | 1581 | r8a66597->reg = reg; |
1582 | 1582 | ||
1583 | #ifdef CONFIG_HAVE_CLK | 1583 | #ifdef CONFIG_HAVE_CLK |
1584 | if (r8a66597->pdata->on_chip) { | 1584 | if (r8a66597->pdata->on_chip) { |
diff --git a/drivers/usb/gadget/r8a66597-udc.h b/drivers/usb/gadget/r8a66597-udc.h index 9a537aa07968..f763b5190afa 100644 --- a/drivers/usb/gadget/r8a66597-udc.h +++ b/drivers/usb/gadget/r8a66597-udc.h | |||
@@ -91,7 +91,7 @@ struct r8a66597_ep { | |||
91 | 91 | ||
92 | struct r8a66597 { | 92 | struct r8a66597 { |
93 | spinlock_t lock; | 93 | spinlock_t lock; |
94 | unsigned long reg; | 94 | void __iomem *reg; |
95 | 95 | ||
96 | #ifdef CONFIG_HAVE_CLK | 96 | #ifdef CONFIG_HAVE_CLK |
97 | struct clk *clk; | 97 | struct clk *clk; |
@@ -127,7 +127,7 @@ struct r8a66597 { | |||
127 | 127 | ||
128 | static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset) | 128 | static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset) |
129 | { | 129 | { |
130 | return inw(r8a66597->reg + offset); | 130 | return ioread16(r8a66597->reg + offset); |
131 | } | 131 | } |
132 | 132 | ||
133 | static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | 133 | static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, |
@@ -135,7 +135,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
135 | unsigned char *buf, | 135 | unsigned char *buf, |
136 | int len) | 136 | int len) |
137 | { | 137 | { |
138 | unsigned long fifoaddr = r8a66597->reg + offset; | 138 | void __iomem *fifoaddr = r8a66597->reg + offset; |
139 | unsigned int data; | 139 | unsigned int data; |
140 | int i; | 140 | int i; |
141 | 141 | ||
@@ -144,7 +144,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
144 | 144 | ||
145 | /* aligned buf case */ | 145 | /* aligned buf case */ |
146 | if (len >= 4 && !((unsigned long)buf & 0x03)) { | 146 | if (len >= 4 && !((unsigned long)buf & 0x03)) { |
147 | insl(fifoaddr, buf, len / 4); | 147 | ioread32_rep(fifoaddr, buf, len / 4); |
148 | buf += len & ~0x03; | 148 | buf += len & ~0x03; |
149 | len &= 0x03; | 149 | len &= 0x03; |
150 | } | 150 | } |
@@ -152,7 +152,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
152 | /* unaligned buf case */ | 152 | /* unaligned buf case */ |
153 | for (i = 0; i < len; i++) { | 153 | for (i = 0; i < len; i++) { |
154 | if (!(i & 0x03)) | 154 | if (!(i & 0x03)) |
155 | data = inl(fifoaddr); | 155 | data = ioread32(fifoaddr); |
156 | 156 | ||
157 | buf[i] = (data >> ((i & 0x03) * 8)) & 0xff; | 157 | buf[i] = (data >> ((i & 0x03) * 8)) & 0xff; |
158 | } | 158 | } |
@@ -161,7 +161,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
161 | 161 | ||
162 | /* aligned buf case */ | 162 | /* aligned buf case */ |
163 | if (len >= 2 && !((unsigned long)buf & 0x01)) { | 163 | if (len >= 2 && !((unsigned long)buf & 0x01)) { |
164 | insw(fifoaddr, buf, len / 2); | 164 | ioread16_rep(fifoaddr, buf, len / 2); |
165 | buf += len & ~0x01; | 165 | buf += len & ~0x01; |
166 | len &= 0x01; | 166 | len &= 0x01; |
167 | } | 167 | } |
@@ -169,7 +169,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
169 | /* unaligned buf case */ | 169 | /* unaligned buf case */ |
170 | for (i = 0; i < len; i++) { | 170 | for (i = 0; i < len; i++) { |
171 | if (!(i & 0x01)) | 171 | if (!(i & 0x01)) |
172 | data = inw(fifoaddr); | 172 | data = ioread16(fifoaddr); |
173 | 173 | ||
174 | buf[i] = (data >> ((i & 0x01) * 8)) & 0xff; | 174 | buf[i] = (data >> ((i & 0x01) * 8)) & 0xff; |
175 | } | 175 | } |
@@ -179,7 +179,7 @@ static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597, | |||
179 | static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val, | 179 | static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val, |
180 | unsigned long offset) | 180 | unsigned long offset) |
181 | { | 181 | { |
182 | outw(val, r8a66597->reg + offset); | 182 | iowrite16(val, r8a66597->reg + offset); |
183 | } | 183 | } |
184 | 184 | ||
185 | static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, | 185 | static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, |
@@ -187,21 +187,21 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, | |||
187 | unsigned char *buf, | 187 | unsigned char *buf, |
188 | int len) | 188 | int len) |
189 | { | 189 | { |
190 | unsigned long fifoaddr = r8a66597->reg + offset; | 190 | void __iomem *fifoaddr = r8a66597->reg + offset; |
191 | int adj = 0; | 191 | int adj = 0; |
192 | int i; | 192 | int i; |
193 | 193 | ||
194 | if (r8a66597->pdata->on_chip) { | 194 | if (r8a66597->pdata->on_chip) { |
195 | /* 32-bit access only if buf is 32-bit aligned */ | 195 | /* 32-bit access only if buf is 32-bit aligned */ |
196 | if (len >= 4 && !((unsigned long)buf & 0x03)) { | 196 | if (len >= 4 && !((unsigned long)buf & 0x03)) { |
197 | outsl(fifoaddr, buf, len / 4); | 197 | iowrite32_rep(fifoaddr, buf, len / 4); |
198 | buf += len & ~0x03; | 198 | buf += len & ~0x03; |
199 | len &= 0x03; | 199 | len &= 0x03; |
200 | } | 200 | } |
201 | } else { | 201 | } else { |
202 | /* 16-bit access only if buf is 16-bit aligned */ | 202 | /* 16-bit access only if buf is 16-bit aligned */ |
203 | if (len >= 2 && !((unsigned long)buf & 0x01)) { | 203 | if (len >= 2 && !((unsigned long)buf & 0x01)) { |
204 | outsw(fifoaddr, buf, len / 2); | 204 | iowrite16_rep(fifoaddr, buf, len / 2); |
205 | buf += len & ~0x01; | 205 | buf += len & ~0x01; |
206 | len &= 0x01; | 206 | len &= 0x01; |
207 | } | 207 | } |
@@ -216,7 +216,7 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597, | |||
216 | } | 216 | } |
217 | 217 | ||
218 | for (i = 0; i < len; i++) | 218 | for (i = 0; i < len; i++) |
219 | outb(buf[i], fifoaddr + adj - (i & adj)); | 219 | iowrite8(buf[i], fifoaddr + adj - (i & adj)); |
220 | } | 220 | } |
221 | 221 | ||
222 | static inline void r8a66597_mdfy(struct r8a66597 *r8a66597, | 222 | static inline void r8a66597_mdfy(struct r8a66597 *r8a66597, |