diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-06-02 03:26:13 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-06-02 03:26:13 -0400 |
commit | abb24f4846d1537d73605e8576de8359a98e5ced (patch) | |
tree | 289caac25714550926277d4624b4ecbb396c065d /drivers/usb/gadget/m66592-udc.h | |
parent | 4b3fb4e79cc3e40ec033a77f1b3d81e7851a6cf5 (diff) |
usb: gadget: m66592-udc pio to mmio accessor conversion.
m66592-udc is erroneously using PIO routines on MMIO registers, which
presently blows up for any platform that elects to either override or do
away with PIO routines. This managed to work for the common cases since
the PIO routines were simply wrapped to their MMIO counterparts. This
switches over to using the MMIO routines directly, and enables us to kill
off a lot of superfluous casting in the process.
Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/usb/gadget/m66592-udc.h')
-rw-r--r-- | drivers/usb/gadget/m66592-udc.h | 22 |
1 files changed, 11 insertions, 11 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 | } |