aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorPavankumar Kondeti <pkondeti@codeaurora.org>2011-05-02 02:26:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-03 13:25:25 -0400
commit76cd9cfb2e022d19bfc008a6e993e1e407034241 (patch)
tree1eb19410b12fabebcca29c6842aa88dc8d1c2947 /drivers/usb/gadget
parent4c5212b7688955075b166def5ce08b34beb87a9c (diff)
USB: gadget: Use ep0out for control OUT data phase in ci13xxx_udc
The current code queue the control OUT data request to ep0in instead of ep0out. Check ep0_dir and use the correct control endpoint. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 1b095cb59c9d..09c76a17a104 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -1843,6 +1843,7 @@ __releases(mEp->lock)
1843__acquires(mEp->lock) 1843__acquires(mEp->lock)
1844{ 1844{
1845 struct ci13xxx_req *mReq, *mReqTemp; 1845 struct ci13xxx_req *mReq, *mReqTemp;
1846 struct ci13xxx_ep *mEpTemp = mEp;
1846 int uninitialized_var(retval); 1847 int uninitialized_var(retval);
1847 1848
1848 trace("%p", mEp); 1849 trace("%p", mEp);
@@ -1859,7 +1860,10 @@ __acquires(mEp->lock)
1859 dbg_done(_usb_addr(mEp), mReq->ptr->token, retval); 1860 dbg_done(_usb_addr(mEp), mReq->ptr->token, retval);
1860 if (mReq->req.complete != NULL) { 1861 if (mReq->req.complete != NULL) {
1861 spin_unlock(mEp->lock); 1862 spin_unlock(mEp->lock);
1862 mReq->req.complete(&mEp->ep, &mReq->req); 1863 if ((mEp->type == USB_ENDPOINT_XFER_CONTROL) &&
1864 mReq->req.length)
1865 mEpTemp = &_udc->ep0in;
1866 mReq->req.complete(&mEpTemp->ep, &mReq->req);
1863 spin_lock(mEp->lock); 1867 spin_lock(mEp->lock);
1864 } 1868 }
1865 } 1869 }
@@ -2248,11 +2252,15 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req,
2248 2252
2249 spin_lock_irqsave(mEp->lock, flags); 2253 spin_lock_irqsave(mEp->lock, flags);
2250 2254
2251 if (mEp->type == USB_ENDPOINT_XFER_CONTROL && 2255 if (mEp->type == USB_ENDPOINT_XFER_CONTROL) {
2252 !list_empty(&mEp->qh.queue)) { 2256 if (req->length)
2253 _ep_nuke(mEp); 2257 mEp = (_udc->ep0_dir == RX) ?
2254 retval = -EOVERFLOW; 2258 &_udc->ep0out : &_udc->ep0in;
2255 warn("endpoint ctrl %X nuked", _usb_addr(mEp)); 2259 if (!list_empty(&mEp->qh.queue)) {
2260 _ep_nuke(mEp);
2261 retval = -EOVERFLOW;
2262 warn("endpoint ctrl %X nuked", _usb_addr(mEp));
2263 }
2256 } 2264 }
2257 2265
2258 /* first nuke then test link, e.g. previous status has not sent */ 2266 /* first nuke then test link, e.g. previous status has not sent */