Lines Matching full:dwc2
57 static const char dwc2_driver_name[] = "dwc2";
275 hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2"); in dwc2_lowlevel_hw_init()
284 hsotg->reset_ecc = devm_reset_control_get_optional(hsotg->dev, "dwc2-ecc"); in dwc2_lowlevel_hw_init()
407 * In specific conditions (involving usb hubs) dwc2 devices can create a
411 * of being able to handle the dwc2 interrupts. Disabling dwc2-irqs
709 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_suspend() local
710 bool is_device_mode = dwc2_is_device_mode(dwc2); in dwc2_suspend()
714 dwc2_hsotg_suspend(dwc2); in dwc2_suspend()
716 dwc2_drd_suspend(dwc2); in dwc2_suspend()
718 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_suspend()
726 dwc2_force_mode(dwc2, !is_device_mode); in dwc2_suspend()
728 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_suspend()
729 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_suspend()
738 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_suspend()
739 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_suspend()
741 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_suspend()
744 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_suspend()
746 regulator_disable(dwc2->usb33d); in dwc2_suspend()
749 if (dwc2->ll_hw_enabled && in dwc2_suspend()
750 (is_device_mode || dwc2_host_can_poweroff_phy(dwc2))) { in dwc2_suspend()
751 ret = __dwc2_lowlevel_hw_disable(dwc2); in dwc2_suspend()
752 dwc2->phy_off_for_suspend = true; in dwc2_suspend()
760 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_resume() local
764 if (dwc2->phy_off_for_suspend && dwc2->ll_hw_enabled) { in dwc2_resume()
765 ret = __dwc2_lowlevel_hw_enable(dwc2); in dwc2_resume()
769 dwc2->phy_off_for_suspend = false; in dwc2_resume()
771 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_resume()
775 ret = regulator_enable(dwc2->usb33d); in dwc2_resume()
779 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_resume()
782 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_resume()
787 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_resume()
788 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_resume()
792 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_resume()
793 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_resume()
797 dwc2_force_dr_mode(dwc2); in dwc2_resume()
799 dwc2_drd_resume(dwc2); in dwc2_resume()
801 if (dwc2->dr_mode == USB_DR_MODE_HOST && dwc2_is_device_mode(dwc2)) { in dwc2_resume()
803 dwc2_force_mode(dwc2, true); in dwc2_resume()
805 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_resume()
806 dwc2_hsotg_disconnect(dwc2); in dwc2_resume()
807 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_resume()
809 dwc2->op_state = OTG_STATE_A_HOST; in dwc2_resume()
811 dwc2_core_init(dwc2, false); in dwc2_resume()
812 dwc2_enable_global_interrupts(dwc2); in dwc2_resume()
813 dwc2_hcd_start(dwc2); in dwc2_resume()
814 } else if (dwc2->dr_mode == USB_DR_MODE_OTG && in dwc2_resume()
815 dwc2->op_state == OTG_STATE_A_HOST && in dwc2_resume()
816 !(dwc2_readl(dwc2, HPRT0) & HPRT0_PWR)) { in dwc2_resume()
825 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_resume()
826 dwc2_hcd_disconnect(dwc2, true); in dwc2_resume()
827 dwc2->op_state = OTG_STATE_B_PERIPHERAL; in dwc2_resume()
828 dwc2->lx_state = DWC2_L3; in dwc2_resume()
829 if (!dwc2->driver) in dwc2_resume()
830 dwc2_hsotg_core_init_disconnected(dwc2, false); in dwc2_resume()
831 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_resume()
833 ret = dwc2_hsotg_resume(dwc2); in dwc2_resume()
834 } else if (dwc2_is_device_mode(dwc2) || in dwc2_resume()
835 (dwc2_is_host_mode(dwc2) && in dwc2_resume()
836 dwc2->dr_mode == USB_DR_MODE_OTG && in dwc2_resume()
837 dwc2->op_state == OTG_STATE_B_PERIPHERAL)) { in dwc2_resume()
838 ret = dwc2_hsotg_resume(dwc2); in dwc2_resume()