Lines Matching refs:hsotg

27 static const char *dwc2_op_state_str(struct dwc2_hsotg *hsotg)  in dwc2_op_state_str()  argument
29 switch (hsotg->op_state) { in dwc2_op_state_str()
52 static void dwc2_handle_usb_port_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_usb_port_intr() argument
54 u32 hprt0 = dwc2_readl(hsotg, HPRT0); in dwc2_handle_usb_port_intr()
58 dwc2_writel(hsotg, hprt0, HPRT0); in dwc2_handle_usb_port_intr()
67 static void dwc2_handle_mode_mismatch_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_mode_mismatch_intr() argument
70 dwc2_writel(hsotg, GINTSTS_MODEMIS, GINTSTS); in dwc2_handle_mode_mismatch_intr()
72 dev_warn(hsotg->dev, "Mode Mismatch Interrupt: currently in %s mode\n", in dwc2_handle_mode_mismatch_intr()
73 dwc2_is_host_mode(hsotg) ? "Host" : "Device"); in dwc2_handle_mode_mismatch_intr()
82 static void dwc2_handle_otg_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_otg_intr() argument
88 gotgint = dwc2_readl(hsotg, GOTGINT); in dwc2_handle_otg_intr()
89 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
90 dev_dbg(hsotg->dev, "++OTG Interrupt gotgint=%0x [%s]\n", gotgint, in dwc2_handle_otg_intr()
91 dwc2_op_state_str(hsotg)); in dwc2_handle_otg_intr()
94 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
96 dwc2_op_state_str(hsotg)); in dwc2_handle_otg_intr()
97 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
99 if (dwc2_is_device_mode(hsotg)) in dwc2_handle_otg_intr()
100 dwc2_hsotg_disconnect(hsotg); in dwc2_handle_otg_intr()
102 if (hsotg->op_state == OTG_STATE_B_HOST) { in dwc2_handle_otg_intr()
103 hsotg->op_state = OTG_STATE_B_PERIPHERAL; in dwc2_handle_otg_intr()
110 dev_dbg(hsotg->dev, "Session End Detected\n"); in dwc2_handle_otg_intr()
111 dev_err(hsotg->dev, in dwc2_handle_otg_intr()
120 hsotg->lx_state = DWC2_L0; in dwc2_handle_otg_intr()
123 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
125 dwc2_writel(hsotg, gotgctl, GOTGCTL); in dwc2_handle_otg_intr()
129 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
131 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
133 if (hsotg->params.phy_type == DWC2_PHY_TYPE_PARAM_FS && in dwc2_handle_otg_intr()
134 hsotg->params.i2c_enable) { in dwc2_handle_otg_intr()
135 hsotg->srp_success = 1; in dwc2_handle_otg_intr()
138 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
140 dwc2_writel(hsotg, gotgctl, GOTGCTL); in dwc2_handle_otg_intr()
150 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
155 if (hsotg->hw_params.snpsid >= DWC2_CORE_REV_3_00a) in dwc2_handle_otg_intr()
158 if (dwc2_is_host_mode(hsotg)) { in dwc2_handle_otg_intr()
159 hsotg->op_state = OTG_STATE_B_HOST; in dwc2_handle_otg_intr()
170 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_handle_otg_intr()
172 dwc2_writel(hsotg, gintmsk, GINTMSK); in dwc2_handle_otg_intr()
178 spin_unlock(&hsotg->lock); in dwc2_handle_otg_intr()
181 dwc2_hcd_start(hsotg); in dwc2_handle_otg_intr()
182 spin_lock(&hsotg->lock); in dwc2_handle_otg_intr()
183 hsotg->op_state = OTG_STATE_B_HOST; in dwc2_handle_otg_intr()
186 gotgctl = dwc2_readl(hsotg, GOTGCTL); in dwc2_handle_otg_intr()
188 dwc2_writel(hsotg, gotgctl, GOTGCTL); in dwc2_handle_otg_intr()
189 dev_dbg(hsotg->dev, "HNP Failed\n"); in dwc2_handle_otg_intr()
190 dev_err(hsotg->dev, in dwc2_handle_otg_intr()
202 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
204 (dwc2_is_host_mode(hsotg) ? "Host" : "Device")); in dwc2_handle_otg_intr()
205 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_otg_intr()
206 dev_dbg(hsotg->dev, "a_suspend->a_peripheral (%d)\n", in dwc2_handle_otg_intr()
207 hsotg->op_state); in dwc2_handle_otg_intr()
208 spin_unlock(&hsotg->lock); in dwc2_handle_otg_intr()
209 dwc2_hcd_disconnect(hsotg, false); in dwc2_handle_otg_intr()
210 spin_lock(&hsotg->lock); in dwc2_handle_otg_intr()
211 hsotg->op_state = OTG_STATE_A_PERIPHERAL; in dwc2_handle_otg_intr()
214 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_handle_otg_intr()
216 dwc2_writel(hsotg, gintmsk, GINTMSK); in dwc2_handle_otg_intr()
217 spin_unlock(&hsotg->lock); in dwc2_handle_otg_intr()
218 dwc2_hcd_start(hsotg); in dwc2_handle_otg_intr()
219 spin_lock(&hsotg->lock); in dwc2_handle_otg_intr()
220 hsotg->op_state = OTG_STATE_A_HOST; in dwc2_handle_otg_intr()
225 dev_dbg(hsotg->dev, in dwc2_handle_otg_intr()
228 dev_dbg(hsotg->dev, " ++OTG Interrupt: Debounce Done++\n"); in dwc2_handle_otg_intr()
231 dwc2_writel(hsotg, gotgint, GOTGINT); in dwc2_handle_otg_intr()
244 static void dwc2_handle_conn_id_status_change_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_conn_id_status_change_intr() argument
249 dwc2_writel(hsotg, GINTSTS_CONIDSTSCHNG, GINTSTS); in dwc2_handle_conn_id_status_change_intr()
252 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_handle_conn_id_status_change_intr()
254 dwc2_writel(hsotg, gintmsk, GINTMSK); in dwc2_handle_conn_id_status_change_intr()
256 dev_dbg(hsotg->dev, " ++Connector ID Status Change Interrupt++ (%s)\n", in dwc2_handle_conn_id_status_change_intr()
257 dwc2_is_host_mode(hsotg) ? "Host" : "Device"); in dwc2_handle_conn_id_status_change_intr()
262 if (hsotg->wq_otg) in dwc2_handle_conn_id_status_change_intr()
263 queue_work(hsotg->wq_otg, &hsotg->wf_otg); in dwc2_handle_conn_id_status_change_intr()
277 static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_session_req_intr() argument
283 dwc2_writel(hsotg, GINTSTS_SESSREQINT, GINTSTS); in dwc2_handle_session_req_intr()
285 dev_dbg(hsotg->dev, "Session request interrupt - lx_state=%d\n", in dwc2_handle_session_req_intr()
286 hsotg->lx_state); in dwc2_handle_session_req_intr()
288 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_session_req_intr()
289 if (hsotg->lx_state == DWC2_L2) { in dwc2_handle_session_req_intr()
290 if (hsotg->in_ppd) { in dwc2_handle_session_req_intr()
291 ret = dwc2_exit_partial_power_down(hsotg, 0, in dwc2_handle_session_req_intr()
294 dev_err(hsotg->dev, in dwc2_handle_session_req_intr()
299 if (hsotg->params.power_down == in dwc2_handle_session_req_intr()
300 DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended) in dwc2_handle_session_req_intr()
301 dwc2_gadget_exit_clock_gating(hsotg, 0); in dwc2_handle_session_req_intr()
308 dwc2_hsotg_disconnect(hsotg); in dwc2_handle_session_req_intr()
311 hprt0 = dwc2_read_hprt0(hsotg); in dwc2_handle_session_req_intr()
313 dwc2_writel(hsotg, hprt0, HPRT0); in dwc2_handle_session_req_intr()
315 dwc2_hcd_connect(hsotg); in dwc2_handle_session_req_intr()
325 static void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg) in dwc2_wakeup_from_lpm_l1() argument
330 if (hsotg->lx_state != DWC2_L1) { in dwc2_wakeup_from_lpm_l1()
331 dev_err(hsotg->dev, "Core isn't in DWC2_L1 state\n"); in dwc2_wakeup_from_lpm_l1()
335 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_wakeup_from_lpm_l1()
336 if (dwc2_is_device_mode(hsotg)) { in dwc2_wakeup_from_lpm_l1()
337 dev_dbg(hsotg->dev, "Exit from L1 state\n"); in dwc2_wakeup_from_lpm_l1()
340 dwc2_writel(hsotg, glpmcfg, GLPMCFG); in dwc2_wakeup_from_lpm_l1()
343 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_wakeup_from_lpm_l1()
353 dev_err(hsotg->dev, "Failed to exit L1 sleep state in 200us.\n"); in dwc2_wakeup_from_lpm_l1()
356 dwc2_gadget_init_lpm(hsotg); in dwc2_wakeup_from_lpm_l1()
359 dev_err(hsotg->dev, "Host side LPM is not supported.\n"); in dwc2_wakeup_from_lpm_l1()
364 hsotg->lx_state = DWC2_L0; in dwc2_wakeup_from_lpm_l1()
367 call_gadget(hsotg, resume); in dwc2_wakeup_from_lpm_l1()
377 static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_wakeup_detected_intr() argument
382 dwc2_writel(hsotg, GINTSTS_WKUPINT, GINTSTS); in dwc2_handle_wakeup_detected_intr()
384 dev_dbg(hsotg->dev, "++Resume or Remote Wakeup Detected Interrupt++\n"); in dwc2_handle_wakeup_detected_intr()
385 dev_dbg(hsotg->dev, "%s lxstate = %d\n", __func__, hsotg->lx_state); in dwc2_handle_wakeup_detected_intr()
387 if (hsotg->lx_state == DWC2_L1) { in dwc2_handle_wakeup_detected_intr()
388 dwc2_wakeup_from_lpm_l1(hsotg); in dwc2_handle_wakeup_detected_intr()
392 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_wakeup_detected_intr()
393 dev_dbg(hsotg->dev, "DSTS=0x%0x\n", in dwc2_handle_wakeup_detected_intr()
394 dwc2_readl(hsotg, DSTS)); in dwc2_handle_wakeup_detected_intr()
395 if (hsotg->lx_state == DWC2_L2) { in dwc2_handle_wakeup_detected_intr()
396 if (hsotg->in_ppd) { in dwc2_handle_wakeup_detected_intr()
397 u32 dctl = dwc2_readl(hsotg, DCTL); in dwc2_handle_wakeup_detected_intr()
400 dwc2_writel(hsotg, dctl, DCTL); in dwc2_handle_wakeup_detected_intr()
401 ret = dwc2_exit_partial_power_down(hsotg, 1, in dwc2_handle_wakeup_detected_intr()
404 dev_err(hsotg->dev, in dwc2_handle_wakeup_detected_intr()
406 call_gadget(hsotg, resume); in dwc2_handle_wakeup_detected_intr()
410 if (hsotg->params.power_down == in dwc2_handle_wakeup_detected_intr()
411 DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended) in dwc2_handle_wakeup_detected_intr()
412 dwc2_gadget_exit_clock_gating(hsotg, 0); in dwc2_handle_wakeup_detected_intr()
415 hsotg->lx_state = DWC2_L0; in dwc2_handle_wakeup_detected_intr()
418 if (hsotg->lx_state == DWC2_L2) { in dwc2_handle_wakeup_detected_intr()
419 if (hsotg->in_ppd) { in dwc2_handle_wakeup_detected_intr()
420 ret = dwc2_exit_partial_power_down(hsotg, 1, in dwc2_handle_wakeup_detected_intr()
423 dev_err(hsotg->dev, in dwc2_handle_wakeup_detected_intr()
427 if (hsotg->params.power_down == in dwc2_handle_wakeup_detected_intr()
428 DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended) in dwc2_handle_wakeup_detected_intr()
429 dwc2_host_exit_clock_gating(hsotg, 1); in dwc2_handle_wakeup_detected_intr()
439 if (hsotg->reset_phy_on_wake) in dwc2_handle_wakeup_detected_intr()
440 dwc2_host_schedule_phy_reset(hsotg); in dwc2_handle_wakeup_detected_intr()
442 mod_timer(&hsotg->wkp_timer, in dwc2_handle_wakeup_detected_intr()
446 hsotg->lx_state = DWC2_L0; in dwc2_handle_wakeup_detected_intr()
455 static void dwc2_handle_disconnect_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_disconnect_intr() argument
457 dwc2_writel(hsotg, GINTSTS_DISCONNINT, GINTSTS); in dwc2_handle_disconnect_intr()
459 dev_dbg(hsotg->dev, "++Disconnect Detected Interrupt++ (%s) %s\n", in dwc2_handle_disconnect_intr()
460 dwc2_is_host_mode(hsotg) ? "Host" : "Device", in dwc2_handle_disconnect_intr()
461 dwc2_op_state_str(hsotg)); in dwc2_handle_disconnect_intr()
463 if (hsotg->op_state == OTG_STATE_A_HOST) in dwc2_handle_disconnect_intr()
464 dwc2_hcd_disconnect(hsotg, false); in dwc2_handle_disconnect_intr()
475 static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_usb_suspend_intr() argument
481 dwc2_writel(hsotg, GINTSTS_USBSUSP, GINTSTS); in dwc2_handle_usb_suspend_intr()
483 dev_dbg(hsotg->dev, "USB SUSPEND\n"); in dwc2_handle_usb_suspend_intr()
485 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_usb_suspend_intr()
490 dsts = dwc2_readl(hsotg, DSTS); in dwc2_handle_usb_suspend_intr()
491 dev_dbg(hsotg->dev, "%s: DSTS=0x%0x\n", __func__, dsts); in dwc2_handle_usb_suspend_intr()
492 dev_dbg(hsotg->dev, in dwc2_handle_usb_suspend_intr()
495 hsotg->hw_params.power_optimized, in dwc2_handle_usb_suspend_intr()
496 hsotg->hw_params.hibernation); in dwc2_handle_usb_suspend_intr()
499 if (!dwc2_is_device_connected(hsotg)) { in dwc2_handle_usb_suspend_intr()
500 dev_dbg(hsotg->dev, in dwc2_handle_usb_suspend_intr()
505 switch (hsotg->params.power_down) { in dwc2_handle_usb_suspend_intr()
507 ret = dwc2_enter_partial_power_down(hsotg); in dwc2_handle_usb_suspend_intr()
509 dev_err(hsotg->dev, in dwc2_handle_usb_suspend_intr()
515 if (!IS_ERR_OR_NULL(hsotg->uphy)) in dwc2_handle_usb_suspend_intr()
516 usb_phy_set_suspend(hsotg->uphy, true); in dwc2_handle_usb_suspend_intr()
519 ret = dwc2_enter_hibernation(hsotg, 0); in dwc2_handle_usb_suspend_intr()
521 dev_err(hsotg->dev, in dwc2_handle_usb_suspend_intr()
529 if (!hsotg->params.no_clock_gating) in dwc2_handle_usb_suspend_intr()
530 dwc2_gadget_enter_clock_gating(hsotg); in dwc2_handle_usb_suspend_intr()
537 hsotg->lx_state = DWC2_L2; in dwc2_handle_usb_suspend_intr()
540 call_gadget(hsotg, suspend); in dwc2_handle_usb_suspend_intr()
543 if (hsotg->op_state == OTG_STATE_A_PERIPHERAL) { in dwc2_handle_usb_suspend_intr()
544 dev_dbg(hsotg->dev, "a_peripheral->a_host\n"); in dwc2_handle_usb_suspend_intr()
547 hsotg->lx_state = DWC2_L2; in dwc2_handle_usb_suspend_intr()
549 spin_unlock(&hsotg->lock); in dwc2_handle_usb_suspend_intr()
550 dwc2_hcd_start(hsotg); in dwc2_handle_usb_suspend_intr()
551 spin_lock(&hsotg->lock); in dwc2_handle_usb_suspend_intr()
552 hsotg->op_state = OTG_STATE_A_HOST; in dwc2_handle_usb_suspend_intr()
563 static void dwc2_handle_lpm_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_lpm_intr() argument
573 dwc2_writel(hsotg, GINTSTS_LPMTRANRCVD, GINTSTS); in dwc2_handle_lpm_intr()
575 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_handle_lpm_intr()
578 dev_err(hsotg->dev, "Unexpected LPM interrupt\n"); in dwc2_handle_lpm_intr()
588 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_lpm_intr()
589 dev_dbg(hsotg->dev, "HIRD_THRES_EN = %d\n", hird_thres_en); in dwc2_handle_lpm_intr()
592 dev_dbg(hsotg->dev, "L1 with utmi_l1_suspend_n\n"); in dwc2_handle_lpm_intr()
594 dev_dbg(hsotg->dev, "L1 with utmi_sleep_n\n"); in dwc2_handle_lpm_intr()
596 dev_dbg(hsotg->dev, "Entering Sleep with L1 Gating\n"); in dwc2_handle_lpm_intr()
598 pcgcctl = dwc2_readl(hsotg, PCGCTL); in dwc2_handle_lpm_intr()
600 dwc2_writel(hsotg, pcgcctl, PCGCTL); in dwc2_handle_lpm_intr()
607 glpmcfg = dwc2_readl(hsotg, GLPMCFG); in dwc2_handle_lpm_intr()
611 hsotg->lx_state = DWC2_L1; in dwc2_handle_lpm_intr()
612 dev_dbg(hsotg->dev, in dwc2_handle_lpm_intr()
616 call_gadget(hsotg, suspend); in dwc2_handle_lpm_intr()
630 static u32 dwc2_read_common_intr(struct dwc2_hsotg *hsotg) in dwc2_read_common_intr() argument
637 gintsts = dwc2_readl(hsotg, GINTSTS); in dwc2_read_common_intr()
638 gintmsk = dwc2_readl(hsotg, GINTMSK); in dwc2_read_common_intr()
639 gahbcfg = dwc2_readl(hsotg, GAHBCFG); in dwc2_read_common_intr()
643 dev_dbg(hsotg->dev, "gintsts=%08x gintmsk=%08x\n", in dwc2_read_common_intr()
659 static inline void dwc_handle_gpwrdn_disc_det(struct dwc2_hsotg *hsotg, in dwc_handle_gpwrdn_disc_det() argument
665 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
667 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
671 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
673 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
677 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
679 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
683 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
685 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
689 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
691 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
694 gpwrdn_tmp = dwc2_readl(hsotg, GPWRDN); in dwc_handle_gpwrdn_disc_det()
696 dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN); in dwc_handle_gpwrdn_disc_det()
698 hsotg->hibernated = 0; in dwc_handle_gpwrdn_disc_det()
699 hsotg->bus_suspended = 0; in dwc_handle_gpwrdn_disc_det()
702 hsotg->op_state = OTG_STATE_B_PERIPHERAL; in dwc_handle_gpwrdn_disc_det()
703 dwc2_core_init(hsotg, false); in dwc_handle_gpwrdn_disc_det()
704 dwc2_enable_global_interrupts(hsotg); in dwc_handle_gpwrdn_disc_det()
705 dwc2_hsotg_core_init_disconnected(hsotg, false); in dwc_handle_gpwrdn_disc_det()
706 dwc2_hsotg_core_connect(hsotg); in dwc_handle_gpwrdn_disc_det()
708 hsotg->op_state = OTG_STATE_A_HOST; in dwc_handle_gpwrdn_disc_det()
711 dwc2_core_init(hsotg, false); in dwc_handle_gpwrdn_disc_det()
712 dwc2_enable_global_interrupts(hsotg); in dwc_handle_gpwrdn_disc_det()
713 dwc2_hcd_start(hsotg); in dwc_handle_gpwrdn_disc_det()
723 static int dwc2_handle_gpwrdn_intr(struct dwc2_hsotg *hsotg) in dwc2_handle_gpwrdn_intr() argument
729 gpwrdn = dwc2_readl(hsotg, GPWRDN); in dwc2_handle_gpwrdn_intr()
731 dwc2_writel(hsotg, gpwrdn, GPWRDN); in dwc2_handle_gpwrdn_intr()
733 dev_dbg(hsotg->dev, in dwc2_handle_gpwrdn_intr()
739 dev_dbg(hsotg->dev, "%s: GPWRDN_DISCONN_DET\n", __func__); in dwc2_handle_gpwrdn_intr()
744 dwc_handle_gpwrdn_disc_det(hsotg, gpwrdn); in dwc2_handle_gpwrdn_intr()
747 dev_dbg(hsotg->dev, "%s: GPWRDN_LNSTSCHG\n", __func__); in dwc2_handle_gpwrdn_intr()
748 if (hsotg->hw_params.hibernation && in dwc2_handle_gpwrdn_intr()
749 hsotg->hibernated) { in dwc2_handle_gpwrdn_intr()
751 ret = dwc2_exit_hibernation(hsotg, 0, 0, 0); in dwc2_handle_gpwrdn_intr()
753 dev_err(hsotg->dev, in dwc2_handle_gpwrdn_intr()
755 call_gadget(hsotg, resume); in dwc2_handle_gpwrdn_intr()
757 ret = dwc2_exit_hibernation(hsotg, 1, 0, 1); in dwc2_handle_gpwrdn_intr()
759 dev_err(hsotg->dev, in dwc2_handle_gpwrdn_intr()
765 dev_dbg(hsotg->dev, "%s: GPWRDN_RST_DET\n", __func__); in dwc2_handle_gpwrdn_intr()
767 ret = dwc2_exit_hibernation(hsotg, 0, 1, 0); in dwc2_handle_gpwrdn_intr()
769 dev_err(hsotg->dev, in dwc2_handle_gpwrdn_intr()
774 dev_dbg(hsotg->dev, "%s: GPWRDN_STS_CHGINT\n", __func__); in dwc2_handle_gpwrdn_intr()
781 dwc_handle_gpwrdn_disc_det(hsotg, gpwrdn); in dwc2_handle_gpwrdn_intr()
802 struct dwc2_hsotg *hsotg = dev; in dwc2_handle_common_intr() local
806 spin_lock(&hsotg->lock); in dwc2_handle_common_intr()
808 if (!dwc2_is_controller_alive(hsotg)) { in dwc2_handle_common_intr()
809 dev_warn(hsotg->dev, "Controller is dead\n"); in dwc2_handle_common_intr()
814 if (dwc2_is_device_mode(hsotg)) in dwc2_handle_common_intr()
815 hsotg->frame_number = (dwc2_readl(hsotg, DSTS) in dwc2_handle_common_intr()
818 hsotg->frame_number = (dwc2_readl(hsotg, HFNUM) in dwc2_handle_common_intr()
821 gintsts = dwc2_read_common_intr(hsotg); in dwc2_handle_common_intr()
826 if (hsotg->hibernated) { in dwc2_handle_common_intr()
827 dwc2_handle_gpwrdn_intr(hsotg); in dwc2_handle_common_intr()
833 dwc2_handle_mode_mismatch_intr(hsotg); in dwc2_handle_common_intr()
835 dwc2_handle_otg_intr(hsotg); in dwc2_handle_common_intr()
837 dwc2_handle_conn_id_status_change_intr(hsotg); in dwc2_handle_common_intr()
839 dwc2_handle_disconnect_intr(hsotg); in dwc2_handle_common_intr()
841 dwc2_handle_session_req_intr(hsotg); in dwc2_handle_common_intr()
843 dwc2_handle_wakeup_detected_intr(hsotg); in dwc2_handle_common_intr()
845 dwc2_handle_usb_suspend_intr(hsotg); in dwc2_handle_common_intr()
847 dwc2_handle_lpm_intr(hsotg); in dwc2_handle_common_intr()
854 if (dwc2_is_device_mode(hsotg)) { in dwc2_handle_common_intr()
855 dev_dbg(hsotg->dev, in dwc2_handle_common_intr()
857 dwc2_handle_usb_port_intr(hsotg); in dwc2_handle_common_intr()
863 spin_unlock(&hsotg->lock); in dwc2_handle_common_intr()