xref: /linux/drivers/usb/host/ehci-pci.c (revision 64a21d025d3a979a8715f2ec7acabca7b5406c8a)
17ff71d6aSMatt Porter /*
27ff71d6aSMatt Porter  * EHCI HCD (Host Controller Driver) PCI Bus Glue.
37ff71d6aSMatt Porter  *
47ff71d6aSMatt Porter  * Copyright (c) 2000-2004 by David Brownell
57ff71d6aSMatt Porter  *
67ff71d6aSMatt Porter  * This program is free software; you can redistribute it and/or modify it
77ff71d6aSMatt Porter  * under the terms of the GNU General Public License as published by the
87ff71d6aSMatt Porter  * Free Software Foundation; either version 2 of the License, or (at your
97ff71d6aSMatt Porter  * option) any later version.
107ff71d6aSMatt Porter  *
117ff71d6aSMatt Porter  * This program is distributed in the hope that it will be useful, but
127ff71d6aSMatt Porter  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
137ff71d6aSMatt Porter  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
147ff71d6aSMatt Porter  * for more details.
157ff71d6aSMatt Porter  *
167ff71d6aSMatt Porter  * You should have received a copy of the GNU General Public License
177ff71d6aSMatt Porter  * along with this program; if not, write to the Free Software Foundation,
187ff71d6aSMatt Porter  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
197ff71d6aSMatt Porter  */
207ff71d6aSMatt Porter 
217ff71d6aSMatt Porter #ifndef CONFIG_PCI
227ff71d6aSMatt Porter #error "This file is PCI bus glue.  CONFIG_PCI must be defined."
237ff71d6aSMatt Porter #endif
247ff71d6aSMatt Porter 
257ff71d6aSMatt Porter /*-------------------------------------------------------------------------*/
267ff71d6aSMatt Porter 
2718807521SDavid Brownell /* called after powerup, by probe or system-pm "wakeup" */
2818807521SDavid Brownell static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
2918807521SDavid Brownell {
3018807521SDavid Brownell 	u32			temp;
3118807521SDavid Brownell 	int			retval;
3218807521SDavid Brownell 
3318807521SDavid Brownell 	/* optional debug port, normally in the first BAR */
3418807521SDavid Brownell 	temp = pci_find_capability(pdev, 0x0a);
3518807521SDavid Brownell 	if (temp) {
3618807521SDavid Brownell 		pci_read_config_dword(pdev, temp, &temp);
3718807521SDavid Brownell 		temp >>= 16;
3818807521SDavid Brownell 		if ((temp & (3 << 13)) == (1 << 13)) {
3918807521SDavid Brownell 			temp &= 0x1fff;
4018807521SDavid Brownell 			ehci->debug = ehci_to_hcd(ehci)->regs + temp;
4118807521SDavid Brownell 			temp = readl(&ehci->debug->control);
4218807521SDavid Brownell 			ehci_info(ehci, "debug port %d%s\n",
4318807521SDavid Brownell 				HCS_DEBUG_PORT(ehci->hcs_params),
4418807521SDavid Brownell 				(temp & DBGP_ENABLED)
4518807521SDavid Brownell 					? " IN USE"
4618807521SDavid Brownell 					: "");
4718807521SDavid Brownell 			if (!(temp & DBGP_ENABLED))
4818807521SDavid Brownell 				ehci->debug = NULL;
4918807521SDavid Brownell 		}
5018807521SDavid Brownell 	}
5118807521SDavid Brownell 
52401feafaSDavid Brownell 	/* we expect static quirk code to handle the "extended capabilities"
53401feafaSDavid Brownell 	 * (currently just BIOS handoff) allowed starting with EHCI 0.96
54401feafaSDavid Brownell 	 */
5518807521SDavid Brownell 
5618807521SDavid Brownell 	/* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */
5718807521SDavid Brownell 	retval = pci_set_mwi(pdev);
5818807521SDavid Brownell 	if (!retval)
5918807521SDavid Brownell 		ehci_dbg(ehci, "MWI active\n");
6018807521SDavid Brownell 
6118807521SDavid Brownell 	ehci_port_power(ehci, 0);
6218807521SDavid Brownell 
6318807521SDavid Brownell 	return 0;
6418807521SDavid Brownell }
6518807521SDavid Brownell 
668926bfa7SDavid Brownell /* called during probe() after chip reset completes */
678926bfa7SDavid Brownell static int ehci_pci_setup(struct usb_hcd *hcd)
687ff71d6aSMatt Porter {
697ff71d6aSMatt Porter 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
70abcc9448SDavid Brownell 	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
717ff71d6aSMatt Porter 	u32			temp;
7218807521SDavid Brownell 	int			retval;
737ff71d6aSMatt Porter 
747ff71d6aSMatt Porter 	ehci->caps = hcd->regs;
757ff71d6aSMatt Porter 	ehci->regs = hcd->regs + HC_LENGTH(readl(&ehci->caps->hc_capbase));
767ff71d6aSMatt Porter 	dbg_hcs_params(ehci, "reset");
777ff71d6aSMatt Porter 	dbg_hcc_params(ehci, "reset");
787ff71d6aSMatt Porter 
79c32ba30fSPaul Serice         /* ehci_init() causes memory for DMA transfers to be
80c32ba30fSPaul Serice          * allocated.  Thus, any vendor-specific workarounds based on
81c32ba30fSPaul Serice          * limiting the type of memory used for DMA transfers must
82c32ba30fSPaul Serice          * happen before ehci_init() is called. */
83c32ba30fSPaul Serice 	switch (pdev->vendor) {
84c32ba30fSPaul Serice 	case PCI_VENDOR_ID_NVIDIA:
85c32ba30fSPaul Serice 		/* NVidia reports that certain chips don't handle
86c32ba30fSPaul Serice 		 * QH, ITD, or SITD addresses above 2GB.  (But TD,
87c32ba30fSPaul Serice 		 * data buffer, and periodic schedule are normal.)
88c32ba30fSPaul Serice 		 */
89c32ba30fSPaul Serice 		switch (pdev->device) {
90c32ba30fSPaul Serice 		case 0x003c:	/* MCP04 */
91c32ba30fSPaul Serice 		case 0x005b:	/* CK804 */
92c32ba30fSPaul Serice 		case 0x00d8:	/* CK8 */
93c32ba30fSPaul Serice 		case 0x00e8:	/* CK8S */
94c32ba30fSPaul Serice 			if (pci_set_consistent_dma_mask(pdev,
95c32ba30fSPaul Serice 						DMA_31BIT_MASK) < 0)
96c32ba30fSPaul Serice 				ehci_warn(ehci, "can't enable NVidia "
97c32ba30fSPaul Serice 					"workaround for >2GB RAM\n");
98c32ba30fSPaul Serice 			break;
99c32ba30fSPaul Serice 		}
100c32ba30fSPaul Serice 		break;
101c32ba30fSPaul Serice 	}
102c32ba30fSPaul Serice 
1037ff71d6aSMatt Porter 	/* cache this readonly data; minimize chip reads */
1047ff71d6aSMatt Porter 	ehci->hcs_params = readl(&ehci->caps->hcs_params);
1057ff71d6aSMatt Porter 
10618807521SDavid Brownell 	retval = ehci_halt(ehci);
10718807521SDavid Brownell 	if (retval)
10818807521SDavid Brownell 		return retval;
10918807521SDavid Brownell 
1108926bfa7SDavid Brownell 	/* data structure init */
1118926bfa7SDavid Brownell 	retval = ehci_init(hcd);
1128926bfa7SDavid Brownell 	if (retval)
1138926bfa7SDavid Brownell 		return retval;
1148926bfa7SDavid Brownell 
1157ff71d6aSMatt Porter 	switch (pdev->vendor) {
1167ff71d6aSMatt Porter 	case PCI_VENDOR_ID_TDI:
1177ff71d6aSMatt Porter 		if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
1187ff71d6aSMatt Porter 			ehci->is_tdi_rh_tt = 1;
1197ff71d6aSMatt Porter 			tdi_reset(ehci);
1207ff71d6aSMatt Porter 		}
1217ff71d6aSMatt Porter 		break;
1227ff71d6aSMatt Porter 	case PCI_VENDOR_ID_AMD:
1237ff71d6aSMatt Porter 		/* AMD8111 EHCI doesn't work, according to AMD errata */
1247ff71d6aSMatt Porter 		if (pdev->device == 0x7463) {
1257ff71d6aSMatt Porter 			ehci_info(ehci, "ignoring AMD8111 (errata)\n");
1268926bfa7SDavid Brownell 			retval = -EIO;
1278926bfa7SDavid Brownell 			goto done;
1287ff71d6aSMatt Porter 		}
1297ff71d6aSMatt Porter 		break;
1307ff71d6aSMatt Porter 	case PCI_VENDOR_ID_NVIDIA:
131f8aeb3bbSDavid Brownell 		switch (pdev->device) {
132f8aeb3bbSDavid Brownell 		/* Some NForce2 chips have problems with selective suspend;
133f8aeb3bbSDavid Brownell 		 * fixed in newer silicon.
134f8aeb3bbSDavid Brownell 		 */
135f8aeb3bbSDavid Brownell 		case 0x0068:
136f8aeb3bbSDavid Brownell 			pci_read_config_dword(pdev, PCI_REVISION_ID, &temp);
137f8aeb3bbSDavid Brownell 			if ((temp & 0xff) < 0xa4)
138f8aeb3bbSDavid Brownell 				ehci->no_selective_suspend = 1;
139f8aeb3bbSDavid Brownell 			break;
1407ff71d6aSMatt Porter 		}
1417ff71d6aSMatt Porter 		break;
1427ff71d6aSMatt Porter 	}
1437ff71d6aSMatt Porter 
1447ff71d6aSMatt Porter 	if (ehci_is_TDI(ehci))
1457ff71d6aSMatt Porter 		ehci_reset(ehci);
1467ff71d6aSMatt Porter 
1477ff71d6aSMatt Porter 	/* at least the Genesys GL880S needs fixup here */
1487ff71d6aSMatt Porter 	temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);
1497ff71d6aSMatt Porter 	temp &= 0x0f;
1507ff71d6aSMatt Porter 	if (temp && HCS_N_PORTS(ehci->hcs_params) > temp) {
1517ff71d6aSMatt Porter 		ehci_dbg(ehci, "bogus port configuration: "
1527ff71d6aSMatt Porter 			"cc=%d x pcc=%d < ports=%d\n",
1537ff71d6aSMatt Porter 			HCS_N_CC(ehci->hcs_params),
1547ff71d6aSMatt Porter 			HCS_N_PCC(ehci->hcs_params),
1557ff71d6aSMatt Porter 			HCS_N_PORTS(ehci->hcs_params));
1567ff71d6aSMatt Porter 
1577ff71d6aSMatt Porter 		switch (pdev->vendor) {
1587ff71d6aSMatt Porter 		case 0x17a0:		/* GENESYS */
1597ff71d6aSMatt Porter 			/* GL880S: should be PORTS=2 */
1607ff71d6aSMatt Porter 			temp |= (ehci->hcs_params & ~0xf);
1617ff71d6aSMatt Porter 			ehci->hcs_params = temp;
1627ff71d6aSMatt Porter 			break;
1637ff71d6aSMatt Porter 		case PCI_VENDOR_ID_NVIDIA:
1647ff71d6aSMatt Porter 			/* NF4: should be PCC=10 */
1657ff71d6aSMatt Porter 			break;
1667ff71d6aSMatt Porter 		}
1677ff71d6aSMatt Porter 	}
1687ff71d6aSMatt Porter 
1697ff71d6aSMatt Porter 	/* Serial Bus Release Number is at PCI 0x60 offset */
1707ff71d6aSMatt Porter 	pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
1717ff71d6aSMatt Porter 
1722c1c3c4cSDavid Brownell 	/* Workaround current PCI init glitch:  wakeup bits aren't
1732c1c3c4cSDavid Brownell 	 * being set from PCI PM capability.
1742c1c3c4cSDavid Brownell 	 */
1752c1c3c4cSDavid Brownell 	if (!device_can_wakeup(&pdev->dev)) {
1762c1c3c4cSDavid Brownell 		u16	port_wake;
1772c1c3c4cSDavid Brownell 
1782c1c3c4cSDavid Brownell 		pci_read_config_word(pdev, 0x62, &port_wake);
1792c1c3c4cSDavid Brownell 		if (port_wake & 0x0001)
1802c1c3c4cSDavid Brownell 			device_init_wakeup(&pdev->dev, 1);
1812c1c3c4cSDavid Brownell 	}
1827ff71d6aSMatt Porter 
183f8aeb3bbSDavid Brownell #ifdef	CONFIG_USB_SUSPEND
184f8aeb3bbSDavid Brownell 	/* REVISIT: the controller works fine for wakeup iff the root hub
185f8aeb3bbSDavid Brownell 	 * itself is "globally" suspended, but usbcore currently doesn't
186f8aeb3bbSDavid Brownell 	 * understand such things.
187f8aeb3bbSDavid Brownell 	 *
188f8aeb3bbSDavid Brownell 	 * System suspend currently expects to be able to suspend the entire
189f8aeb3bbSDavid Brownell 	 * device tree, device-at-a-time.  If we failed selective suspend
190f8aeb3bbSDavid Brownell 	 * reports, system suspend would fail; so the root hub code must claim
191f8aeb3bbSDavid Brownell 	 * success.  That's lying to usbcore, and it matters for for runtime
192f8aeb3bbSDavid Brownell 	 * PM scenarios with selective suspend and remote wakeup...
193f8aeb3bbSDavid Brownell 	 */
194f8aeb3bbSDavid Brownell 	if (ehci->no_selective_suspend && device_can_wakeup(&pdev->dev))
195f8aeb3bbSDavid Brownell 		ehci_warn(ehci, "selective suspend/wakeup unavailable\n");
196f8aeb3bbSDavid Brownell #endif
197f8aeb3bbSDavid Brownell 
19818807521SDavid Brownell 	retval = ehci_pci_reinit(ehci, pdev);
1998926bfa7SDavid Brownell done:
2008926bfa7SDavid Brownell 	return retval;
2017ff71d6aSMatt Porter }
2027ff71d6aSMatt Porter 
2037ff71d6aSMatt Porter /*-------------------------------------------------------------------------*/
2047ff71d6aSMatt Porter 
2057ff71d6aSMatt Porter #ifdef	CONFIG_PM
2067ff71d6aSMatt Porter 
2077ff71d6aSMatt Porter /* suspend/resume, section 4.3 */
2087ff71d6aSMatt Porter 
209f03c17fcSDavid Brownell /* These routines rely on the PCI bus glue
2107ff71d6aSMatt Porter  * to handle powerdown and wakeup, and currently also on
2117ff71d6aSMatt Porter  * transceivers that don't need any software attention to set up
2127ff71d6aSMatt Porter  * the right sort of wakeup.
213f03c17fcSDavid Brownell  * Also they depend on separate root hub suspend/resume.
2147ff71d6aSMatt Porter  */
2157ff71d6aSMatt Porter 
2167ff71d6aSMatt Porter static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
2177ff71d6aSMatt Porter {
2187ff71d6aSMatt Porter 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
2198de98402SBenjamin Herrenschmidt 	unsigned long		flags;
2208de98402SBenjamin Herrenschmidt 	int			rc = 0;
2217ff71d6aSMatt Porter 
2227ff71d6aSMatt Porter 	if (time_before(jiffies, ehci->next_statechange))
223f03c17fcSDavid Brownell 		msleep(10);
2247ff71d6aSMatt Porter 
2258de98402SBenjamin Herrenschmidt 	/* Root hub was already suspended. Disable irq emission and
2268de98402SBenjamin Herrenschmidt 	 * mark HW unaccessible, bail out if RH has been resumed. Use
2278de98402SBenjamin Herrenschmidt 	 * the spinlock to properly synchronize with possible pending
2288de98402SBenjamin Herrenschmidt 	 * RH suspend or resume activity.
2298de98402SBenjamin Herrenschmidt 	 *
2308de98402SBenjamin Herrenschmidt 	 * This is still racy as hcd->state is manipulated outside of
2318de98402SBenjamin Herrenschmidt 	 * any locks =P But that will be a different fix.
2328de98402SBenjamin Herrenschmidt 	 */
2338de98402SBenjamin Herrenschmidt 	spin_lock_irqsave (&ehci->lock, flags);
2348de98402SBenjamin Herrenschmidt 	if (hcd->state != HC_STATE_SUSPENDED) {
2358de98402SBenjamin Herrenschmidt 		rc = -EINVAL;
2368de98402SBenjamin Herrenschmidt 		goto bail;
2378de98402SBenjamin Herrenschmidt 	}
2388de98402SBenjamin Herrenschmidt 	writel (0, &ehci->regs->intr_enable);
2398de98402SBenjamin Herrenschmidt 	(void)readl(&ehci->regs->intr_enable);
2408de98402SBenjamin Herrenschmidt 
24118584999SDavid Brownell 	/* make sure snapshot being resumed re-enumerates everything */
24218584999SDavid Brownell 	if (message.event == PM_EVENT_PRETHAW) {
24318584999SDavid Brownell 		ehci_halt(ehci);
24418584999SDavid Brownell 		ehci_reset(ehci);
24518584999SDavid Brownell 	}
24618584999SDavid Brownell 
2478de98402SBenjamin Herrenschmidt 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
2488de98402SBenjamin Herrenschmidt  bail:
2498de98402SBenjamin Herrenschmidt 	spin_unlock_irqrestore (&ehci->lock, flags);
2508de98402SBenjamin Herrenschmidt 
251f03c17fcSDavid Brownell 	// could save FLADJ in case of Vaux power loss
2527ff71d6aSMatt Porter 	// ... we'd only use it to handle clock skew
2537ff71d6aSMatt Porter 
2548de98402SBenjamin Herrenschmidt 	return rc;
2557ff71d6aSMatt Porter }
2567ff71d6aSMatt Porter 
2577ff71d6aSMatt Porter static int ehci_pci_resume(struct usb_hcd *hcd)
2587ff71d6aSMatt Porter {
2597ff71d6aSMatt Porter 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
2607ff71d6aSMatt Porter 	unsigned		port;
26118807521SDavid Brownell 	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
2627ff71d6aSMatt Porter 	int			retval = -EINVAL;
2637ff71d6aSMatt Porter 
264f03c17fcSDavid Brownell 	// maybe restore FLADJ
2657ff71d6aSMatt Porter 
2667ff71d6aSMatt Porter 	if (time_before(jiffies, ehci->next_statechange))
2677ff71d6aSMatt Porter 		msleep(100);
2687ff71d6aSMatt Porter 
2698de98402SBenjamin Herrenschmidt 	/* Mark hardware accessible again as we are out of D3 state by now */
2708de98402SBenjamin Herrenschmidt 	set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
2718de98402SBenjamin Herrenschmidt 
272f03c17fcSDavid Brownell 	/* If CF is clear, we lost PCI Vaux power and need to restart.  */
27318807521SDavid Brownell 	if (readl(&ehci->regs->configured_flag) != FLAG_CF)
274f03c17fcSDavid Brownell 		goto restart;
275f03c17fcSDavid Brownell 
2767ff71d6aSMatt Porter 	/* If any port is suspended (or owned by the companion),
2777ff71d6aSMatt Porter 	 * we know we can/must resume the HC (and mustn't reset it).
278f03c17fcSDavid Brownell 	 * We just defer that to the root hub code.
2797ff71d6aSMatt Porter 	 */
2807ff71d6aSMatt Porter 	for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {
2817ff71d6aSMatt Porter 		u32	status;
2827ff71d6aSMatt Porter 		port--;
2837ff71d6aSMatt Porter 		status = readl(&ehci->regs->port_status [port]);
2847ff71d6aSMatt Porter 		if (!(status & PORT_POWER))
2857ff71d6aSMatt Porter 			continue;
286f03c17fcSDavid Brownell 		if (status & (PORT_SUSPEND | PORT_RESUME | PORT_OWNER)) {
287f03c17fcSDavid Brownell 			usb_hcd_resume_root_hub(hcd);
288f03c17fcSDavid Brownell 			return 0;
2897ff71d6aSMatt Porter 		}
290f03c17fcSDavid Brownell 	}
291f03c17fcSDavid Brownell 
292f03c17fcSDavid Brownell restart:
293f03c17fcSDavid Brownell 	ehci_dbg(ehci, "lost power, restarting\n");
2941c50c317SAlan Stern 	usb_root_hub_lost_power(hcd->self.root_hub);
2957ff71d6aSMatt Porter 
2967ff71d6aSMatt Porter 	/* Else reset, to cope with power loss or flush-to-storage
297f03c17fcSDavid Brownell 	 * style "resume" having let BIOS kick in during reboot.
2987ff71d6aSMatt Porter 	 */
2997ff71d6aSMatt Porter 	(void) ehci_halt(ehci);
3007ff71d6aSMatt Porter 	(void) ehci_reset(ehci);
30118807521SDavid Brownell 	(void) ehci_pci_reinit(ehci, pdev);
3027ff71d6aSMatt Porter 
3037ff71d6aSMatt Porter 	/* emptying the schedule aborts any urbs */
3047ff71d6aSMatt Porter 	spin_lock_irq(&ehci->lock);
3057ff71d6aSMatt Porter 	if (ehci->reclaim)
3067ff71d6aSMatt Porter 		ehci->reclaim_ready = 1;
3077ff71d6aSMatt Porter 	ehci_work(ehci, NULL);
3087ff71d6aSMatt Porter 	spin_unlock_irq(&ehci->lock);
3097ff71d6aSMatt Porter 
3107ff71d6aSMatt Porter 	/* restart; khubd will disconnect devices */
3117ff71d6aSMatt Porter 	retval = ehci_run(hcd);
3127ff71d6aSMatt Porter 
31318807521SDavid Brownell 	/* here we "know" root ports should always stay powered */
3147ff71d6aSMatt Porter 	ehci_port_power(ehci, 1);
3157ff71d6aSMatt Porter 
3167ff71d6aSMatt Porter 	return retval;
3177ff71d6aSMatt Porter }
3187ff71d6aSMatt Porter #endif
3197ff71d6aSMatt Porter 
3207ff71d6aSMatt Porter static const struct hc_driver ehci_pci_hc_driver = {
3217ff71d6aSMatt Porter 	.description =		hcd_name,
3227ff71d6aSMatt Porter 	.product_desc =		"EHCI Host Controller",
3237ff71d6aSMatt Porter 	.hcd_priv_size =	sizeof(struct ehci_hcd),
3247ff71d6aSMatt Porter 
3257ff71d6aSMatt Porter 	/*
3267ff71d6aSMatt Porter 	 * generic hardware linkage
3277ff71d6aSMatt Porter 	 */
3287ff71d6aSMatt Porter 	.irq =			ehci_irq,
3297ff71d6aSMatt Porter 	.flags =		HCD_MEMORY | HCD_USB2,
3307ff71d6aSMatt Porter 
3317ff71d6aSMatt Porter 	/*
3327ff71d6aSMatt Porter 	 * basic lifecycle operations
3337ff71d6aSMatt Porter 	 */
3348926bfa7SDavid Brownell 	.reset =		ehci_pci_setup,
33518807521SDavid Brownell 	.start =		ehci_run,
3367ff71d6aSMatt Porter #ifdef	CONFIG_PM
3377ff71d6aSMatt Porter 	.suspend =		ehci_pci_suspend,
3387ff71d6aSMatt Porter 	.resume =		ehci_pci_resume,
3397ff71d6aSMatt Porter #endif
34018807521SDavid Brownell 	.stop =			ehci_stop,
341*64a21d02SAleksey Gorelov 	.shutdown =		ehci_shutdown,
3427ff71d6aSMatt Porter 
3437ff71d6aSMatt Porter 	/*
3447ff71d6aSMatt Porter 	 * managing i/o requests and associated device resources
3457ff71d6aSMatt Porter 	 */
3467ff71d6aSMatt Porter 	.urb_enqueue =		ehci_urb_enqueue,
3477ff71d6aSMatt Porter 	.urb_dequeue =		ehci_urb_dequeue,
3487ff71d6aSMatt Porter 	.endpoint_disable =	ehci_endpoint_disable,
3497ff71d6aSMatt Porter 
3507ff71d6aSMatt Porter 	/*
3517ff71d6aSMatt Porter 	 * scheduling support
3527ff71d6aSMatt Porter 	 */
3537ff71d6aSMatt Porter 	.get_frame_number =	ehci_get_frame,
3547ff71d6aSMatt Porter 
3557ff71d6aSMatt Porter 	/*
3567ff71d6aSMatt Porter 	 * root hub support
3577ff71d6aSMatt Porter 	 */
3587ff71d6aSMatt Porter 	.hub_status_data =	ehci_hub_status_data,
3597ff71d6aSMatt Porter 	.hub_control =		ehci_hub_control,
3600c0382e3SAlan Stern 	.bus_suspend =		ehci_bus_suspend,
3610c0382e3SAlan Stern 	.bus_resume =		ehci_bus_resume,
3627ff71d6aSMatt Porter };
3637ff71d6aSMatt Porter 
3647ff71d6aSMatt Porter /*-------------------------------------------------------------------------*/
3657ff71d6aSMatt Porter 
3667ff71d6aSMatt Porter /* PCI driver selection metadata; PCI hotplugging uses this */
3677ff71d6aSMatt Porter static const struct pci_device_id pci_ids [] = { {
3687ff71d6aSMatt Porter 	/* handle any USB 2.0 EHCI controller */
369c67808eeSJean Delvare 	PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_EHCI, ~0),
3707ff71d6aSMatt Porter 	.driver_data =	(unsigned long) &ehci_pci_hc_driver,
3717ff71d6aSMatt Porter 	},
3727ff71d6aSMatt Porter 	{ /* end: all zeroes */ }
3737ff71d6aSMatt Porter };
3747ff71d6aSMatt Porter MODULE_DEVICE_TABLE(pci, pci_ids);
3757ff71d6aSMatt Porter 
3767ff71d6aSMatt Porter /* pci driver glue; this is a "new style" PCI driver module */
3777ff71d6aSMatt Porter static struct pci_driver ehci_pci_driver = {
3787ff71d6aSMatt Porter 	.name =		(char *) hcd_name,
3797ff71d6aSMatt Porter 	.id_table =	pci_ids,
3807ff71d6aSMatt Porter 
3817ff71d6aSMatt Porter 	.probe =	usb_hcd_pci_probe,
3827ff71d6aSMatt Porter 	.remove =	usb_hcd_pci_remove,
3837ff71d6aSMatt Porter 
3847ff71d6aSMatt Porter #ifdef	CONFIG_PM
3857ff71d6aSMatt Porter 	.suspend =	usb_hcd_pci_suspend,
3867ff71d6aSMatt Porter 	.resume =	usb_hcd_pci_resume,
3877ff71d6aSMatt Porter #endif
388*64a21d02SAleksey Gorelov 	.shutdown = 	usb_hcd_pci_shutdown,
3897ff71d6aSMatt Porter };
390