summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fuzzey <mfuzzey@gmail.com>2009-05-01 17:21:11 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-28 13:54:40 -0700
commitf42706c90470851fd2e97eda7a4109e8949bde8a (patch)
treea71b369bdfa2191502d1396a2dfa471b261eb4a5
parentb5c42bc8db17db80917f99205a03c51f17354495 (diff)
USB: atmel-usba-udc : fix control out requests.
usbtest #14 was failing with "udc: ep0: TXCOMP: Invalid endpoint state 2, halting endpoint..." This occured since ep0 is bidirectional and ep->is_in is not valid (must always use ep->state) Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 563d57275448..5644897c1c5d 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -794,7 +794,8 @@ usba_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
if (ep->desc) {
list_add_tail(&req->queue, &ep->queue);
- if (ep->is_in || (ep_is_control(ep)
+ if ((!ep_is_control(ep) && ep->is_in) ||
+ (ep_is_control(ep)
&& (ep->state == DATA_STAGE_IN
|| ep->state == STATUS_STAGE_IN)))
usba_ep_writel(ep, CTL_ENB, USBA_TX_PK_RDY);