aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorPratyush Anand <pratyush.anand@st.com>2012-07-02 00:51:54 -0400
committerFelipe Balbi <balbi@ti.com>2012-07-02 03:03:55 -0400
commite274a31e29b6a097c32f526493f4ebce10856dcb (patch)
tree57bb5ca8df17d29a1873631e7400e3e6d2e1d99f /drivers/usb/dwc3
parentdd864f20b382b131bfe10c87c5c81985f5bafa54 (diff)
usb: dwc3: enable ACCEPT{U1,U2}ENA when SetConfiguration received
As per databook, ACCEPT{U1,U2}ENA bits should be set after receiving SetConfiguration Command. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/ep0.c9
-rw-r--r--drivers/usb/dwc3/gadget.c1
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 1315e787a316..9b94886b66e5 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -474,6 +474,7 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
474{ 474{
475 u32 cfg; 475 u32 cfg;
476 int ret; 476 int ret;
477 u32 reg;
477 478
478 dwc->start_config_issued = false; 479 dwc->start_config_issued = false;
479 cfg = le16_to_cpu(ctrl->wValue); 480 cfg = le16_to_cpu(ctrl->wValue);
@@ -488,6 +489,14 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
488 /* if the cfg matches and the cfg is non zero */ 489 /* if the cfg matches and the cfg is non zero */
489 if (cfg && (!ret || (ret == USB_GADGET_DELAYED_STATUS))) { 490 if (cfg && (!ret || (ret == USB_GADGET_DELAYED_STATUS))) {
490 dwc->dev_state = DWC3_CONFIGURED_STATE; 491 dwc->dev_state = DWC3_CONFIGURED_STATE;
492 /*
493 * Enable transition to U1/U2 state when
494 * nothing is pending from application.
495 */
496 reg = dwc3_readl(dwc->regs, DWC3_DCTL);
497 reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA);
498 dwc3_writel(dwc->regs, DWC3_DCTL, reg);
499
491 dwc->resize_fifos = true; 500 dwc->resize_fifos = true;
492 dev_dbg(dwc->dev, "resize fifos flag SET\n"); 501 dev_dbg(dwc->dev, "resize fifos flag SET\n");
493 } 502 }
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index e7450931125a..39626e366a82 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2020,7 +2020,6 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
2020 2020
2021 reg = dwc3_readl(dwc->regs, DWC3_DCTL); 2021 reg = dwc3_readl(dwc->regs, DWC3_DCTL);
2022 reg &= ~DWC3_DCTL_TSTCTRL_MASK; 2022 reg &= ~DWC3_DCTL_TSTCTRL_MASK;
2023 reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA);
2024 dwc3_writel(dwc->regs, DWC3_DCTL, reg); 2023 dwc3_writel(dwc->regs, DWC3_DCTL, reg);
2025 dwc->test_mode = false; 2024 dwc->test_mode = false;
2026 2025