static void msm_hsusb_otg_work(struct work_struct *work) { struct msmusb_hcd *mhcd; mhcd = container_of(work, struct msmusb_hcd, otg_work); msm_hsusb_request_host((void *)mhcd, mhcd->flags); }
static int __exit ehci_msm_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd); struct msm_usb_host_platform_data *pdata; int retval = 0; pdata = pdev->dev.platform_data; device_init_wakeup(&pdev->dev, 0); #ifdef CONFIG_USB_HOST_NOTIFY host_notify_dev_unregister(&hcd->ndev); #endif msm_hsusb_request_host((void *)mhcd, REQUEST_STOP); msm_xusb_uninit_host(mhcd); retval = msm_xusb_rpc_close(mhcd); wake_lock_destroy(&mhcd->wlock); usb_put_hcd(hcd); clk_put(pdata->ebi1_clk); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); return retval; }
static void msm_hsusb_start_host(struct usb_bus *bus, int start) { struct usb_hcd *hcd = bus_to_hcd(bus); struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd); mhcd->flags = start; if (in_interrupt()) schedule_work(&mhcd->otg_work); else msm_hsusb_request_host((void *)mhcd, mhcd->flags); }
static int __exit ehci_msm_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd); int retval = 0; device_init_wakeup(&pdev->dev, 0); msm_hsusb_request_host((void *)mhcd, REQUEST_STOP); msm_xusb_uninit_host(mhcd); usb_put_hcd(hcd); retval = msm_xusb_rpc_close(mhcd); wake_lock_destroy(&mhcd->wlock); pm_qos_remove_requirement(PM_QOS_SYSTEM_BUS_FREQ, (char *) dev_name(&pdev->dev)); return retval; }
static int __exit ehci_msm_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd); int retval = 0; device_init_wakeup(&pdev->dev, 0); msm_hsusb_request_host(mhcd, REQUEST_STOP); if (mhcd->xceiv && mhcd->xceiv->set_host) mhcd->xceiv->set_host(mhcd->xceiv, NULL); msm_otg_put_transceiver(mhcd->xceiv); iounmap(hcd->regs); usb_put_hcd(hcd); retval = msm_xusb_rpc_close(mhcd); clk_put(mhcd->clk); clk_put(mhcd->pclk); wake_lock_destroy(&mhcd->wlock); pm_qos_remove_requirement(PM_QOS_SYSTEM_BUS_FREQ, pdev->dev.bus_id); return retval; }
static int msm_xusb_otg_register(struct msmusb_hcd *mhcd) { int ret = 0; struct msm_usb_host_platform_data *pdata = mhcd->pdata; switch (PHY_TYPE(pdata->phy_info)) { case USB_PHY_INTEGRATED: ret = msm_xusb_init_phy(mhcd); if (ret) break; mhcd->xceiv = msm_otg_get_transceiver(); if (mhcd->xceiv && mhcd->xceiv->set_host) mhcd->xceiv->set_host(mhcd->xceiv, &mhcd->otg_ops); else msm_hsusb_request_host(mhcd, REQUEST_START); break; case USB_PHY_SERIAL_PMIC: msm_xusb_init_phy(mhcd); break; default: pr_err("phy type is bad\n"); } return ret; }