aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <yousaf.kaukab@intel.com>2015-09-29 06:08:30 -0400
committerFelipe Balbi <balbi@ti.com>2015-10-01 13:40:27 -0400
commit21795c826a4525bd6b111acfe0db079545083c40 (patch)
tree5d32926005c94a3b16d5b20bc15daae1128d1588
parent8fc37b82a4a43f63e3464e5d02578ea988cb5c01 (diff)
usb: dwc2: exit hibernation on session request
Controller enters hibernation through suspend interrupt on disconnection. On connection, session request interrupt is generated. dwc2 must exit hibernation and restore state from this interrupt before continuing. In host mode, exit from hibernation is handled by bus_resume function. Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Tested-by: Robert Baldyga <r.baldyga@samsung.com> Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com> Tested-by: John Youn <johnyoun@synopsys.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/dwc2/core_intr.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
index d8a5400a2d2d..27daa42788b1 100644
--- a/drivers/usb/dwc2/core_intr.c
+++ b/drivers/usb/dwc2/core_intr.c
@@ -313,16 +313,28 @@ static void dwc2_handle_conn_id_status_change_intr(struct dwc2_hsotg *hsotg)
313 */ 313 */
314static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg) 314static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
315{ 315{
316 dev_dbg(hsotg->dev, "++Session Request Interrupt++\n"); 316 int ret;
317
318 dev_dbg(hsotg->dev, "Session request interrupt - lx_state=%d\n",
319 hsotg->lx_state);
317 320
318 /* Clear interrupt */ 321 /* Clear interrupt */
319 dwc2_writel(GINTSTS_SESSREQINT, hsotg->regs + GINTSTS); 322 dwc2_writel(GINTSTS_SESSREQINT, hsotg->regs + GINTSTS);
320 323
321 /* 324 if (dwc2_is_device_mode(hsotg)) {
322 * Report disconnect if there is any previous session established 325 if (hsotg->lx_state == DWC2_L2) {
323 */ 326 ret = dwc2_exit_hibernation(hsotg, true);
324 if (dwc2_is_device_mode(hsotg)) 327 if (ret && (ret != -ENOTSUPP))
328 dev_err(hsotg->dev,
329 "exit hibernation failed\n");
330 }
331
332 /*
333 * Report disconnect if there is any previous session
334 * established
335 */
325 dwc2_hsotg_disconnect(hsotg); 336 dwc2_hsotg_disconnect(hsotg);
337 }
326} 338}
327 339
328/* 340/*