コード例 #1
0
ファイル: omap-usb-host.c プロジェクト: AshishNamdev/linux
static int usbhs_runtime_suspend(struct device *dev)
{
	struct usbhs_hcd_omap		*omap = dev_get_drvdata(dev);
	struct usbhs_omap_platform_data	*pdata = omap->pdata;
	int i;

	dev_dbg(dev, "usbhs_runtime_suspend\n");

	for (i = 0; i < omap->nports; i++) {
		switch (pdata->port_mode[i]) {
		case OMAP_EHCI_PORT_MODE_HSIC:
			if (!IS_ERR(omap->hsic60m_clk[i]))
				clk_disable_unprepare(omap->hsic60m_clk[i]);

			if (!IS_ERR(omap->hsic480m_clk[i]))
				clk_disable_unprepare(omap->hsic480m_clk[i]);
		/* Fall through as utmi_clks were used in HSIC mode */

		case OMAP_EHCI_PORT_MODE_TLL:
			if (!IS_ERR(omap->utmi_clk[i]))
				clk_disable_unprepare(omap->utmi_clk[i]);
			break;
		default:
			break;
		}
	}

	if (!IS_ERR(omap->ehci_logic_fck))
		clk_disable_unprepare(omap->ehci_logic_fck);

	omap_tll_disable(pdata);

	return 0;
}
コード例 #2
0
static int usbhs_runtime_suspend(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct omap_device *od = to_omap_device(pdev);
	struct usbhs_hcd_omap		*omap = dev_get_drvdata(dev);
	struct usbhs_omap_platform_data	*pdata = &omap->platdata;

	dev_dbg(dev, "usbhs_runtime_suspend\n");

	if (!pdata) {
		dev_dbg(dev, "missing platform_data\n");
		return  -ENODEV;
	}

	omap_hwmod_enable_wakeup(od->hwmods[0]);
	if (is_ehci_tll_mode(pdata->port_mode[0]) ||
			is_ehci_hsic_mode(pdata->port_mode[0]))
		clk_disable(omap->usbhost_p1_fck);

	if (is_ehci_tll_mode(pdata->port_mode[1]) ||
			is_ehci_hsic_mode(pdata->port_mode[1]))
		clk_disable(omap->usbhost_p2_fck);

	if (is_ehci_tll_mode(pdata->port_mode[2]) ||
			is_ehci_hsic_mode(pdata->port_mode[2]))
		clk_disable(omap->usbhost_p3_fck);

	if (is_ehci_hsic_mode(pdata->port_mode[0])) {
		clk_disable(omap->usb_host_hs_hsic60m_p1_clk);
		clk_disable(omap->usb_host_hs_hsic480m_p1_clk);
	}

	if (is_ehci_hsic_mode(pdata->port_mode[1])) {
		clk_disable(omap->usb_host_hs_hsic60m_p2_clk);
		clk_disable(omap->usb_host_hs_hsic480m_p2_clk);
	}

	if (is_ehci_hsic_mode(pdata->port_mode[2])) {
		clk_disable(omap->usb_host_hs_hsic60m_p3_clk);
		clk_disable(omap->usb_host_hs_hsic480m_p3_clk);
	}

	clk_disable(omap->utmi_p2_fck);
	clk_disable(omap->utmi_p1_fck);
	if (omap->ehci_logic_fck && !IS_ERR(omap->ehci_logic_fck))
		clk_disable(omap->ehci_logic_fck);

	omap_tll_disable();

	return 0;
}
コード例 #3
0
ファイル: omap_tll.c プロジェクト: 2trill2spill/freebsd
static int
omap_tll_detach(device_t dev)
{
	struct omap_tll_softc *sc;

	sc = device_get_softc(dev);
	omap_tll_disable(sc);

	/* Release the other register set memory maps */
	if (sc->tll_mem_res) {
		bus_release_resource(dev, SYS_RES_MEMORY,
		    sc->tll_mem_rid, sc->tll_mem_res);
		sc->tll_mem_res = NULL;
	}

	omap_tll_sc = NULL;

	return (0);
}