xref: /linux/drivers/usb/host/ehci-pci.c (revision 07d29b63ef6b39963ab37818653284d861cf55af)
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;
41083522d7SBenjamin Herrenschmidt 			temp = ehci_readl(ehci, &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 	return 0;
6218807521SDavid Brownell }
6318807521SDavid Brownell 
648926bfa7SDavid Brownell /* called during probe() after chip reset completes */
658926bfa7SDavid Brownell static int ehci_pci_setup(struct usb_hcd *hcd)
667ff71d6aSMatt Porter {
677ff71d6aSMatt Porter 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
68abcc9448SDavid Brownell 	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
697ff71d6aSMatt Porter 	u32			temp;
7018807521SDavid Brownell 	int			retval;
717ff71d6aSMatt Porter 
72083522d7SBenjamin Herrenschmidt 	switch (pdev->vendor) {
73083522d7SBenjamin Herrenschmidt 	case PCI_VENDOR_ID_TOSHIBA_2:
74083522d7SBenjamin Herrenschmidt 		/* celleb's companion chip */
75083522d7SBenjamin Herrenschmidt 		if (pdev->device == 0x01b5) {
76083522d7SBenjamin Herrenschmidt #ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
77083522d7SBenjamin Herrenschmidt 			ehci->big_endian_mmio = 1;
78083522d7SBenjamin Herrenschmidt #else
79083522d7SBenjamin Herrenschmidt 			ehci_warn(ehci,
80083522d7SBenjamin Herrenschmidt 				  "unsupported big endian Toshiba quirk\n");
81083522d7SBenjamin Herrenschmidt #endif
82083522d7SBenjamin Herrenschmidt 		}
83083522d7SBenjamin Herrenschmidt 		break;
84083522d7SBenjamin Herrenschmidt 	}
85083522d7SBenjamin Herrenschmidt 
867ff71d6aSMatt Porter 	ehci->caps = hcd->regs;
87083522d7SBenjamin Herrenschmidt 	ehci->regs = hcd->regs +
88083522d7SBenjamin Herrenschmidt 		HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
89083522d7SBenjamin Herrenschmidt 
907ff71d6aSMatt Porter 	dbg_hcs_params(ehci, "reset");
917ff71d6aSMatt Porter 	dbg_hcc_params(ehci, "reset");
927ff71d6aSMatt Porter 
93c32ba30fSPaul Serice         /* ehci_init() causes memory for DMA transfers to be
94c32ba30fSPaul Serice          * allocated.  Thus, any vendor-specific workarounds based on
95c32ba30fSPaul Serice          * limiting the type of memory used for DMA transfers must
96c32ba30fSPaul Serice          * happen before ehci_init() is called. */
97c32ba30fSPaul Serice 	switch (pdev->vendor) {
98c32ba30fSPaul Serice 	case PCI_VENDOR_ID_NVIDIA:
99c32ba30fSPaul Serice 		/* NVidia reports that certain chips don't handle
100c32ba30fSPaul Serice 		 * QH, ITD, or SITD addresses above 2GB.  (But TD,
101c32ba30fSPaul Serice 		 * data buffer, and periodic schedule are normal.)
102c32ba30fSPaul Serice 		 */
103c32ba30fSPaul Serice 		switch (pdev->device) {
104c32ba30fSPaul Serice 		case 0x003c:	/* MCP04 */
105c32ba30fSPaul Serice 		case 0x005b:	/* CK804 */
106c32ba30fSPaul Serice 		case 0x00d8:	/* CK8 */
107c32ba30fSPaul Serice 		case 0x00e8:	/* CK8S */
108c32ba30fSPaul Serice 			if (pci_set_consistent_dma_mask(pdev,
109c32ba30fSPaul Serice 						DMA_31BIT_MASK) < 0)
110c32ba30fSPaul Serice 				ehci_warn(ehci, "can't enable NVidia "
111c32ba30fSPaul Serice 					"workaround for >2GB RAM\n");
112c32ba30fSPaul Serice 			break;
113c32ba30fSPaul Serice 		}
114c32ba30fSPaul Serice 		break;
115c32ba30fSPaul Serice 	}
116c32ba30fSPaul Serice 
1177ff71d6aSMatt Porter 	/* cache this readonly data; minimize chip reads */
118083522d7SBenjamin Herrenschmidt 	ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
1197ff71d6aSMatt Porter 
12018807521SDavid Brownell 	retval = ehci_halt(ehci);
12118807521SDavid Brownell 	if (retval)
12218807521SDavid Brownell 		return retval;
12318807521SDavid Brownell 
1248926bfa7SDavid Brownell 	/* data structure init */
1258926bfa7SDavid Brownell 	retval = ehci_init(hcd);
1268926bfa7SDavid Brownell 	if (retval)
1278926bfa7SDavid Brownell 		return retval;
1288926bfa7SDavid Brownell 
1297ff71d6aSMatt Porter 	switch (pdev->vendor) {
1307ff71d6aSMatt Porter 	case PCI_VENDOR_ID_TDI:
1317ff71d6aSMatt Porter 		if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
1327ff71d6aSMatt Porter 			ehci->is_tdi_rh_tt = 1;
1337ff71d6aSMatt Porter 			tdi_reset(ehci);
1347ff71d6aSMatt Porter 		}
1357ff71d6aSMatt Porter 		break;
1367ff71d6aSMatt Porter 	case PCI_VENDOR_ID_AMD:
1377ff71d6aSMatt Porter 		/* AMD8111 EHCI doesn't work, according to AMD errata */
1387ff71d6aSMatt Porter 		if (pdev->device == 0x7463) {
1397ff71d6aSMatt Porter 			ehci_info(ehci, "ignoring AMD8111 (errata)\n");
1408926bfa7SDavid Brownell 			retval = -EIO;
1418926bfa7SDavid Brownell 			goto done;
1427ff71d6aSMatt Porter 		}
1437ff71d6aSMatt Porter 		break;
1447ff71d6aSMatt Porter 	case PCI_VENDOR_ID_NVIDIA:
145f8aeb3bbSDavid Brownell 		switch (pdev->device) {
146f8aeb3bbSDavid Brownell 		/* Some NForce2 chips have problems with selective suspend;
147f8aeb3bbSDavid Brownell 		 * fixed in newer silicon.
148f8aeb3bbSDavid Brownell 		 */
149f8aeb3bbSDavid Brownell 		case 0x0068:
15044c10138SAuke Kok 			if (pdev->revision < 0xa4)
151f8aeb3bbSDavid Brownell 				ehci->no_selective_suspend = 1;
152f8aeb3bbSDavid Brownell 			break;
1537ff71d6aSMatt Porter 		}
1547ff71d6aSMatt Porter 		break;
1557ff71d6aSMatt Porter 	}
1567ff71d6aSMatt Porter 
1577ff71d6aSMatt Porter 	ehci_reset(ehci);
1587ff71d6aSMatt Porter 
1597ff71d6aSMatt Porter 	/* at least the Genesys GL880S needs fixup here */
1607ff71d6aSMatt Porter 	temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);
1617ff71d6aSMatt Porter 	temp &= 0x0f;
1627ff71d6aSMatt Porter 	if (temp && HCS_N_PORTS(ehci->hcs_params) > temp) {
1637ff71d6aSMatt Porter 		ehci_dbg(ehci, "bogus port configuration: "
1647ff71d6aSMatt Porter 			"cc=%d x pcc=%d < ports=%d\n",
1657ff71d6aSMatt Porter 			HCS_N_CC(ehci->hcs_params),
1667ff71d6aSMatt Porter 			HCS_N_PCC(ehci->hcs_params),
1677ff71d6aSMatt Porter 			HCS_N_PORTS(ehci->hcs_params));
1687ff71d6aSMatt Porter 
1697ff71d6aSMatt Porter 		switch (pdev->vendor) {
1707ff71d6aSMatt Porter 		case 0x17a0:		/* GENESYS */
1717ff71d6aSMatt Porter 			/* GL880S: should be PORTS=2 */
1727ff71d6aSMatt Porter 			temp |= (ehci->hcs_params & ~0xf);
1737ff71d6aSMatt Porter 			ehci->hcs_params = temp;
1747ff71d6aSMatt Porter 			break;
1757ff71d6aSMatt Porter 		case PCI_VENDOR_ID_NVIDIA:
1767ff71d6aSMatt Porter 			/* NF4: should be PCC=10 */
1777ff71d6aSMatt Porter 			break;
1787ff71d6aSMatt Porter 		}
1797ff71d6aSMatt Porter 	}
1807ff71d6aSMatt Porter 
1817ff71d6aSMatt Porter 	/* Serial Bus Release Number is at PCI 0x60 offset */
1827ff71d6aSMatt Porter 	pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
1837ff71d6aSMatt Porter 
1842c1c3c4cSDavid Brownell 	/* Workaround current PCI init glitch:  wakeup bits aren't
1852c1c3c4cSDavid Brownell 	 * being set from PCI PM capability.
1862c1c3c4cSDavid Brownell 	 */
1872c1c3c4cSDavid Brownell 	if (!device_can_wakeup(&pdev->dev)) {
1882c1c3c4cSDavid Brownell 		u16	port_wake;
1892c1c3c4cSDavid Brownell 
1902c1c3c4cSDavid Brownell 		pci_read_config_word(pdev, 0x62, &port_wake);
1912c1c3c4cSDavid Brownell 		if (port_wake & 0x0001)
1922c1c3c4cSDavid Brownell 			device_init_wakeup(&pdev->dev, 1);
1932c1c3c4cSDavid Brownell 	}
1947ff71d6aSMatt Porter 
195f8aeb3bbSDavid Brownell #ifdef	CONFIG_USB_SUSPEND
196f8aeb3bbSDavid Brownell 	/* REVISIT: the controller works fine for wakeup iff the root hub
197f8aeb3bbSDavid Brownell 	 * itself is "globally" suspended, but usbcore currently doesn't
198f8aeb3bbSDavid Brownell 	 * understand such things.
199f8aeb3bbSDavid Brownell 	 *
200f8aeb3bbSDavid Brownell 	 * System suspend currently expects to be able to suspend the entire
201f8aeb3bbSDavid Brownell 	 * device tree, device-at-a-time.  If we failed selective suspend
202f8aeb3bbSDavid Brownell 	 * reports, system suspend would fail; so the root hub code must claim
203f8aeb3bbSDavid Brownell 	 * success.  That's lying to usbcore, and it matters for for runtime
204f8aeb3bbSDavid Brownell 	 * PM scenarios with selective suspend and remote wakeup...
205f8aeb3bbSDavid Brownell 	 */
206f8aeb3bbSDavid Brownell 	if (ehci->no_selective_suspend && device_can_wakeup(&pdev->dev))
207f8aeb3bbSDavid Brownell 		ehci_warn(ehci, "selective suspend/wakeup unavailable\n");
208f8aeb3bbSDavid Brownell #endif
209f8aeb3bbSDavid Brownell 
21018807521SDavid Brownell 	retval = ehci_pci_reinit(ehci, pdev);
2118926bfa7SDavid Brownell done:
2128926bfa7SDavid Brownell 	return retval;
2137ff71d6aSMatt Porter }
2147ff71d6aSMatt Porter 
2157ff71d6aSMatt Porter /*-------------------------------------------------------------------------*/
2167ff71d6aSMatt Porter 
2177ff71d6aSMatt Porter #ifdef	CONFIG_PM
2187ff71d6aSMatt Porter 
2197ff71d6aSMatt Porter /* suspend/resume, section 4.3 */
2207ff71d6aSMatt Porter 
221f03c17fcSDavid Brownell /* These routines rely on the PCI bus glue
2227ff71d6aSMatt Porter  * to handle powerdown and wakeup, and currently also on
2237ff71d6aSMatt Porter  * transceivers that don't need any software attention to set up
2247ff71d6aSMatt Porter  * the right sort of wakeup.
225f03c17fcSDavid Brownell  * Also they depend on separate root hub suspend/resume.
2267ff71d6aSMatt Porter  */
2277ff71d6aSMatt Porter 
2287ff71d6aSMatt Porter static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
2297ff71d6aSMatt Porter {
2307ff71d6aSMatt Porter 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
2318de98402SBenjamin Herrenschmidt 	unsigned long		flags;
2328de98402SBenjamin Herrenschmidt 	int			rc = 0;
2337ff71d6aSMatt Porter 
2347ff71d6aSMatt Porter 	if (time_before(jiffies, ehci->next_statechange))
235f03c17fcSDavid Brownell 		msleep(10);
2367ff71d6aSMatt Porter 
2378de98402SBenjamin Herrenschmidt 	/* Root hub was already suspended. Disable irq emission and
2388de98402SBenjamin Herrenschmidt 	 * mark HW unaccessible, bail out if RH has been resumed. Use
2398de98402SBenjamin Herrenschmidt 	 * the spinlock to properly synchronize with possible pending
2408de98402SBenjamin Herrenschmidt 	 * RH suspend or resume activity.
2418de98402SBenjamin Herrenschmidt 	 *
2428de98402SBenjamin Herrenschmidt 	 * This is still racy as hcd->state is manipulated outside of
2438de98402SBenjamin Herrenschmidt 	 * any locks =P But that will be a different fix.
2448de98402SBenjamin Herrenschmidt 	 */
2458de98402SBenjamin Herrenschmidt 	spin_lock_irqsave (&ehci->lock, flags);
2468de98402SBenjamin Herrenschmidt 	if (hcd->state != HC_STATE_SUSPENDED) {
2478de98402SBenjamin Herrenschmidt 		rc = -EINVAL;
2488de98402SBenjamin Herrenschmidt 		goto bail;
2498de98402SBenjamin Herrenschmidt 	}
250083522d7SBenjamin Herrenschmidt 	ehci_writel(ehci, 0, &ehci->regs->intr_enable);
251083522d7SBenjamin Herrenschmidt 	(void)ehci_readl(ehci, &ehci->regs->intr_enable);
2528de98402SBenjamin Herrenschmidt 
25318584999SDavid Brownell 	/* make sure snapshot being resumed re-enumerates everything */
25418584999SDavid Brownell 	if (message.event == PM_EVENT_PRETHAW) {
25518584999SDavid Brownell 		ehci_halt(ehci);
25618584999SDavid Brownell 		ehci_reset(ehci);
25718584999SDavid Brownell 	}
25818584999SDavid Brownell 
2598de98402SBenjamin Herrenschmidt 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
2608de98402SBenjamin Herrenschmidt  bail:
2618de98402SBenjamin Herrenschmidt 	spin_unlock_irqrestore (&ehci->lock, flags);
2628de98402SBenjamin Herrenschmidt 
263f03c17fcSDavid Brownell 	// could save FLADJ in case of Vaux power loss
2647ff71d6aSMatt Porter 	// ... we'd only use it to handle clock skew
2657ff71d6aSMatt Porter 
2668de98402SBenjamin Herrenschmidt 	return rc;
2677ff71d6aSMatt Porter }
2687ff71d6aSMatt Porter 
2697ff71d6aSMatt Porter static int ehci_pci_resume(struct usb_hcd *hcd)
2707ff71d6aSMatt Porter {
2717ff71d6aSMatt Porter 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
27218807521SDavid Brownell 	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
2737ff71d6aSMatt Porter 
274f03c17fcSDavid Brownell 	// maybe restore FLADJ
2757ff71d6aSMatt Porter 
2767ff71d6aSMatt Porter 	if (time_before(jiffies, ehci->next_statechange))
2777ff71d6aSMatt Porter 		msleep(100);
2787ff71d6aSMatt Porter 
2798de98402SBenjamin Herrenschmidt 	/* Mark hardware accessible again as we are out of D3 state by now */
2808de98402SBenjamin Herrenschmidt 	set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
2818de98402SBenjamin Herrenschmidt 
2828c03356aSAlan Stern 	/* If CF is still set, we maintained PCI Vaux power.
2838c03356aSAlan Stern 	 * Just undo the effect of ehci_pci_suspend().
2847ff71d6aSMatt Porter 	 */
285083522d7SBenjamin Herrenschmidt 	if (ehci_readl(ehci, &ehci->regs->configured_flag) == FLAG_CF) {
2868c03356aSAlan Stern 		int	mask = INTR_MASK;
2878c03356aSAlan Stern 
2888c03356aSAlan Stern 		if (!device_may_wakeup(&hcd->self.root_hub->dev))
2898c03356aSAlan Stern 			mask &= ~STS_PCD;
290083522d7SBenjamin Herrenschmidt 		ehci_writel(ehci, mask, &ehci->regs->intr_enable);
291083522d7SBenjamin Herrenschmidt 		ehci_readl(ehci, &ehci->regs->intr_enable);
292f03c17fcSDavid Brownell 		return 0;
2937ff71d6aSMatt Porter 	}
294f03c17fcSDavid Brownell 
295f03c17fcSDavid Brownell 	ehci_dbg(ehci, "lost power, restarting\n");
2961c50c317SAlan Stern 	usb_root_hub_lost_power(hcd->self.root_hub);
2977ff71d6aSMatt Porter 
2987ff71d6aSMatt Porter 	/* Else reset, to cope with power loss or flush-to-storage
299f03c17fcSDavid Brownell 	 * style "resume" having let BIOS kick in during reboot.
3007ff71d6aSMatt Porter 	 */
3017ff71d6aSMatt Porter 	(void) ehci_halt(ehci);
3027ff71d6aSMatt Porter 	(void) ehci_reset(ehci);
30318807521SDavid Brownell 	(void) ehci_pci_reinit(ehci, pdev);
3047ff71d6aSMatt Porter 
3057ff71d6aSMatt Porter 	/* emptying the schedule aborts any urbs */
3067ff71d6aSMatt Porter 	spin_lock_irq(&ehci->lock);
3077ff71d6aSMatt Porter 	if (ehci->reclaim)
308*07d29b63SAlan Stern 		end_unlink_async(ehci);
3097d12e780SDavid Howells 	ehci_work(ehci);
3107ff71d6aSMatt Porter 	spin_unlock_irq(&ehci->lock);
3117ff71d6aSMatt Porter 
312083522d7SBenjamin Herrenschmidt 	ehci_writel(ehci, ehci->command, &ehci->regs->command);
313083522d7SBenjamin Herrenschmidt 	ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
314083522d7SBenjamin Herrenschmidt 	ehci_readl(ehci, &ehci->regs->command);	/* unblock posted writes */
3158c03356aSAlan Stern 
316383975d7SAlan Stern 	/* here we "know" root ports should always stay powered */
317383975d7SAlan Stern 	ehci_port_power(ehci, 1);
318383975d7SAlan Stern 	ehci_handover_companion_ports(ehci);
319383975d7SAlan Stern 
3208c03356aSAlan Stern 	hcd->state = HC_STATE_SUSPENDED;
3218c03356aSAlan Stern 	return 0;
3227ff71d6aSMatt Porter }
3237ff71d6aSMatt Porter #endif
3247ff71d6aSMatt Porter 
3257ff71d6aSMatt Porter static const struct hc_driver ehci_pci_hc_driver = {
3267ff71d6aSMatt Porter 	.description =		hcd_name,
3277ff71d6aSMatt Porter 	.product_desc =		"EHCI Host Controller",
3287ff71d6aSMatt Porter 	.hcd_priv_size =	sizeof(struct ehci_hcd),
3297ff71d6aSMatt Porter 
3307ff71d6aSMatt Porter 	/*
3317ff71d6aSMatt Porter 	 * generic hardware linkage
3327ff71d6aSMatt Porter 	 */
3337ff71d6aSMatt Porter 	.irq =			ehci_irq,
3347ff71d6aSMatt Porter 	.flags =		HCD_MEMORY | HCD_USB2,
3357ff71d6aSMatt Porter 
3367ff71d6aSMatt Porter 	/*
3377ff71d6aSMatt Porter 	 * basic lifecycle operations
3387ff71d6aSMatt Porter 	 */
3398926bfa7SDavid Brownell 	.reset =		ehci_pci_setup,
34018807521SDavid Brownell 	.start =		ehci_run,
3417ff71d6aSMatt Porter #ifdef	CONFIG_PM
3427ff71d6aSMatt Porter 	.suspend =		ehci_pci_suspend,
3437ff71d6aSMatt Porter 	.resume =		ehci_pci_resume,
3447ff71d6aSMatt Porter #endif
34518807521SDavid Brownell 	.stop =			ehci_stop,
34664a21d02SAleksey Gorelov 	.shutdown =		ehci_shutdown,
3477ff71d6aSMatt Porter 
3487ff71d6aSMatt Porter 	/*
3497ff71d6aSMatt Porter 	 * managing i/o requests and associated device resources
3507ff71d6aSMatt Porter 	 */
3517ff71d6aSMatt Porter 	.urb_enqueue =		ehci_urb_enqueue,
3527ff71d6aSMatt Porter 	.urb_dequeue =		ehci_urb_dequeue,
3537ff71d6aSMatt Porter 	.endpoint_disable =	ehci_endpoint_disable,
3547ff71d6aSMatt Porter 
3557ff71d6aSMatt Porter 	/*
3567ff71d6aSMatt Porter 	 * scheduling support
3577ff71d6aSMatt Porter 	 */
3587ff71d6aSMatt Porter 	.get_frame_number =	ehci_get_frame,
3597ff71d6aSMatt Porter 
3607ff71d6aSMatt Porter 	/*
3617ff71d6aSMatt Porter 	 * root hub support
3627ff71d6aSMatt Porter 	 */
3637ff71d6aSMatt Porter 	.hub_status_data =	ehci_hub_status_data,
3647ff71d6aSMatt Porter 	.hub_control =		ehci_hub_control,
3650c0382e3SAlan Stern 	.bus_suspend =		ehci_bus_suspend,
3660c0382e3SAlan Stern 	.bus_resume =		ehci_bus_resume,
36790da096eSBalaji Rao 	.relinquish_port = 	ehci_relinquish_port,
3687ff71d6aSMatt Porter };
3697ff71d6aSMatt Porter 
3707ff71d6aSMatt Porter /*-------------------------------------------------------------------------*/
3717ff71d6aSMatt Porter 
3727ff71d6aSMatt Porter /* PCI driver selection metadata; PCI hotplugging uses this */
3737ff71d6aSMatt Porter static const struct pci_device_id pci_ids [] = { {
3747ff71d6aSMatt Porter 	/* handle any USB 2.0 EHCI controller */
375c67808eeSJean Delvare 	PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_EHCI, ~0),
3767ff71d6aSMatt Porter 	.driver_data =	(unsigned long) &ehci_pci_hc_driver,
3777ff71d6aSMatt Porter 	},
3787ff71d6aSMatt Porter 	{ /* end: all zeroes */ }
3797ff71d6aSMatt Porter };
3807ff71d6aSMatt Porter MODULE_DEVICE_TABLE(pci, pci_ids);
3817ff71d6aSMatt Porter 
3827ff71d6aSMatt Porter /* pci driver glue; this is a "new style" PCI driver module */
3837ff71d6aSMatt Porter static struct pci_driver ehci_pci_driver = {
3847ff71d6aSMatt Porter 	.name =		(char *) hcd_name,
3857ff71d6aSMatt Porter 	.id_table =	pci_ids,
3867ff71d6aSMatt Porter 
3877ff71d6aSMatt Porter 	.probe =	usb_hcd_pci_probe,
3887ff71d6aSMatt Porter 	.remove =	usb_hcd_pci_remove,
3897ff71d6aSMatt Porter 
3907ff71d6aSMatt Porter #ifdef	CONFIG_PM
3917ff71d6aSMatt Porter 	.suspend =	usb_hcd_pci_suspend,
3927ff71d6aSMatt Porter 	.resume =	usb_hcd_pci_resume,
3937ff71d6aSMatt Porter #endif
39464a21d02SAleksey Gorelov 	.shutdown = 	usb_hcd_pci_shutdown,
3957ff71d6aSMatt Porter };
396