summaryrefslogtreecommitdiff
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorThirupathi Chippakurthy <thirupathi.chippakurthy@stericsson.com>2011-09-06 10:44:44 +0530
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 16:07:25 +0200
commit2bce15e15a70d11524f9ffe78ef7dd0823440f0a (patch)
treeb49752e943c4f065f7f34e3d087c9a56ad48d5b0 /drivers/usb/musb
parent6ef82cb4ada0797d06942830c6a7b0d657adb693 (diff)
musb: host: unmap the buffer for PIO in EP0
The USB stack maps the buffer for DMA if the controller supports DMA.The buffer needs to be unmapped before CPU can perform PIO data transfers. ST-Ericsson ID: 353110 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I7811591f4f82f06af036bbde28cfa6f6de40cf8d Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30144 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_host.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 73ebcca75b0..ff02e5924fb 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -813,6 +813,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
if (hw_ep->do_tx_pio) {
/* PIO to load FIFO */
+ /* Unmap the buffer so that CPU can use it */
+ usb_hcd_unmap_urb_for_dma(musb_to_hcd(musb), urb);
qh->segsize = load_count;
musb_write_fifo(hw_ep, load_count, buf);
}
@@ -905,6 +907,8 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb)
if (fifo_count < len)
urb->status = -EOVERFLOW;
+ /* Unmap the buffer so that CPU can use it */
+ usb_hcd_unmap_urb_for_dma(musb_to_hcd(musb), urb);
musb_read_fifo(hw_ep, fifo_count, fifo_dest);
urb->actual_length += fifo_count;
@@ -944,6 +948,8 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb)
fifo_count,
(fifo_count == 1) ? "" : "s",
fifo_dest);
+ /* Unmap the buffer so that CPU can use it */
+ usb_hcd_unmap_urb_for_dma(musb_to_hcd(musb), urb);
musb_write_fifo(hw_ep, fifo_count, fifo_dest);
urb->actual_length += fifo_count;