Lines Matching refs:hsotg
57 static const char *dwc2_op_state_str(struct dwc2_hsotg *hsotg) in dwc2_op_state_str() argument
59 switch (hsotg->op_state) { in dwc2_op_state_str()
82 static void dwc2_handle_usb_port_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_usb_port_intr() argument
84 u32 hprt0 = dwc2_readl(hsotg, HPRT0); in dwc2_handle_usb_port_intr()
88 dwc2_writel(hsotg, hprt0, HPRT0); in dwc2_handle_usb_port_intr()
97 static void dwc2_handle_mode_mismatch_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_mode_mismatch_intr() argument
100 dwc2_writel(hsotg, GINTSTS_MODEMIS, GINTSTS); in dwc2_handle_mode_mismatch_intr()
102 dev_warn(hsotg->dev, "Mode Mismatch Interrupt: currently in %s mode\n", in dwc2_handle_mode_mismatch_intr()
103 dwc2_is_host_mode(hsotg) ? "Host" : "Device"); in dwc2_handle_mode_mismatch_intr()
112 static void dwc2_handle_otg_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_otg_intr() argument
118 gotgint = dwc2_readl(hsotg, GOTGINT); in dwc2_handle_otg_intr()
119 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
120 dev_dbg(hsotg->dev, "++OTG Interrupt gotgint=%0x [%s]\n", gotgint, in dwc2_handle_otg_intr()
121 dwc2_op_state_str(hsotg)); in dwc2_handle_otg_intr()
124 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
126 dwc2_op_state_str(hsotg)); in dwc2_handle_otg_intr()
127 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
129 if (dwc2_is_device_mode(hsotg)) in dwc2_handle_otg_intr()
130 dwc2_hsotg_disconnect(hsotg); in dwc2_handle_otg_intr()
132 if (hsotg->op_state == OTG_STATE_B_HOST) { in dwc2_handle_otg_intr()
133 hsotg->op_state = OTG_STATE_B_PERIPHERAL; in dwc2_handle_otg_intr()
140 dev_dbg(hsotg->dev, "Session End Detected\n"); in dwc2_handle_otg_intr()
141 dev_err(hsotg->dev, in dwc2_handle_otg_intr()
150 hsotg->lx_state = DWC2_L0; in dwc2_handle_otg_intr()
153 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
155 dwc2_writel(hsotg, gotgctl, GOTGCTL); in dwc2_handle_otg_intr()
159 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
161 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
163 if (hsotg->params.phy_type == DWC2_PHY_TYPE_PARAM_FS && in dwc2_handle_otg_intr()
164 hsotg->params.i2c_enable) { in dwc2_handle_otg_intr()
165 hsotg->srp_success = 1; in dwc2_handle_otg_intr()
168 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
170 dwc2_writel(hsotg, gotgctl, GOTGCTL); in dwc2_handle_otg_intr()
180 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
185 if (hsotg->hw_params.snpsid >= DWC2_CORE_REV_3_00a) in dwc2_handle_otg_intr()
188 if (dwc2_is_host_mode(hsotg)) { in dwc2_handle_otg_intr()
189 hsotg->op_state = OTG_STATE_B_HOST; in dwc2_handle_otg_intr()
200 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_handle_otg_intr()
202 dwc2_writel(hsotg, gintmsk, GINTMSK); in dwc2_handle_otg_intr()
208 spin_unlock(&hsotg->lock); in dwc2_handle_otg_intr()
211 dwc2_hcd_start(hsotg); in dwc2_handle_otg_intr()
212 spin_lock(&hsotg->lock); in dwc2_handle_otg_intr()
213 hsotg->op_state = OTG_STATE_B_HOST; in dwc2_handle_otg_intr()
216 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
218 dwc2_writel(hsotg, gotgctl, GOTGCTL); in dwc2_handle_otg_intr()
219 dev_dbg(hsotg->dev, "HNP Failed\n"); in dwc2_handle_otg_intr()
220 dev_err(hsotg->dev, in dwc2_handle_otg_intr()
232 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
234 (dwc2_is_host_mode(hsotg) ? "Host" : "Device")); in dwc2_handle_otg_intr()
235 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_otg_intr()
236 dev_dbg(hsotg->dev, "a_suspend->a_peripheral (%d)\n", in dwc2_handle_otg_intr()
237 hsotg->op_state); in dwc2_handle_otg_intr()
238 spin_unlock(&hsotg->lock); in dwc2_handle_otg_intr()
239 dwc2_hcd_disconnect(hsotg, false); in dwc2_handle_otg_intr()
240 spin_lock(&hsotg->lock); in dwc2_handle_otg_intr()
241 hsotg->op_state = OTG_STATE_A_PERIPHERAL; in dwc2_handle_otg_intr()
244 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_handle_otg_intr()
246 dwc2_writel(hsotg, gintmsk, GINTMSK); in dwc2_handle_otg_intr()
247 spin_unlock(&hsotg->lock); in dwc2_handle_otg_intr()
248 dwc2_hcd_start(hsotg); in dwc2_handle_otg_intr()
249 spin_lock(&hsotg->lock); in dwc2_handle_otg_intr()
250 hsotg->op_state = OTG_STATE_A_HOST; in dwc2_handle_otg_intr()
255 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
258 dev_dbg(hsotg->dev, " ++OTG Interrupt: Debounce Done++\n"); in dwc2_handle_otg_intr()
261 dwc2_writel(hsotg, gotgint, GOTGINT); in dwc2_handle_otg_intr()
274 static void dwc2_handle_conn_id_status_change_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_conn_id_status_change_intr() argument
279 dwc2_writel(hsotg, GINTSTS_CONIDSTSCHNG, GINTSTS); in dwc2_handle_conn_id_status_change_intr()
282 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_handle_conn_id_status_change_intr()
284 dwc2_writel(hsotg, gintmsk, GINTMSK); in dwc2_handle_conn_id_status_change_intr()
286 dev_dbg(hsotg->dev, " ++Connector ID Status Change Interrupt++ (%s)\n", in dwc2_handle_conn_id_status_change_intr()
287 dwc2_is_host_mode(hsotg) ? "Host" : "Device"); in dwc2_handle_conn_id_status_change_intr()
292 if (hsotg->wq_otg) in dwc2_handle_conn_id_status_change_intr()
293 queue_work(hsotg->wq_otg, &hsotg->wf_otg); in dwc2_handle_conn_id_status_change_intr()
307 static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_session_req_intr() argument
313 dwc2_writel(hsotg, GINTSTS_SESSREQINT, GINTSTS); in dwc2_handle_session_req_intr()
315 dev_dbg(hsotg->dev, "Session request interrupt - lx_state=%d\n", in dwc2_handle_session_req_intr()
316 hsotg->lx_state); in dwc2_handle_session_req_intr()
318 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_session_req_intr()
319 if (hsotg->lx_state == DWC2_L2) { in dwc2_handle_session_req_intr()
320 if (hsotg->in_ppd) { in dwc2_handle_session_req_intr()
321 ret = dwc2_exit_partial_power_down(hsotg, 0, in dwc2_handle_session_req_intr()
324 dev_err(hsotg->dev, in dwc2_handle_session_req_intr()
329 if (hsotg->params.power_down == in dwc2_handle_session_req_intr()
330 DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended) in dwc2_handle_session_req_intr()
331 dwc2_gadget_exit_clock_gating(hsotg, 0); in dwc2_handle_session_req_intr()
338 dwc2_hsotg_disconnect(hsotg); in dwc2_handle_session_req_intr()
341 hprt0 = dwc2_read_hprt0(hsotg); in dwc2_handle_session_req_intr()
343 dwc2_writel(hsotg, hprt0, HPRT0); in dwc2_handle_session_req_intr()
345 dwc2_hcd_connect(hsotg); in dwc2_handle_session_req_intr()
355 static void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg) in dwc2_wakeup_from_lpm_l1() argument
360 if (hsotg->lx_state != DWC2_L1) { in dwc2_wakeup_from_lpm_l1()
361 dev_err(hsotg->dev, "Core isn't in DWC2_L1 state\n"); in dwc2_wakeup_from_lpm_l1()
365 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_wakeup_from_lpm_l1()
366 if (dwc2_is_device_mode(hsotg)) { in dwc2_wakeup_from_lpm_l1()
367 dev_dbg(hsotg->dev, "Exit from L1 state\n"); in dwc2_wakeup_from_lpm_l1()
370 dwc2_writel(hsotg, glpmcfg, GLPMCFG); in dwc2_wakeup_from_lpm_l1()
373 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_wakeup_from_lpm_l1()
383 dev_err(hsotg->dev, "Failed to exit L1 sleep state in 200us.\n"); in dwc2_wakeup_from_lpm_l1()
386 dwc2_gadget_init_lpm(hsotg); in dwc2_wakeup_from_lpm_l1()
389 dev_err(hsotg->dev, "Host side LPM is not supported.\n"); in dwc2_wakeup_from_lpm_l1()
394 hsotg->lx_state = DWC2_L0; in dwc2_wakeup_from_lpm_l1()
397 call_gadget(hsotg, resume); in dwc2_wakeup_from_lpm_l1()
407 static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_wakeup_detected_intr() argument
412 dwc2_writel(hsotg, GINTSTS_WKUPINT, GINTSTS); in dwc2_handle_wakeup_detected_intr()
414 dev_dbg(hsotg->dev, "++Resume or Remote Wakeup Detected Interrupt++\n"); in dwc2_handle_wakeup_detected_intr()
415 dev_dbg(hsotg->dev, "%s lxstate = %d\n", __func__, hsotg->lx_state); in dwc2_handle_wakeup_detected_intr()
417 if (hsotg->lx_state == DWC2_L1) { in dwc2_handle_wakeup_detected_intr()
418 dwc2_wakeup_from_lpm_l1(hsotg); in dwc2_handle_wakeup_detected_intr()
422 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_wakeup_detected_intr()
423 dev_dbg(hsotg->dev, "DSTS=0x%0x\n", in dwc2_handle_wakeup_detected_intr()
424 dwc2_readl(hsotg, DSTS)); in dwc2_handle_wakeup_detected_intr()
425 if (hsotg->lx_state == DWC2_L2) { in dwc2_handle_wakeup_detected_intr()
426 if (hsotg->in_ppd) { in dwc2_handle_wakeup_detected_intr()
427 u32 dctl = dwc2_readl(hsotg, DCTL); in dwc2_handle_wakeup_detected_intr()
430 dwc2_writel(hsotg, dctl, DCTL); in dwc2_handle_wakeup_detected_intr()
431 ret = dwc2_exit_partial_power_down(hsotg, 1, in dwc2_handle_wakeup_detected_intr()
434 dev_err(hsotg->dev, in dwc2_handle_wakeup_detected_intr()
436 call_gadget(hsotg, resume); in dwc2_handle_wakeup_detected_intr()
440 if (hsotg->params.power_down == in dwc2_handle_wakeup_detected_intr()
441 DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended) in dwc2_handle_wakeup_detected_intr()
442 dwc2_gadget_exit_clock_gating(hsotg, 0); in dwc2_handle_wakeup_detected_intr()
445 hsotg->lx_state = DWC2_L0; in dwc2_handle_wakeup_detected_intr()
448 if (hsotg->lx_state == DWC2_L2) { in dwc2_handle_wakeup_detected_intr()
449 if (hsotg->in_ppd) { in dwc2_handle_wakeup_detected_intr()
450 ret = dwc2_exit_partial_power_down(hsotg, 1, in dwc2_handle_wakeup_detected_intr()
453 dev_err(hsotg->dev, in dwc2_handle_wakeup_detected_intr()
457 if (hsotg->params.power_down == in dwc2_handle_wakeup_detected_intr()
458 DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended) in dwc2_handle_wakeup_detected_intr()
459 dwc2_host_exit_clock_gating(hsotg, 1); in dwc2_handle_wakeup_detected_intr()
469 if (hsotg->reset_phy_on_wake) in dwc2_handle_wakeup_detected_intr()
470 dwc2_host_schedule_phy_reset(hsotg); in dwc2_handle_wakeup_detected_intr()
472 mod_timer(&hsotg->wkp_timer, in dwc2_handle_wakeup_detected_intr()
476 hsotg->lx_state = DWC2_L0; in dwc2_handle_wakeup_detected_intr()
485 static void dwc2_handle_disconnect_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_disconnect_intr() argument
487 dwc2_writel(hsotg, GINTSTS_DISCONNINT, GINTSTS); in dwc2_handle_disconnect_intr()
489 dev_dbg(hsotg->dev, "++Disconnect Detected Interrupt++ (%s) %s\n", in dwc2_handle_disconnect_intr()
490 dwc2_is_host_mode(hsotg) ? "Host" : "Device", in dwc2_handle_disconnect_intr()
491 dwc2_op_state_str(hsotg)); in dwc2_handle_disconnect_intr()
493 if (hsotg->op_state == OTG_STATE_A_HOST) in dwc2_handle_disconnect_intr()
494 dwc2_hcd_disconnect(hsotg, false); in dwc2_handle_disconnect_intr()
505 static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_usb_suspend_intr() argument
511 dwc2_writel(hsotg, GINTSTS_USBSUSP, GINTSTS); in dwc2_handle_usb_suspend_intr()
513 dev_dbg(hsotg->dev, "USB SUSPEND\n"); in dwc2_handle_usb_suspend_intr()
515 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_usb_suspend_intr()
520 dsts = dwc2_readl(hsotg, DSTS); in dwc2_handle_usb_suspend_intr()
521 dev_dbg(hsotg->dev, "%s: DSTS=0x%0x\n", __func__, dsts); in dwc2_handle_usb_suspend_intr()
522 dev_dbg(hsotg->dev, in dwc2_handle_usb_suspend_intr()
525 hsotg->hw_params.power_optimized, in dwc2_handle_usb_suspend_intr()
526 hsotg->hw_params.hibernation); in dwc2_handle_usb_suspend_intr()
529 if (!dwc2_is_device_connected(hsotg)) { in dwc2_handle_usb_suspend_intr()
530 dev_dbg(hsotg->dev, in dwc2_handle_usb_suspend_intr()
535 switch (hsotg->params.power_down) { in dwc2_handle_usb_suspend_intr()
537 ret = dwc2_enter_partial_power_down(hsotg); in dwc2_handle_usb_suspend_intr()
539 dev_err(hsotg->dev, in dwc2_handle_usb_suspend_intr()
545 if (!IS_ERR_OR_NULL(hsotg->uphy)) in dwc2_handle_usb_suspend_intr()
546 usb_phy_set_suspend(hsotg->uphy, true); in dwc2_handle_usb_suspend_intr()
549 ret = dwc2_enter_hibernation(hsotg, 0); in dwc2_handle_usb_suspend_intr()
551 dev_err(hsotg->dev, in dwc2_handle_usb_suspend_intr()
559 if (!hsotg->params.no_clock_gating) in dwc2_handle_usb_suspend_intr()
560 dwc2_gadget_enter_clock_gating(hsotg); in dwc2_handle_usb_suspend_intr()
567 hsotg->lx_state = DWC2_L2; in dwc2_handle_usb_suspend_intr()
570 call_gadget(hsotg, suspend); in dwc2_handle_usb_suspend_intr()
573 if (hsotg->op_state == OTG_STATE_A_PERIPHERAL) { in dwc2_handle_usb_suspend_intr()
574 dev_dbg(hsotg->dev, "a_peripheral->a_host\n"); in dwc2_handle_usb_suspend_intr()
577 hsotg->lx_state = DWC2_L2; in dwc2_handle_usb_suspend_intr()
579 spin_unlock(&hsotg->lock); in dwc2_handle_usb_suspend_intr()
580 dwc2_hcd_start(hsotg); in dwc2_handle_usb_suspend_intr()
581 spin_lock(&hsotg->lock); in dwc2_handle_usb_suspend_intr()
582 hsotg->op_state = OTG_STATE_A_HOST; in dwc2_handle_usb_suspend_intr()
593 static void dwc2_handle_lpm_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_lpm_intr() argument
603 dwc2_writel(hsotg, GINTSTS_LPMTRANRCVD, GINTSTS); in dwc2_handle_lpm_intr()
605 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_handle_lpm_intr()
608 dev_err(hsotg->dev, "Unexpected LPM interrupt\n"); in dwc2_handle_lpm_intr()
618 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_lpm_intr()
619 dev_dbg(hsotg->dev, "HIRD_THRES_EN = %d\n", hird_thres_en); in dwc2_handle_lpm_intr()
622 dev_dbg(hsotg->dev, "L1 with utmi_l1_suspend_n\n"); in dwc2_handle_lpm_intr()
624 dev_dbg(hsotg->dev, "L1 with utmi_sleep_n\n"); in dwc2_handle_lpm_intr()
626 dev_dbg(hsotg->dev, "Entering Sleep with L1 Gating\n"); in dwc2_handle_lpm_intr()
628 pcgcctl = dwc2_readl(hsotg, PCGCTL); in dwc2_handle_lpm_intr()
630 dwc2_writel(hsotg, pcgcctl, PCGCTL); in dwc2_handle_lpm_intr()
637 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_handle_lpm_intr()
641 hsotg->lx_state = DWC2_L1; in dwc2_handle_lpm_intr()
642 dev_dbg(hsotg->dev, in dwc2_handle_lpm_intr()
646 call_gadget(hsotg, suspend); in dwc2_handle_lpm_intr()
660 static u32 dwc2_read_common_intr(struct dwc2_hsotg *hsotg) in dwc2_read_common_intr() argument
667 gintsts = dwc2_readl(hsotg, GINTSTS); in dwc2_read_common_intr()
668 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_read_common_intr()
669 gahbcfg = dwc2_readl(hsotg, GAHBCFG); in dwc2_read_common_intr()
673 dev_dbg(hsotg->dev, "gintsts=%08x gintmsk=%08x\n", in dwc2_read_common_intr()
689 static inline void dwc_handle_gpwrdn_disc_det(struct dwc2_hsotg *hsotg, in dwc_handle_gpwrdn_disc_det() argument
695 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
697 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
701 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
703 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
707 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
709 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
713 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
715 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
719 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
721 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
724 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
726 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
728 hsotg->hibernated = 0; in dwc_handle_gpwrdn_disc_det()
729 hsotg->bus_suspended = 0; in dwc_handle_gpwrdn_disc_det()
732 hsotg->op_state = OTG_STATE_B_PERIPHERAL; in dwc_handle_gpwrdn_disc_det()
733 dwc2_core_init(hsotg, false); in dwc_handle_gpwrdn_disc_det()
734 dwc2_enable_global_interrupts(hsotg); in dwc_handle_gpwrdn_disc_det()
735 dwc2_hsotg_core_init_disconnected(hsotg, false); in dwc_handle_gpwrdn_disc_det()
736 dwc2_hsotg_core_connect(hsotg); in dwc_handle_gpwrdn_disc_det()
738 hsotg->op_state = OTG_STATE_A_HOST; in dwc_handle_gpwrdn_disc_det()
741 dwc2_core_init(hsotg, false); in dwc_handle_gpwrdn_disc_det()
742 dwc2_enable_global_interrupts(hsotg); in dwc_handle_gpwrdn_disc_det()
743 dwc2_hcd_start(hsotg); in dwc_handle_gpwrdn_disc_det()
753 static int dwc2_handle_gpwrdn_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_gpwrdn_intr() argument
759 gpwrdn = dwc2_readl(hsotg, GPWRDN); in dwc2_handle_gpwrdn_intr()
761 dwc2_writel(hsotg, gpwrdn, GPWRDN); in dwc2_handle_gpwrdn_intr()
763 dev_dbg(hsotg->dev, in dwc2_handle_gpwrdn_intr()
769 dev_dbg(hsotg->dev, "%s: GPWRDN_DISCONN_DET\n", __func__); in dwc2_handle_gpwrdn_intr()
774 dwc_handle_gpwrdn_disc_det(hsotg, gpwrdn); in dwc2_handle_gpwrdn_intr()
777 dev_dbg(hsotg->dev, "%s: GPWRDN_LNSTSCHG\n", __func__); in dwc2_handle_gpwrdn_intr()
778 if (hsotg->hw_params.hibernation && in dwc2_handle_gpwrdn_intr()
779 hsotg->hibernated) { in dwc2_handle_gpwrdn_intr()
781 ret = dwc2_exit_hibernation(hsotg, 0, 0, 0); in dwc2_handle_gpwrdn_intr()
783 dev_err(hsotg->dev, in dwc2_handle_gpwrdn_intr()
785 call_gadget(hsotg, resume); in dwc2_handle_gpwrdn_intr()
787 ret = dwc2_exit_hibernation(hsotg, 1, 0, 1); in dwc2_handle_gpwrdn_intr()
789 dev_err(hsotg->dev, in dwc2_handle_gpwrdn_intr()
795 dev_dbg(hsotg->dev, "%s: GPWRDN_RST_DET\n", __func__); in dwc2_handle_gpwrdn_intr()
797 ret = dwc2_exit_hibernation(hsotg, 0, 1, 0); in dwc2_handle_gpwrdn_intr()
799 dev_err(hsotg->dev, in dwc2_handle_gpwrdn_intr()
804 dev_dbg(hsotg->dev, "%s: GPWRDN_STS_CHGINT\n", __func__); in dwc2_handle_gpwrdn_intr()
811 dwc_handle_gpwrdn_disc_det(hsotg, gpwrdn); in dwc2_handle_gpwrdn_intr()
832 struct dwc2_hsotg *hsotg = dev; in dwc2_handle_common_intr() local
836 spin_lock(&hsotg->lock); in dwc2_handle_common_intr()
838 if (!dwc2_is_controller_alive(hsotg)) { in dwc2_handle_common_intr()
839 dev_warn(hsotg->dev, "Controller is dead\n"); in dwc2_handle_common_intr()
844 if (dwc2_is_device_mode(hsotg)) in dwc2_handle_common_intr()
845 hsotg->frame_number = (dwc2_readl(hsotg, DSTS) in dwc2_handle_common_intr()
848 hsotg->frame_number = (dwc2_readl(hsotg, HFNUM) in dwc2_handle_common_intr()
851 gintsts = dwc2_read_common_intr(hsotg); in dwc2_handle_common_intr()
856 if (hsotg->hibernated) { in dwc2_handle_common_intr()
857 dwc2_handle_gpwrdn_intr(hsotg); in dwc2_handle_common_intr()
863 dwc2_handle_mode_mismatch_intr(hsotg); in dwc2_handle_common_intr()
865 dwc2_handle_otg_intr(hsotg); in dwc2_handle_common_intr()
867 dwc2_handle_conn_id_status_change_intr(hsotg); in dwc2_handle_common_intr()
869 dwc2_handle_disconnect_intr(hsotg); in dwc2_handle_common_intr()
871 dwc2_handle_session_req_intr(hsotg); in dwc2_handle_common_intr()
873 dwc2_handle_wakeup_detected_intr(hsotg); in dwc2_handle_common_intr()
875 dwc2_handle_usb_suspend_intr(hsotg); in dwc2_handle_common_intr()
877 dwc2_handle_lpm_intr(hsotg); in dwc2_handle_common_intr()
884 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_common_intr()
885 dev_dbg(hsotg->dev, in dwc2_handle_common_intr()
887 dwc2_handle_usb_port_intr(hsotg); in dwc2_handle_common_intr()
893 spin_unlock(&hsotg->lock); in dwc2_handle_common_intr()