Lines Matching full:dwc2

27 static const char dwc2_driver_name[] = "dwc2";
215 hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2"); in dwc2_lowlevel_hw_init()
226 hsotg->reset_ecc = devm_reset_control_get_optional(hsotg->dev, "dwc2-ecc"); in dwc2_lowlevel_hw_init()
361 * In specific conditions (involving usb hubs) dwc2 devices can create a
365 * of being able to handle the dwc2 interrupts. Disabling dwc2-irqs
648 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_suspend() local
649 bool is_device_mode = dwc2_is_device_mode(dwc2); in dwc2_suspend()
653 dwc2_hsotg_suspend(dwc2); in dwc2_suspend()
655 dwc2_drd_suspend(dwc2); in dwc2_suspend()
657 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_suspend()
665 dwc2_force_mode(dwc2, !is_device_mode); in dwc2_suspend()
667 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_suspend()
668 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_suspend()
677 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_suspend()
678 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_suspend()
680 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_suspend()
683 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_suspend()
685 regulator_disable(dwc2->usb33d); in dwc2_suspend()
689 ret = dwc2_gadget_backup_critical_registers(dwc2); in dwc2_suspend()
691 ret = dwc2_host_backup_critical_registers(dwc2); in dwc2_suspend()
696 if (dwc2->ll_hw_enabled && in dwc2_suspend()
697 (is_device_mode || dwc2_host_can_poweroff_phy(dwc2))) { in dwc2_suspend()
698 ret = __dwc2_lowlevel_hw_disable(dwc2); in dwc2_suspend()
699 dwc2->phy_off_for_suspend = true; in dwc2_suspend()
725 struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); in dwc2_resume() local
728 if (dwc2->phy_off_for_suspend && dwc2->ll_hw_enabled) { in dwc2_resume()
729 ret = __dwc2_lowlevel_hw_enable(dwc2); in dwc2_resume()
733 dwc2->phy_off_for_suspend = false; in dwc2_resume()
737 * DWC2 controller is disabled and all register values get lost. in dwc2_resume()
741 if (!(dwc2_readl(dwc2, GUSBCFG) & GUSBCFG_TOUTCAL_MASK)) { in dwc2_resume()
742 ret = dwc2_restore_critical_registers(dwc2); in dwc2_resume()
747 if (dwc2->params.activate_stm_id_vb_detection) { in dwc2_resume()
751 ret = regulator_enable(dwc2->usb33d); in dwc2_resume()
755 ggpio = dwc2_readl(dwc2, GGPIO); in dwc2_resume()
758 dwc2_writel(dwc2, ggpio, GGPIO); in dwc2_resume()
763 spin_lock_irqsave(&dwc2->lock, flags); in dwc2_resume()
764 gotgctl = dwc2_readl(dwc2, GOTGCTL); in dwc2_resume()
768 dwc2_writel(dwc2, gotgctl, GOTGCTL); in dwc2_resume()
769 spin_unlock_irqrestore(&dwc2->lock, flags); in dwc2_resume()
772 if (!dwc2->role_sw) { in dwc2_resume()
774 dwc2_force_dr_mode(dwc2); in dwc2_resume()
776 dwc2_drd_resume(dwc2); in dwc2_resume()
779 if (dwc2_is_device_mode(dwc2)) in dwc2_resume()
780 ret = dwc2_hsotg_resume(dwc2); in dwc2_resume()