[PATCH 04/14] usb: chipidea: udc: move ZLT flag change to ep_enable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Its not needed to change the ZLT flag before every ep_prime. This patch moves
this to the ep_enable and applies it only for non configuration endpoints.

Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
---
 drivers/usb/chipidea/udc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index b7f0a7b..a86d9a6 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -473,7 +473,6 @@ static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
 	/*  QH configuration */
 	writel(mReq->dma, &mEp->qh.ptr->td.next); /* TERMINATE = 0 */
 	writel(readl(&mEp->qh.ptr->td.token) & ~(TD_STATUS_HALTED|TD_STATUS_ACTIVE), &mEp->qh.ptr->td.token);
-	writel(readl(&mEp->qh.ptr->cap) | QH_ZLT, &mEp->qh.ptr->cap);
 
 	wmb();   /* synchronize before ep prime */
 
@@ -1039,6 +1038,8 @@ static int ep_enable(struct usb_ep *ep,
 		mEp->qh.ptr->cap &= ~QH_MULT;
 	else
 		writel(readl(&mEp->qh.ptr->cap) & ~QH_ZLT, &mEp->qh.ptr->cap);
+	if (mEp->num)
+		writel(readl(&mEp->qh.ptr->cap) | QH_ZLT, &mEp->qh.ptr->cap);
 
 	writel(readl(&mEp->qh.ptr->cap) | ((mEp->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT), &mEp->qh.ptr->cap);
 	writel(readl(&mEp->qh.ptr->td.next) | TD_TERMINATE, &mEp->qh.ptr->td.next);   /* needed? */
-- 
1.8.2.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux