aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/m66592-udc.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/m66592-udc.h')
-rw-r--r--drivers/usb/gadget/m66592-udc.h40
1 files changed, 22 insertions, 18 deletions
diff --git a/drivers/usb/gadget/m66592-udc.h b/drivers/usb/gadget/m66592-udc.h
index c3caf1ac73ce..7b93d579af37 100644
--- a/drivers/usb/gadget/m66592-udc.h
+++ b/drivers/usb/gadget/m66592-udc.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2006-2007 Renesas Solutions Corp. 4 * Copyright (C) 2006-2007 Renesas Solutions Corp.
5 * 5 *
6 * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> 6 * Author : Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -561,11 +561,26 @@ static inline void m66592_write(struct m66592 *m66592, u16 val,
561 iowrite16(val, m66592->reg + offset); 561 iowrite16(val, m66592->reg + offset);
562} 562}
563 563
564static inline void m66592_mdfy(struct m66592 *m66592, u16 val, u16 pat,
565 unsigned long offset)
566{
567 u16 tmp;
568 tmp = m66592_read(m66592, offset);
569 tmp = tmp & (~pat);
570 tmp = tmp | val;
571 m66592_write(m66592, tmp, offset);
572}
573
574#define m66592_bclr(m66592, val, offset) \
575 m66592_mdfy(m66592, 0, val, offset)
576#define m66592_bset(m66592, val, offset) \
577 m66592_mdfy(m66592, val, 0, offset)
578
564static inline void m66592_write_fifo(struct m66592 *m66592, 579static inline void m66592_write_fifo(struct m66592 *m66592,
565 unsigned long offset, 580 struct m66592_ep *ep,
566 void *buf, unsigned long len) 581 void *buf, unsigned long len)
567{ 582{
568 void __iomem *fifoaddr = m66592->reg + offset; 583 void __iomem *fifoaddr = m66592->reg + ep->fifoaddr;
569 584
570 if (m66592->pdata->on_chip) { 585 if (m66592->pdata->on_chip) {
571 unsigned long count; 586 unsigned long count;
@@ -591,26 +606,15 @@ static inline void m66592_write_fifo(struct m66592 *m66592,
591 iowrite16_rep(fifoaddr, buf, len); 606 iowrite16_rep(fifoaddr, buf, len);
592 if (odd) { 607 if (odd) {
593 unsigned char *p = buf + len*2; 608 unsigned char *p = buf + len*2;
609 if (m66592->pdata->wr0_shorted_to_wr1)
610 m66592_bclr(m66592, M66592_MBW_16, ep->fifosel);
594 iowrite8(*p, fifoaddr); 611 iowrite8(*p, fifoaddr);
612 if (m66592->pdata->wr0_shorted_to_wr1)
613 m66592_bset(m66592, M66592_MBW_16, ep->fifosel);
595 } 614 }
596 } 615 }
597} 616}
598 617
599static inline void m66592_mdfy(struct m66592 *m66592, u16 val, u16 pat,
600 unsigned long offset)
601{
602 u16 tmp;
603 tmp = m66592_read(m66592, offset);
604 tmp = tmp & (~pat);
605 tmp = tmp | val;
606 m66592_write(m66592, tmp, offset);
607}
608
609#define m66592_bclr(m66592, val, offset) \
610 m66592_mdfy(m66592, 0, val, offset)
611#define m66592_bset(m66592, val, offset) \
612 m66592_mdfy(m66592, val, 0, offset)
613
614#endif /* ifndef __M66592_UDC_H__ */ 618#endif /* ifndef __M66592_UDC_H__ */
615 619
616 620