Lines Matching +full:usb +full:- +full:ehci
1 // SPDX-License-Identifier: GPL-2.0+
3 * ehci-omap.c - driver for USBHOST on OMAP3/4 processors
5 * Bus Glue for the EHCI controllers in OMAP3/4
8 * Copyright (C) 2007-2013 Texas Instruments, Inc.
17 * Based on "ehci-fsl.c" and "ehci-au1xxx.c" ehci glue layers
25 #include <linux/usb/ulpi.h>
28 #include <linux/usb.h>
29 #include <linux/usb/hcd.h>
31 #include <linux/dma-mapping.h>
33 #include "ehci.h"
35 #include <linux/platform_data/usb-omap.h>
37 /* EHCI Register Set */
48 #define DRIVER_DESC "OMAP-EHCI Host Controller driver"
50 static const char hcd_name[] = "ehci-omap";
52 /*-------------------------------------------------------------------------*/
74 * ehci_hcd_omap_probe - initialize TI-based HCDs
77 * Allocates basic resources for this USB host controller, and
83 struct device *dev = &pdev->dev; in ehci_hcd_omap_probe()
94 return -ENODEV; in ehci_hcd_omap_probe()
96 if (!dev->parent) { in ehci_hcd_omap_probe()
98 return -ENODEV; in ehci_hcd_omap_probe()
102 if (dev->of_node) { in ehci_hcd_omap_probe()
103 pdata = dev_get_platdata(dev->parent); in ehci_hcd_omap_probe()
104 dev->platform_data = pdata; in ehci_hcd_omap_probe()
109 return -ENODEV; in ehci_hcd_omap_probe()
121 * Right now device-tree probed devices don't get dma_mask set. in ehci_hcd_omap_probe()
122 * Since shared usb code relies on it, set it here for now. in ehci_hcd_omap_probe()
129 ret = -ENODEV; in ehci_hcd_omap_probe()
134 return -ENOMEM; in ehci_hcd_omap_probe()
137 hcd->rsrc_start = res->start; in ehci_hcd_omap_probe()
138 hcd->rsrc_len = resource_size(res); in ehci_hcd_omap_probe()
139 hcd->regs = regs; in ehci_hcd_omap_probe()
140 hcd_to_ehci(hcd)->caps = regs; in ehci_hcd_omap_probe()
142 omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv; in ehci_hcd_omap_probe()
143 omap->nports = pdata->nports; in ehci_hcd_omap_probe()
148 for (i = 0 ; i < omap->nports ; i++) { in ehci_hcd_omap_probe()
155 if (ret == -ENODEV) { /* no PHY */ in ehci_hcd_omap_probe()
160 if (ret != -EPROBE_DEFER) in ehci_hcd_omap_probe()
166 omap->phy[i] = phy; in ehci_hcd_omap_probe()
168 if (pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY) { in ehci_hcd_omap_probe()
169 usb_phy_init(omap->phy[i]); in ehci_hcd_omap_probe()
171 usb_phy_set_suspend(omap->phy[i], 0); in ehci_hcd_omap_probe()
179 * An undocumented "feature" in the OMAP3 EHCI controller, in ehci_hcd_omap_probe()
183 * This breaks suspend-resume if the root-hub is allowed in ehci_hcd_omap_probe()
195 device_wakeup_enable(hcd->self.controller); in ehci_hcd_omap_probe()
199 * Even though HSIC mode is a PHY-less mode, the reset in ehci_hcd_omap_probe()
203 for (i = 0; i < omap->nports; i++) { in ehci_hcd_omap_probe()
204 if (!omap->phy[i] || in ehci_hcd_omap_probe()
205 pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY) in ehci_hcd_omap_probe()
208 usb_phy_init(omap->phy[i]); in ehci_hcd_omap_probe()
210 usb_phy_set_suspend(omap->phy[i], 0); in ehci_hcd_omap_probe()
220 for (i = 0; i < omap->nports; i++) { in ehci_hcd_omap_probe()
221 if (omap->phy[i]) in ehci_hcd_omap_probe()
222 usb_phy_shutdown(omap->phy[i]); in ehci_hcd_omap_probe()
232 * ehci_hcd_omap_remove - shutdown processing for EHCI HCDs
233 * @pdev: USB Host Controller being removed
241 struct device *dev = &pdev->dev; in ehci_hcd_omap_remove()
243 struct omap_hcd *omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv; in ehci_hcd_omap_remove()
248 for (i = 0; i < omap->nports; i++) { in ehci_hcd_omap_remove()
249 if (omap->phy[i]) in ehci_hcd_omap_remove()
250 usb_phy_shutdown(omap->phy[i]); in ehci_hcd_omap_remove()
259 { .compatible = "ti,ehci-omap" },
277 /*-------------------------------------------------------------------------*/
282 return -ENODEV; in ehci_omap_init()
295 MODULE_ALIAS("platform:ehci-omap");