コード例 #1
0
static int dwc3_remove(struct platform_device *pdev)
{
	struct dwc3	*dwc = platform_get_drvdata(pdev);

	usb_phy_set_suspend(dwc->usb2_phy, 1);
	usb_phy_set_suspend(dwc->usb3_phy, 1);

	pm_runtime_disable(&pdev->dev);

	dwc3_debugfs_exit(dwc);

	switch (dwc->mode) {
	case DWC3_MODE_DEVICE:
		dwc3_gadget_exit(dwc);
		break;
	case DWC3_MODE_HOST:
		dwc3_host_exit(dwc);
		break;
	case DWC3_MODE_DRD:
		dwc3_gadget_exit(dwc);
		dwc3_host_exit(dwc);
		dwc3_otg_exit(dwc);
		break;
	default:
		/* do nothing */
		break;
	}

	dwc3_event_buffers_cleanup(dwc);
	dwc3_free_event_buffers(dwc);
	dwc3_core_exit(dwc);

	return 0;
}
コード例 #2
0
ファイル: core.c プロジェクト: enclustra-bsp/xilinx-linux
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;
}
コード例 #3
0
ファイル: core.c プロジェクト: Yerguer/linux
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;
}
コード例 #4
0
ファイル: core.c プロジェクト: asmalldev/linux
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);
}
コード例 #5
0
ファイル: core.c プロジェクト: Xilinx/linux-xlnx
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);
}
コード例 #6
0
ファイル: ehci-msm.c プロジェクト: Menpiko/SnaPKernel-N6P
static int ehci_msm_pm_resume(struct device *dev)
{
	struct usb_hcd *hcd = dev_get_drvdata(dev);
	int ret;
	u32 portsc;

	dev_dbg(dev, "ehci-msm PM resume\n");
	if (!hcd->rh_registered)
		return 0;

	/* Notify OTG to bring hw out of LPM before restoring wakeup flags */
	ret = usb_phy_set_suspend(phy, 0);
	if (ret)
		return ret;

	ehci_resume(hcd, false);
	portsc = readl_relaxed(USB_PORTSC);
	portsc &= ~PORT_RWC_BITS;
	portsc |= PORT_RESUME;
	writel_relaxed(portsc, USB_PORTSC);
	/* Resume root-hub to handle USB event if any else initiate LPM again */
	usb_hcd_resume_root_hub(hcd);

	return ret;
}
コード例 #7
0
ファイル: ehci-msm.c プロジェクト: itsmerajit/kernel_otus
static int ehci_msm_pm_suspend(struct device *dev)
{
    struct usb_hcd *hcd = dev_get_drvdata(dev);
    bool wakeup = device_may_wakeup(dev);

    dev_dbg(dev, "ehci-msm PM suspend\n");

    if (!hcd->rh_registered)
        return 0;

    /*
     * EHCI helper function has also the same check before manipulating
     * port wakeup flags.  We do check here the same condition before
     * calling the same helper function to avoid bringing hardware
     * from Low power mode when there is no need for adjusting port
     * wakeup flags.
     */
    if (hcd->self.root_hub->do_remote_wakeup && !wakeup) {
        pm_runtime_resume(dev);
        ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd),
                wakeup);
    }

    return usb_phy_set_suspend(phy, 1);
}
コード例 #8
0
ファイル: ehci-tegra.c プロジェクト: FrozenCow/FIRE-ICE
static int tegra_ehci_bus_suspend(struct usb_hcd *hcd)
{
	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
	int err = 0;
	EHCI_DBG("%s() BEGIN\n", __func__);

#ifdef CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ
	tegra->boost_requested = false;
	if (tegra->boost_enable
	    && pm_qos_request_active(&tegra->boost_cpu_freq_req))
		pm_qos_update_request(&tegra->boost_cpu_freq_req,
			PM_QOS_DEFAULT_VALUE);
	tegra->cpu_boost_in_work = false;
#endif

	mutex_lock(&tegra->sync_lock);
	tegra->bus_suspended_fail = false;
	err = ehci_bus_suspend(hcd);
	if (err)
		tegra->bus_suspended_fail = true;
	else
		usb_phy_set_suspend(get_usb_phy(tegra->phy), 1);
	mutex_unlock(&tegra->sync_lock);
	EHCI_DBG("%s() END\n", __func__);

	return err;
}
コード例 #9
0
static int xhci_msm_runtime_suspend(struct device *dev)
{
	dev_dbg(dev, "xhci msm runtime suspend\n");
	if (phy)
		return usb_phy_set_suspend(phy, 1);

	return 0;
}
コード例 #10
0
static int xhci_msm_pm_suspend(struct device *dev)
{
	dev_dbg(dev, "xhci-msm PM suspend\n");

	if (phy)
		return usb_phy_set_suspend(phy, 1);

	return 0;
}
コード例 #11
0
ファイル: ehci-tegra.c プロジェクト: AllenDou/linux
static void tegra_ehci_power_up(struct usb_hcd *hcd)
{
	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);

	clk_prepare_enable(tegra->emc_clk);
	clk_prepare_enable(tegra->clk);
	usb_phy_set_suspend(&tegra->phy->u_phy, 0);
	tegra->host_resumed = 1;
}
コード例 #12
0
ファイル: ehci-tegra.c プロジェクト: AllenDou/linux
static void tegra_ehci_power_down(struct usb_hcd *hcd)
{
	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);

	tegra->host_resumed = 0;
	usb_phy_set_suspend(&tegra->phy->u_phy, 1);
	clk_disable_unprepare(tegra->clk);
	clk_disable_unprepare(tegra->emc_clk);
}
コード例 #13
0
ファイル: ehci-msm.c プロジェクト: Menpiko/SnaPKernel-N6P
static int ehci_msm_runtime_suspend(struct device *dev)
{
	dev_dbg(dev, "ehci runtime suspend\n");
	/*
	 * Notify OTG about suspend.  It takes care of
	 * putting the hardware in LPM.
	 */
	return usb_phy_set_suspend(phy, 1);
}
コード例 #14
0
ファイル: ux500.c プロジェクト: 0xroot/Blackphone-BP1-Kernel
static int ux500_suspend(struct device *dev)
{
	struct ux500_glue	*glue = dev_get_drvdata(dev);
	struct musb		*musb = glue_to_musb(glue);

	usb_phy_set_suspend(musb->xceiv, 1);
	clk_disable(glue->clk);

	return 0;
}
コード例 #15
0
static irqreturn_t ci13xxx_msm_resume_irq(int irq, void *data)
{
	struct ci13xxx *udc = _udc;

	if (udc->transceiver && udc->vbus_active && udc->suspended)
		usb_phy_set_suspend(udc->transceiver, 0);
	else if (!udc->suspended)
		ci13xxx_msm_resume();

	return IRQ_HANDLED;
}
コード例 #16
0
ファイル: board-lager.c プロジェクト: Etn40ff/CI20_linux
static int usbhs_power_ctrl(struct platform_device *pdev,
				void __iomem *base, int enable)
{
	struct usbhs_private *priv = usbhs_get_priv(pdev);

	if (!priv->phy)
		return -ENODEV;

	if (enable) {
		int retval = usb_phy_init(priv->phy);

		if (!retval)
			retval = usb_phy_set_suspend(priv->phy, 0);
		return retval;
	}

	usb_phy_set_suspend(priv->phy, 1);
	usb_phy_shutdown(priv->phy);
	return 0;
}
コード例 #17
0
static irqreturn_t ci13xxx_msm_resume_irq(int irq, void *data)
{
	struct ci13xxx *ci = data;

	if (ci->transceiver && ci->vbus_active && ci->suspended)
		usb_phy_set_suspend(ci->transceiver, 0);
	else if (!ci->suspended)
		ci13xxx_msm_resume(ci);

	return IRQ_HANDLED;
}
コード例 #18
0
ファイル: ehci-msm.c プロジェクト: Menpiko/SnaPKernel-N6P
static int ehci_msm_pm_suspend(struct device *dev)
{
	struct usb_hcd *hcd = dev_get_drvdata(dev);

	dev_dbg(dev, "ehci-msm PM suspend\n");

	if (!hcd->rh_registered)
		return 0;

	return usb_phy_set_suspend(phy, 1);
}
コード例 #19
0
ファイル: core.c プロジェクト: Felixneu/Power-Management
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;
}
コード例 #20
0
static int xhci_msm_pm_resume(struct device *dev)
{
	dev_dbg(dev, "xhci-msm PM resume\n");

	if (pm_runtime_suspended(dev))
		return 0;

	if (phy)
		return usb_phy_set_suspend(phy, 0);

	return 0;
}
コード例 #21
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;
}
コード例 #22
0
static int tegra_ehci_bus_resume(struct usb_hcd *hcd)
{
	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
	int err = 0;
	EHCI_DBG("%s() BEGIN\n", __func__);

	mutex_lock(&tegra->sync_lock);
	usb_phy_set_suspend(get_usb_phy(tegra->phy), 0);
	err = ehci_bus_resume(hcd);
	mutex_unlock(&tegra->sync_lock);
	EHCI_DBG("%s() END\n", __func__);

	return err;
}
コード例 #23
0
ファイル: omap2430.c プロジェクト: Cool-Joe/imx23-audio
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);
		usb_phy_set_suspend(musb->xceiv, 1);
	}

	return 0;
}
コード例 #24
0
ファイル: omap2430.c プロジェクト: Cool-Joe/imx23-audio
static int omap2430_runtime_resume(struct device *dev)
{
	struct omap2430_glue		*glue = dev_get_drvdata(dev);
	struct musb			*musb = glue_to_musb(glue);

	if (musb) {
		omap2430_low_level_init(musb);
		musb_writel(musb->mregs, OTG_INTERFSEL,
				musb->context.otg_interfsel);

		usb_phy_set_suspend(musb->xceiv, 0);
	}

	return 0;
}
コード例 #25
0
ファイル: ux500.c プロジェクト: 0xroot/Blackphone-BP1-Kernel
static int ux500_resume(struct device *dev)
{
	struct ux500_glue	*glue = dev_get_drvdata(dev);
	struct musb		*musb = glue_to_musb(glue);
	int			ret;

	ret = clk_enable(glue->clk);
	if (ret) {
		dev_err(dev, "failed to enable clock\n");
		return ret;
	}

	usb_phy_set_suspend(musb->xceiv, 0);

	return 0;
}
コード例 #26
0
static int tegra_ehci_bus_suspend(struct usb_hcd *hcd)
{
	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
	int err = 0;
	EHCI_DBG("%s() BEGIN\n", __func__);
	mutex_lock(&tegra->sync_lock);
	tegra->bus_suspended_fail = false;
	err = ehci_bus_suspend(hcd);
	if (err)
		tegra->bus_suspended_fail = true;
	else
		usb_phy_set_suspend(get_usb_phy(tegra->phy), 1);
	mutex_unlock(&tegra->sync_lock);
	EHCI_DBG("%s() END\n", __func__);

	return err;
}
コード例 #27
0
ファイル: ehci-msm.c プロジェクト: Menpiko/SnaPKernel-N6P
static int ehci_msm_runtime_resume(struct device *dev)
{
	struct usb_hcd *hcd = dev_get_drvdata(dev);
	int ret;
	u32 portsc;

	dev_dbg(dev, "ehci runtime resume\n");
	ret = usb_phy_set_suspend(phy, 0);
	if (ret)
		return ret;

	portsc = readl_relaxed(USB_PORTSC);
	portsc &= ~PORT_RWC_BITS;
	portsc |= PORT_RESUME;
	writel_relaxed(portsc, USB_PORTSC);

	return ret;
}
コード例 #28
0
static int ehci_msm_bus_resume(struct usb_hcd *hcd)
{
    struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd);
    struct device *dev = hcd->self.controller;

    wake_lock(&mhcd->wlock);
    pm_runtime_get_noresume(dev);
    pm_runtime_resume(dev);

    if (PHY_TYPE(mhcd->pdata->phy_info) == USB_PHY_INTEGRATED) {
        usb_phy_set_suspend(mhcd->xceiv, 0);
    } else { /* PMIC serial phy */
        usb_lpm_exit(hcd);
        if (cancel_work_sync(&(mhcd->lpm_exit_work)))
            usb_lpm_exit_w(&mhcd->lpm_exit_work);
    }

    return ehci_bus_resume(hcd);

}
コード例 #29
0
ファイル: ehci-msm.c プロジェクト: itsmerajit/kernel_otus
static int ehci_msm_pm_resume(struct device *dev)
{
    struct usb_hcd *hcd = dev_get_drvdata(dev);
    int ret;

    dev_dbg(dev, "ehci-msm PM resume\n");

    if (!hcd->rh_registered)
        return 0;

    /* Notify OTG to bring hw out of LPM before restoring wakeup flags */
    ret = usb_phy_set_suspend(phy, 0);
    if (ret)
        return ret;

    ehci_prepare_ports_for_controller_resume(hcd_to_ehci(hcd));
    /* Resume root-hub to handle USB event if any else initiate LPM again */
    usb_hcd_resume_root_hub(hcd);

    return ret;
}
コード例 #30
0
static int ehci_msm_bus_suspend(struct usb_hcd *hcd)
{
    int ret;
    struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd);
    struct device *dev = hcd->self.controller;

    ret = ehci_bus_suspend(hcd);
    if (ret) {
        pr_err("ehci_bus suspend faield\n");
        return ret;
    }
    if (PHY_TYPE(mhcd->pdata->phy_info) == USB_PHY_INTEGRATED)
        ret = usb_phy_set_suspend(mhcd->xceiv, 1);
    else
        ret = usb_lpm_enter(hcd);

    pm_runtime_put_noidle(dev);
    pm_runtime_suspend(dev);
    wake_unlock(&mhcd->wlock);
    return ret;
}