Lines Matching refs:dwc2

651 	struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);  in dwc2_suspend()  local
652 bool is_device_mode = dwc2_is_device_mode(dwc2); in dwc2_suspend()
656 dwc2_hsotg_suspend(dwc2); in dwc2_suspend()
658 dwc2_drd_suspend(dwc2); in dwc2_suspend()
660 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_suspend()
668 dwc2_force_mode(dwc2, !is_device_mode); in dwc2_suspend()
670 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_suspend()
671 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_suspend()
680 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_suspend()
681 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_suspend()
683 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_suspend()
686 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_suspend()
688 regulator_disable(dwc2->usb33d); in dwc2_suspend()
692 ret = dwc2_gadget_backup_critical_registers(dwc2); in dwc2_suspend()
694 ret = dwc2_host_backup_critical_registers(dwc2); in dwc2_suspend()
699 if (dwc2->ll_hw_enabled && in dwc2_suspend()
700 (is_device_mode || dwc2_host_can_poweroff_phy(dwc2))) { in dwc2_suspend()
701 ret = __dwc2_lowlevel_hw_disable(dwc2); in dwc2_suspend()
702 dwc2->phy_off_for_suspend = true; in dwc2_suspend()
728 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_resume() local
731 if (dwc2->phy_off_for_suspend && dwc2->ll_hw_enabled) { in dwc2_resume()
732 ret = __dwc2_lowlevel_hw_enable(dwc2); in dwc2_resume()
736 dwc2->phy_off_for_suspend = false; in dwc2_resume()
744 if (!(dwc2_readl(dwc2, GUSBCFG) & GUSBCFG_TOUTCAL_MASK)) { in dwc2_resume()
745 ret = dwc2_restore_critical_registers(dwc2); in dwc2_resume()
750 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_resume()
754 ret = regulator_enable(dwc2->usb33d); in dwc2_resume()
758 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_resume()
761 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_resume()
766 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_resume()
767 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_resume()
771 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_resume()
772 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_resume()
775 if (!dwc2->role_sw) { in dwc2_resume()
777 dwc2_force_dr_mode(dwc2); in dwc2_resume()
779 dwc2_drd_resume(dwc2); in dwc2_resume()
782 if (dwc2_is_device_mode(dwc2)) in dwc2_resume()
783 ret = dwc2_hsotg_resume(dwc2); in dwc2_resume()