Lines Matching refs:dwc2

617 	struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);  in dwc2_suspend()  local
618 bool is_device_mode = dwc2_is_device_mode(dwc2); in dwc2_suspend()
622 dwc2_hsotg_suspend(dwc2); in dwc2_suspend()
624 dwc2_drd_suspend(dwc2); in dwc2_suspend()
626 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_suspend()
634 dwc2_force_mode(dwc2, !is_device_mode); in dwc2_suspend()
636 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_suspend()
637 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_suspend()
646 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_suspend()
647 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_suspend()
649 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_suspend()
652 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_suspend()
654 regulator_disable(dwc2->usb33d); in dwc2_suspend()
657 if (dwc2->ll_hw_enabled && in dwc2_suspend()
658 (is_device_mode || dwc2_host_can_poweroff_phy(dwc2))) { in dwc2_suspend()
659 ret = __dwc2_lowlevel_hw_disable(dwc2); in dwc2_suspend()
660 dwc2->phy_off_for_suspend = true; in dwc2_suspend()
668 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_resume() local
671 if (dwc2->phy_off_for_suspend && dwc2->ll_hw_enabled) { in dwc2_resume()
672 ret = __dwc2_lowlevel_hw_enable(dwc2); in dwc2_resume()
676 dwc2->phy_off_for_suspend = false; in dwc2_resume()
678 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_resume()
682 ret = regulator_enable(dwc2->usb33d); in dwc2_resume()
686 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_resume()
689 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_resume()
694 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_resume()
695 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_resume()
699 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_resume()
700 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_resume()
703 if (!dwc2->role_sw) { in dwc2_resume()
705 dwc2_force_dr_mode(dwc2); in dwc2_resume()
707 dwc2_drd_resume(dwc2); in dwc2_resume()
710 if (dwc2_is_device_mode(dwc2)) in dwc2_resume()
711 ret = dwc2_hsotg_resume(dwc2); in dwc2_resume()