diff options
author | Pratyush Anand <pratyush.anand@st.com> | 2012-07-02 00:51:54 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-07-02 03:03:55 -0400 |
commit | e274a31e29b6a097c32f526493f4ebce10856dcb (patch) | |
tree | 57bb5ca8df17d29a1873631e7400e3e6d2e1d99f /drivers/usb/dwc3/ep0.c | |
parent | dd864f20b382b131bfe10c87c5c81985f5bafa54 (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/ep0.c')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 9 |
1 files changed, 9 insertions, 0 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 | } |