diff options
Diffstat (limited to 'drivers/usb/musb/musbhsdma.h')
-rw-r--r-- | drivers/usb/musb/musbhsdma.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h index 1299d92dc83f..613f95a058f7 100644 --- a/drivers/usb/musb/musbhsdma.h +++ b/drivers/usb/musb/musbhsdma.h | |||
@@ -55,6 +55,10 @@ | |||
55 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDRESS), \ | 55 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDRESS), \ |
56 | addr) | 56 | addr) |
57 | 57 | ||
58 | #define musb_read_hsdma_count(mbase, bchannel) \ | ||
59 | musb_readl(mbase, \ | ||
60 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT)) | ||
61 | |||
58 | #define musb_write_hsdma_count(mbase, bchannel, len) \ | 62 | #define musb_write_hsdma_count(mbase, bchannel, len) \ |
59 | musb_writel(mbase, \ | 63 | musb_writel(mbase, \ |
60 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT), \ | 64 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT), \ |
@@ -96,6 +100,19 @@ static inline void musb_write_hsdma_addr(void __iomem *mbase, | |||
96 | ((u16)(((u32) dma_addr >> 16) & 0xFFFF))); | 100 | ((u16)(((u32) dma_addr >> 16) & 0xFFFF))); |
97 | } | 101 | } |
98 | 102 | ||
103 | static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel) | ||
104 | { | ||
105 | u32 count = musb_readw(mbase, | ||
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 | } | ||
115 | |||
99 | static inline void musb_write_hsdma_count(void __iomem *mbase, | 116 | static inline void musb_write_hsdma_count(void __iomem *mbase, |
100 | u8 bchannel, u32 len) | 117 | u8 bchannel, u32 len) |
101 | { | 118 | { |