示例#1
0
static int usbhs_runtime_resume(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_resume\n");

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

	omap_tll_enable();

	if (omap->ehci_logic_fck && !IS_ERR(omap->ehci_logic_fck))
		clk_enable(omap->ehci_logic_fck);

	if (is_ehci_tll_mode(pdata->port_mode[0]) ||
			is_ehci_hsic_mode(pdata->port_mode[0]))
		clk_enable(omap->usbhost_p1_fck);

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

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

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

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

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

	clk_enable(omap->utmi_p1_fck);
	clk_enable(omap->utmi_p2_fck);

	omap_hwmod_disable_wakeup(od->hwmods[0]);

	return 0;
}
示例#2
0
static int usbhs_runtime_resume(struct device *dev)
{
	struct usbhs_hcd_omap		*omap = dev_get_drvdata(dev);
	struct usbhs_omap_platform_data	*pdata = omap->pdata;
	int i, r;

	dev_dbg(dev, "usbhs_runtime_resume\n");

	omap_tll_enable(pdata);

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

	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])) {
				r = clk_prepare_enable(omap->hsic60m_clk[i]);
				if (r) {
					dev_err(dev,
					 "Can't enable port %d hsic60m clk:%d\n",
					 i, r);
				}
			}

			if (!IS_ERR(omap->hsic480m_clk[i])) {
				r = clk_prepare_enable(omap->hsic480m_clk[i]);
				if (r) {
					dev_err(dev,
					 "Can't enable port %d hsic480m clk:%d\n",
					 i, r);
				}
			}
		/* Fall through as HSIC mode needs utmi_clk */

		case OMAP_EHCI_PORT_MODE_TLL:
			if (!IS_ERR(omap->utmi_clk[i])) {
				r = clk_prepare_enable(omap->utmi_clk[i]);
				if (r) {
					dev_err(dev,
					 "Can't enable port %d clk : %d\n",
					 i, r);
				}
			}
			break;
		default:
			break;
		}
	}

	return 0;
}