summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/musbhsdma.h
diff options
context:
space:
mode:
authorAnand Gadiyar <gadiyar@ti.com>2009-12-28 13:40:35 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 14:53:41 -0800
commit452f0394376d2cc882e4c4a593fc290c042799a9 (patch)
tree0071878a06df34b5245d181f41833a14ca4e2918 /drivers/usb/musb/musbhsdma.h
parent3b151526eda87901532390e11bba0dd59119f667 (diff)
downloadlinux-3.10-452f0394376d2cc882e4c4a593fc290c042799a9.tar.gz
linux-3.10-452f0394376d2cc882e4c4a593fc290c042799a9.tar.bz2
linux-3.10-452f0394376d2cc882e4c4a593fc290c042799a9.zip
usb: musb: hsdma: add wrapper for reading DMA count
Add a wrapper for reading the DMA count register, analogous to the one for writing to this register. Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: Vikram Pandita <vikram.pandita@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/musbhsdma.h')
-rw-r--r--drivers/usb/musb/musbhsdma.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h
index 1299d92dc83..613f95a058f 100644
--- a/drivers/usb/musb/musbhsdma.h
+++ b/drivers/usb/musb/musbhsdma.h
@@ -55,6 +55,10 @@
MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDRESS), \
addr)
+#define musb_read_hsdma_count(mbase, bchannel) \
+ musb_readl(mbase, \
+ MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT))
+
#define musb_write_hsdma_count(mbase, bchannel, len) \
musb_writel(mbase, \
MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT), \
@@ -96,6 +100,19 @@ static inline void musb_write_hsdma_addr(void __iomem *mbase,
((u16)(((u32) dma_addr >> 16) & 0xFFFF)));
}
+static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel)
+{
+ u32 count = musb_readw(mbase,
+ MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH));
+
+ count = count << 16;
+
+ count |= musb_readw(mbase,
+ MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW));
+
+ return count;
+}
+
static inline void musb_write_hsdma_count(void __iomem *mbase,
u8 bchannel, u32 len)
{