aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@nokia.com>2010-03-12 03:29:13 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:32 -0400
commitddb495d4d81dee4fdd96ae397d60ddefd65204c6 (patch)
tree377411bdbd9d73e1f5ed3384107071d88a69b1c4 /drivers/usb/musb
parentca4b2532fb0e2d62370d9825147ffa9b9d9e3880 (diff)
usb: musb: hsdma: use musb_read/writel
... and simplify the was we read/write from/to DMA COUNT register. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musbhsdma.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h
index 613f95a058f7..f763d62f151c 100644
--- a/drivers/usb/musb/musbhsdma.h
+++ b/drivers/usb/musb/musbhsdma.h
@@ -102,26 +102,16 @@ static inline void musb_write_hsdma_addr(void __iomem *mbase,
102 102
103static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel) 103static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel)
104{ 104{
105 u32 count = musb_readw(mbase, 105 return musb_readl(mbase,
106 MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH)); 106 MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH));
107
108 count = count << 16;
109
110 count |= musb_readw(mbase,
111 MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW));
112
113 return count;
114} 107}
115 108
116static inline void musb_write_hsdma_count(void __iomem *mbase, 109static inline void musb_write_hsdma_count(void __iomem *mbase,
117 u8 bchannel, u32 len) 110 u8 bchannel, u32 len)
118{ 111{
119 musb_writew(mbase, 112 musb_writel(mbase,
120 MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW),
121 ((u16)((u32) len & 0xFFFF)));
122 musb_writew(mbase,
123 MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH), 113 MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH),
124 ((u16)(((u32) len >> 16) & 0xFFFF))); 114 len);
125} 115}
126 116
127#endif /* CONFIG_BLACKFIN */ 117#endif /* CONFIG_BLACKFIN */