diff options
author | Maulik Mankad <x0082077@ti.com> | 2010-09-24 06:44:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:21:53 -0400 |
commit | 496dda704bca1208e08773ba39b29a69536f5381 (patch) | |
tree | 9b6e445625b8c40b526bef271e29df77b1cd8761 /drivers/usb/core | |
parent | 6587cc0f30cd2f27cf0677e470f18792925a23a4 (diff) |
usb: musb: host: unmap the buffer for PIO data transfers
The USB stack maps the buffer for DMA if the controller supports DMA.
MUSB controller can perform DMA as well as PIO transfers.
The buffer needs to be unmapped before CPU can perform
PIO data transfers.
Export unmap_urb_for_dma() so that drivers can perform
the DMA unmapping in a sane way.
Signed-off-by: Maulik Mankad <x0082077@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hcd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 5cca00a6d09d..cb2d894321da 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1263,7 +1263,7 @@ static void hcd_free_coherent(struct usb_bus *bus, dma_addr_t *dma_handle, | |||
1263 | *dma_handle = 0; | 1263 | *dma_handle = 0; |
1264 | } | 1264 | } |
1265 | 1265 | ||
1266 | static void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) | 1266 | void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) |
1267 | { | 1267 | { |
1268 | enum dma_data_direction dir; | 1268 | enum dma_data_direction dir; |
1269 | 1269 | ||
@@ -1307,6 +1307,7 @@ static void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) | |||
1307 | URB_DMA_MAP_SG | URB_DMA_MAP_PAGE | | 1307 | URB_DMA_MAP_SG | URB_DMA_MAP_PAGE | |
1308 | URB_DMA_MAP_SINGLE | URB_MAP_LOCAL); | 1308 | URB_DMA_MAP_SINGLE | URB_MAP_LOCAL); |
1309 | } | 1309 | } |
1310 | EXPORT_SYMBOL_GPL(unmap_urb_for_dma); | ||
1310 | 1311 | ||
1311 | static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, | 1312 | static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, |
1312 | gfp_t mem_flags) | 1313 | gfp_t mem_flags) |