Lines Matching refs:dwc2
651 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_suspend() local
655 if (!dwc2->ll_hw_enabled) in dwc2_suspend()
658 is_device_mode = dwc2_is_device_mode(dwc2); in dwc2_suspend()
660 dwc2_hsotg_suspend(dwc2); in dwc2_suspend()
662 dwc2_drd_suspend(dwc2); in dwc2_suspend()
664 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_suspend()
672 dwc2_force_mode(dwc2, !is_device_mode); in dwc2_suspend()
674 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_suspend()
675 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_suspend()
684 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_suspend()
685 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_suspend()
687 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_suspend()
690 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_suspend()
692 regulator_disable(dwc2->usb33d); in dwc2_suspend()
696 ret = dwc2_gadget_backup_critical_registers(dwc2); in dwc2_suspend()
698 ret = dwc2_host_backup_critical_registers(dwc2); in dwc2_suspend()
703 if (dwc2->ll_hw_enabled && in dwc2_suspend()
704 (is_device_mode || dwc2_host_can_poweroff_phy(dwc2))) { in dwc2_suspend()
705 ret = __dwc2_lowlevel_hw_disable(dwc2); in dwc2_suspend()
706 dwc2->phy_off_for_suspend = true; in dwc2_suspend()
732 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_resume() local
735 if (!dwc2->ll_hw_enabled) in dwc2_resume()
738 if (dwc2->phy_off_for_suspend && dwc2->ll_hw_enabled) { in dwc2_resume()
739 ret = __dwc2_lowlevel_hw_enable(dwc2); in dwc2_resume()
743 dwc2->phy_off_for_suspend = false; in dwc2_resume()
751 if (!(dwc2_readl(dwc2, GUSBCFG) & GUSBCFG_TOUTCAL_MASK)) { in dwc2_resume()
752 ret = dwc2_restore_critical_registers(dwc2); in dwc2_resume()
757 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_resume()
761 ret = regulator_enable(dwc2->usb33d); in dwc2_resume()
765 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_resume()
768 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_resume()
773 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_resume()
774 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_resume()
778 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_resume()
779 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_resume()
782 if (!dwc2->role_sw) { in dwc2_resume()
784 dwc2_force_dr_mode(dwc2); in dwc2_resume()
786 dwc2_drd_resume(dwc2); in dwc2_resume()
789 if (dwc2_is_device_mode(dwc2)) in dwc2_resume()
790 ret = dwc2_hsotg_resume(dwc2); in dwc2_resume()