diff options
author | Bob Liu <lliubbo@gmail.com> | 2011-01-05 04:36:41 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-02-01 03:41:30 -0500 |
commit | 9c668079c864c3b49d8deb56dafedf916b2a72d0 (patch) | |
tree | 0b9382dce810f6642e1f06229ac3dc6afb98bd4b /drivers/usb/musb/musbhsdma.h | |
parent | 541079de88735152a993ff93e90096643730a054 (diff) |
usb: musb: hsdma: change back to use musb_read/writew
Blackfin platform doesn't support 32bits musbdma registers, so change back to
use musb_read/writew instead of musb_read/writel and simply some format casts.
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musbhsdma.h')
-rw-r--r-- | drivers/usb/musb/musbhsdma.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h index f763d62f151c..21056c924c74 100644 --- a/drivers/usb/musb/musbhsdma.h +++ b/drivers/usb/musb/musbhsdma.h | |||
@@ -94,24 +94,33 @@ static inline void musb_write_hsdma_addr(void __iomem *mbase, | |||
94 | { | 94 | { |
95 | musb_writew(mbase, | 95 | musb_writew(mbase, |
96 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_LOW), | 96 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_LOW), |
97 | ((u16)((u32) dma_addr & 0xFFFF))); | 97 | dma_addr); |
98 | musb_writew(mbase, | 98 | musb_writew(mbase, |
99 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_HIGH), | 99 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDR_HIGH), |
100 | ((u16)(((u32) dma_addr >> 16) & 0xFFFF))); | 100 | (dma_addr >> 16)); |
101 | } | 101 | } |
102 | 102 | ||
103 | static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel) | 103 | static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel) |
104 | { | 104 | { |
105 | return musb_readl(mbase, | 105 | u32 count = musb_readw(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; | ||
107 | } | 114 | } |
108 | 115 | ||
109 | static inline void musb_write_hsdma_count(void __iomem *mbase, | 116 | static inline void musb_write_hsdma_count(void __iomem *mbase, |
110 | u8 bchannel, u32 len) | 117 | u8 bchannel, u32 len) |
111 | { | 118 | { |
112 | musb_writel(mbase, | 119 | musb_writew(mbase, |
120 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW),len); | ||
121 | musb_writew(mbase, | ||
113 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH), | 122 | MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH), |
114 | len); | 123 | (len >> 16)); |
115 | } | 124 | } |
116 | 125 | ||
117 | #endif /* CONFIG_BLACKFIN */ | 126 | #endif /* CONFIG_BLACKFIN */ |