static int dwc3_remove(struct platform_device *pdev) { struct dwc3 *dwc = platform_get_drvdata(pdev); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); /* * restore res->start back to its original value so that, in case the * probe is deferred, we don't end up getting error in request the * memory region the next time probe is called. */ res->start -= DWC3_GLOBALS_REGS_START; dwc3_debugfs_exit(dwc); dwc3_core_exit_mode(dwc); dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); dwc3_core_exit(dwc); dwc3_ulpi_exit(dwc); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; }
static int dwc3_suspend(struct device *dev) { struct dwc3 *dwc = dev_get_drvdata(dev); unsigned long flags; spin_lock_irqsave(&dwc->lock, flags); switch (dwc->dr_mode) { case USB_DR_MODE_PERIPHERAL: case USB_DR_MODE_OTG: dwc3_gadget_suspend(dwc); /* FALLTHROUGH */ case USB_DR_MODE_HOST: default: dwc3_event_buffers_cleanup(dwc); break; } dwc->gctl = dwc3_readl(dwc->regs, DWC3_GCTL); spin_unlock_irqrestore(&dwc->lock, flags); usb_phy_shutdown(dwc->usb3_phy); usb_phy_shutdown(dwc->usb2_phy); phy_exit(dwc->usb2_generic_phy); phy_exit(dwc->usb3_generic_phy); usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); WARN_ON(phy_power_off(dwc->usb2_generic_phy) < 0); WARN_ON(phy_power_off(dwc->usb3_generic_phy) < 0); pinctrl_pm_select_sleep_state(dev); return 0; }
static void dwc3_core_exit(struct dwc3 *dwc) { dwc3_event_buffers_cleanup(dwc); usb_phy_shutdown(dwc->usb2_phy); usb_phy_shutdown(dwc->usb3_phy); phy_exit(dwc->usb2_generic_phy); phy_exit(dwc->usb3_generic_phy); usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); }
static void dwc3_core_exit(struct dwc3 *dwc) { usb_phy_shutdown(dwc->usb2_phy); usb_phy_shutdown(dwc->usb3_phy); phy_exit(dwc->usb2_generic_phy); phy_exit(dwc->usb3_generic_phy); usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); clk_bulk_disable(dwc->num_clks, dwc->clks); clk_bulk_unprepare(dwc->num_clks, dwc->clks); reset_control_assert(dwc->reset); }
static void analogix_dp_bridge_disable(struct drm_bridge *bridge) { struct analogix_dp_device *dp = bridge->driver_private; int ret; if (dp->dpms_mode != DRM_MODE_DPMS_ON) return; if (dp->plat_data->panel) { if (drm_panel_disable(dp->plat_data->panel)) { DRM_ERROR("failed to disable the panel\n"); return; } } disable_irq(dp->irq); phy_power_off(dp->phy); if (dp->plat_data->power_off) dp->plat_data->power_off(dp->plat_data); pm_runtime_put_sync(dp->dev); ret = analogix_dp_prepare_panel(dp, false, true); if (ret) DRM_ERROR("failed to setup the panel ret = %d\n", ret); dp->dpms_mode = DRM_MODE_DPMS_OFF; }
static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg) { struct platform_device *pdev = to_platform_device(hsotg->dev); int ret = 0; if (hsotg->uphy) { usb_phy_shutdown(hsotg->uphy); } else if (hsotg->plat && hsotg->plat->phy_exit) { ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type); } else { ret = phy_exit(hsotg->phy); if (ret == 0) ret = phy_power_off(hsotg->phy); } if (ret) return ret; if (hsotg->clk) clk_disable_unprepare(hsotg->clk); ret = regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); return ret; }
static int dra7xx_pcie_resume_noirq(struct device *dev) { struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev); int phy_count = dra7xx->phy_count; int ret; int i; for (i = 0; i < phy_count; i++) { ret = phy_init(dra7xx->phy[i]); if (ret < 0) goto err_phy; ret = phy_power_on(dra7xx->phy[i]); if (ret < 0) { phy_exit(dra7xx->phy[i]); goto err_phy; } } return 0; err_phy: while (--i >= 0) { phy_power_off(dra7xx->phy[i]); phy_exit(dra7xx->phy[i]); } return ret; }
static void ssusb_phy_power_off(struct ssusb_mtk *ssusb) { unsigned int i; for (i = 0; i < ssusb->num_phys; i++) phy_power_off(ssusb->phys[i]); }
static void exynos_dp_bridge_disable(struct drm_bridge *bridge) { struct exynos_dp_device *dp = bridge->driver_private; struct exynos_drm_crtc *crtc = dp_to_crtc(dp); if (dp->dpms_mode != DRM_MODE_DPMS_ON) return; if (dp->panel) { if (drm_panel_disable(dp->panel)) { DRM_ERROR("failed to disable the panel\n"); return; } } disable_irq(dp->irq); flush_work(&dp->hotplug_work); phy_power_off(dp->phy); if (crtc->ops->clock_enable) crtc->ops->clock_enable(dp_to_crtc(dp), false); if (dp->panel) { if (drm_panel_unprepare(dp->panel)) DRM_ERROR("failed to turnoff the panel\n"); } pm_runtime_put_sync(dp->dev); dp->dpms_mode = DRM_MODE_DPMS_OFF; }
static void xhci_mtk_phy_power_off(struct xhci_hcd_mtk *mtk) { unsigned int i; for (i = 0; i < mtk->num_phys; i++) phy_power_off(mtk->phys[i]); }
static void ohci_da8xx_disable(struct usb_hcd *hcd) { struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); phy_power_off(da8xx_ohci->usb11_phy); phy_exit(da8xx_ohci->usb11_phy); clk_disable_unprepare(da8xx_ohci->usb11_clk); }
int ufs_qcom_phy_exit(struct phy *generic_phy) { struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(generic_phy); if (ufs_qcom_phy->is_powered_on) phy_power_off(generic_phy); return 0; }
int iproc_pcie_remove(struct iproc_pcie *pcie) { pci_stop_root_bus(pcie->root_bus); pci_remove_root_bus(pcie->root_bus); phy_power_off(pcie->phy); phy_exit(pcie->phy); return 0; }
int ufs_qcom_phy_remove(struct phy *generic_phy, struct ufs_qcom_phy *ufs_qcom_phy) { phy_power_off(generic_phy); kfree(ufs_qcom_phy->vdda_pll.name); kfree(ufs_qcom_phy->vdda_phy.name); return 0; }
static int omap2430_musb_exit(struct musb *musb) { del_timer_sync(&musb_idle_timer); omap2430_low_level_exit(musb); phy_power_off(musb->phy); phy_exit(musb->phy); return 0; }
static int dra7xx_pcie_suspend_noirq(struct device *dev) { struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev); int count = dra7xx->phy_count; while (count--) { phy_power_off(dra7xx->phy[count]); phy_exit(dra7xx->phy[count]); } return 0; }
static int dsps_musb_exit(struct musb *musb) { struct device *dev = musb->controller; struct dsps_glue *glue = dev_get_drvdata(dev->parent); del_timer_sync(&musb->dev_timer); phy_power_off(musb->phy); phy_exit(musb->phy); debugfs_remove_recursive(glue->dbgfs_root); return 0; }
static void exynos_dp_phy_exit(struct exynos_dp_device *dp) { if (dp->phy) { phy_power_off(dp->phy); } else if (dp->phy_addr) { u32 reg; reg = __raw_readl(dp->phy_addr); reg &= ~(dp->enable_mask); __raw_writel(reg, dp->phy_addr); } }
static int dwc3_remove(struct platform_device *pdev) { struct dwc3 *dwc = platform_get_drvdata(pdev); dwc3_debugfs_exit(dwc); dwc3_core_exit_mode(dwc); dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); dwc3_core_exit(dwc); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; }
/** * ahci_platform_disable_resources - Disable platform resources * @hpriv: host private area to store config values * * This function disables all ahci_platform managed resources in the * following order: * 1) Phy * 2) Clocks (through ahci_platform_disable_clks) * 3) Regulator */ void ahci_platform_disable_resources(struct ahci_host_priv *hpriv) { if (hpriv->phy) { phy_power_off(hpriv->phy); phy_exit(hpriv->phy); } ahci_platform_disable_clks(hpriv); if (hpriv->target_pwr) regulator_disable(hpriv->target_pwr); }
static int omap2430_musb_exit(struct musb *musb) { struct device *dev = musb->controller; struct omap2430_glue *glue = dev_get_drvdata(dev->parent); omap2430_low_level_exit(musb); phy_power_off(musb->phy); phy_exit(musb->phy); musb->phy = NULL; cancel_work_sync(&glue->omap_musb_mailbox_work); return 0; }
static int dwc3_remove(struct platform_device *pdev) { struct dwc3 *dwc = platform_get_drvdata(pdev); dwc3_debugfs_exit(dwc); switch (dwc->dr_mode) { case USB_DR_MODE_PERIPHERAL: dwc3_gadget_exit(dwc); break; case USB_DR_MODE_HOST: dwc3_host_exit(dwc); break; case USB_DR_MODE_OTG: dwc3_host_exit(dwc); dwc3_gadget_exit(dwc); break; default: /* do nothing */ break; } dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); dwc3_core_exit(dwc); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; }
static int da8xx_musb_exit(struct musb *musb) { struct da8xx_glue *glue = dev_get_drvdata(musb->controller->parent); del_timer_sync(&otg_workaround); phy_power_off(glue->phy); phy_exit(glue->phy); clk_disable_unprepare(glue->clk); usb_put_phy(musb->xceiv); return 0; }
static int omap2430_runtime_suspend(struct device *dev) { struct omap2430_glue *glue = dev_get_drvdata(dev); struct musb *musb = glue_to_musb(glue); if (musb) { musb->context.otg_interfsel = musb_readl(musb->mregs, OTG_INTERFSEL); omap2430_low_level_exit(musb); phy_power_off(musb->phy); } return 0; }
static void ehci_platform_power_off(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); int clk, phy_num; for (phy_num = 0; phy_num < priv->num_phys; phy_num++) { phy_power_off(priv->phys[phy_num]); phy_exit(priv->phys[phy_num]); } for (clk = EHCI_MAX_CLKS - 1; clk >= 0; clk--) if (priv->clks[clk]) clk_disable_unprepare(priv->clks[clk]); }
static int ssusb_phy_power_on(struct ssusb_mtk *ssusb) { int i; int ret; for (i = 0; i < ssusb->num_phys; i++) { ret = phy_power_on(ssusb->phys[i]); if (ret) goto power_off_phy; } return 0; power_off_phy: for (; i > 0; i--) phy_power_off(ssusb->phys[i - 1]); return ret; }
static int __exit dra7xx_pcie_remove(struct platform_device *pdev) { struct dra7xx_pcie *dra7xx = platform_get_drvdata(pdev); struct pcie_port *pp = &dra7xx->pp; struct device *dev = &pdev->dev; int count = dra7xx->phy_count; if (pp->irq_domain) irq_domain_remove(pp->irq_domain); pm_runtime_put(dev); pm_runtime_disable(dev); while (count--) { phy_power_off(dra7xx->phy[count]); phy_exit(dra7xx->phy[count]); } return 0; }
static int xhci_mtk_phy_power_on(struct xhci_hcd_mtk *mtk) { int i; int ret; for (i = 0; i < mtk->num_phys; i++) { ret = phy_power_on(mtk->phys[i]); if (ret) goto power_off_phy; } return 0; power_off_phy: for (; i > 0; i--) phy_power_off(mtk->phys[i - 1]); return ret; }
static int msm_ahci_suspend(struct device *ahci_dev) { int ret; struct device *dev = ahci_dev->parent; struct msm_ahci_host *host = dev_get_drvdata(dev); msm_ahci_setup_asic_rbc_clks(host, false); ret = phy_power_off(host->phy); if (ret) { dev_err(dev, "%s: PHY power off failed %d\n", __func__, ret); goto out; } else { host->phy_powered_on = false; } msm_ahci_setup_clocks(host, false); out: return ret; }
static void st_ehci_platform_power_off(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct st_ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); int clk; reset_control_assert(priv->pwr); reset_control_assert(priv->rst); phy_power_off(priv->phy); phy_exit(priv->phy); for (clk = USB_MAX_CLKS - 1; clk >= 0; clk--) if (priv->clks[clk]) clk_disable_unprepare(priv->clks[clk]); }