diff options
author | Neil Zhang <zhangwm@marvell.com> | 2011-10-12 04:49:37 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-10-13 13:42:07 -0400 |
commit | 46e172dfb38c9dad2ea52d8c161834c1f0bd2473 (patch) | |
tree | c78c5e869b9dfe5647f94b77a33c9f90faeb7f7f /drivers/usb/gadget | |
parent | daec765da767e4a6a30e1298862b28f2cae9a73f (diff) |
usb: gadget: mv_udc: use DMA API for status_req's dma address
use DMA API for status_req's dma address, it is needed by dtd.
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/mv_udc_core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index 9d960f1f7c7f..1f47d03d6871 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c | |||
@@ -1385,6 +1385,13 @@ udc_prime_status(struct mv_udc *udc, u8 direction, u16 status, bool empty) | |||
1385 | req->req.complete = NULL; | 1385 | req->req.complete = NULL; |
1386 | req->dtd_count = 0; | 1386 | req->dtd_count = 0; |
1387 | 1387 | ||
1388 | if (req->req.dma == DMA_ADDR_INVALID) { | ||
1389 | req->req.dma = dma_map_single(ep->udc->gadget.dev.parent, | ||
1390 | req->req.buf, req->req.length, | ||
1391 | ep_dir(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); | ||
1392 | req->mapped = 1; | ||
1393 | } | ||
1394 | |||
1388 | /* prime the data phase */ | 1395 | /* prime the data phase */ |
1389 | if (!req_to_dtd(req)) | 1396 | if (!req_to_dtd(req)) |
1390 | retval = queue_dtd(ep, req); | 1397 | retval = queue_dtd(ep, req); |
@@ -2115,7 +2122,7 @@ static int __devinit mv_udc_probe(struct platform_device *dev) | |||
2115 | 2122 | ||
2116 | /* allocate a small amount of memory to get valid address */ | 2123 | /* allocate a small amount of memory to get valid address */ |
2117 | udc->status_req->req.buf = kzalloc(8, GFP_KERNEL); | 2124 | udc->status_req->req.buf = kzalloc(8, GFP_KERNEL); |
2118 | udc->status_req->req.dma = virt_to_phys(udc->status_req->req.buf); | 2125 | udc->status_req->req.dma = DMA_ADDR_INVALID; |
2119 | 2126 | ||
2120 | udc->resume_state = USB_STATE_NOTATTACHED; | 2127 | udc->resume_state = USB_STATE_NOTATTACHED; |
2121 | udc->usb_state = USB_STATE_POWERED; | 2128 | udc->usb_state = USB_STATE_POWERED; |