summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/fsl_usb2_udc.h
diff options
context:
space:
mode:
authorLi Yang <leoli@freescale.com>2011-11-23 20:12:56 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-29 23:19:04 +0900
commit6414e94c203d92b163ca61b5f51a25b80a621dbe (patch)
tree3fa3023953222644161601500170687399d75369 /drivers/usb/gadget/fsl_usb2_udc.h
parent5ce1d0eb1cd1071347618d0a95515f300239d201 (diff)
downloadop-kernel-dev-6414e94c203d92b163ca61b5f51a25b80a621dbe.zip
op-kernel-dev-6414e94c203d92b163ca61b5f51a25b80a621dbe.tar.gz
usb: gadget: fsl_udc: fix dequeuing a request in progress
The original implementation of dequeuing a request in progress is not correct. Change to use a correct process and also clean up the related functions a little bit. Signed-off-by: Li Yang <leoli@freescale.com> Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/fsl_usb2_udc.h')
-rw-r--r--drivers/usb/gadget/fsl_usb2_udc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h
index 1d51be8..f781f5d 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.h
+++ b/drivers/usb/gadget/fsl_usb2_udc.h
@@ -569,6 +569,16 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length)
* 2 + ((windex & USB_DIR_IN) ? 1 : 0))
#define get_pipe_by_ep(EP) (ep_index(EP) * 2 + ep_is_in(EP))
+static inline struct ep_queue_head *get_qh_by_ep(struct fsl_ep *ep)
+{
+ /* we only have one ep0 structure but two queue heads */
+ if (ep_index(ep) != 0)
+ return ep->qh;
+ else
+ return &ep->udc->ep_qh[(ep->udc->ep0_dir ==
+ USB_DIR_IN) ? 1 : 0];
+}
+
struct platform_device;
#ifdef CONFIG_ARCH_MXC
int fsl_udc_clk_init(struct platform_device *pdev);
OpenPOWER on IntegriCloud