blob: 36ee9a666e937af93cb27af0321b5b409cf49929 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * OHCI HCD (Host Controller Driver) for USB.
3 *
4 * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
5 * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
David Brownelldd9048a2006-12-05 03:18:31 -08006 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * [ Initialisation is based on Linus' ]
8 * [ uhci code and gregs ohci fragments ]
9 * [ (C) Copyright 1999 Linus Torvalds ]
10 * [ (C) Copyright 1999 Gregory P. Smith]
David Brownelldd9048a2006-12-05 03:18:31 -080011 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 * PCI Bus Glue
13 *
14 * This file is licenced under the GPL.
15 */
David Brownelldd9048a2006-12-05 03:18:31 -080016
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#ifndef CONFIG_PCI
18#error "This file is PCI bus glue. CONFIG_PCI must be defined."
19#endif
20
Libin Yangab1666c2008-08-08 15:03:31 +080021#include <linux/pci.h>
22#include <linux/io.h>
23
24
25/* constants used to work around PM-related transfer
26 * glitches in some AMD 700 series southbridges
27 */
28#define AB_REG_BAR 0xf0
29#define AB_INDX(addr) ((addr) + 0x00)
30#define AB_DATA(addr) ((addr) + 0x04)
31#define AX_INDXC 0X30
32#define AX_DATAC 0x34
33
34#define NB_PCIE_INDX_ADDR 0xe0
35#define NB_PCIE_INDX_DATA 0xe4
36#define PCIE_P_CNTL 0x10040
37#define BIF_NB 0x10002
38
39static struct pci_dev *amd_smbus_dev;
40static struct pci_dev *amd_hb_dev;
41static int amd_ohci_iso_count;
42
Linus Torvalds1da177e2005-04-16 15:20:36 -070043/*-------------------------------------------------------------------------*/
44
David Brownell931384f2007-04-17 13:06:29 -070045static int broken_suspend(struct usb_hcd *hcd)
46{
47 device_init_wakeup(&hcd->self.root_hub->dev, 0);
48 return 0;
49}
50
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +110051/* AMD 756, for most chips (early revs), corrupts register
52 * values on read ... so enable the vendor workaround.
53 */
David Brownell931384f2007-04-17 13:06:29 -070054static int ohci_quirk_amd756(struct usb_hcd *hcd)
Linus Torvalds1da177e2005-04-16 15:20:36 -070055{
56 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
57
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +110058 ohci->flags = OHCI_QUIRK_AMD756;
59 ohci_dbg (ohci, "AMD756 erratum 4 workaround\n");
60
61 /* also erratum 10 (suspend/resume issues) */
David Brownell931384f2007-04-17 13:06:29 -070062 return broken_suspend(hcd);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063}
64
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +110065/* Apple's OHCI driver has a lot of bizarre workarounds
66 * for this chip. Evidently control and bulk lists
67 * can get confused. (B&W G3 models, and ...)
68 */
David Brownell931384f2007-04-17 13:06:29 -070069static int ohci_quirk_opti(struct usb_hcd *hcd)
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +110070{
71 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
72
73 ohci_dbg (ohci, "WARNING: OPTi workarounds unavailable\n");
74
75 return 0;
76}
77
78/* Check for NSC87560. We have to look at the bridge (fn1) to
79 * identify the USB (fn2). This quirk might apply to more or
80 * even all NSC stuff.
81 */
David Brownell931384f2007-04-17 13:06:29 -070082static int ohci_quirk_ns(struct usb_hcd *hcd)
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +110083{
84 struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
85 struct pci_dev *b;
86
87 b = pci_get_slot (pdev->bus, PCI_DEVFN (PCI_SLOT (pdev->devfn), 1));
88 if (b && b->device == PCI_DEVICE_ID_NS_87560_LIO
89 && b->vendor == PCI_VENDOR_ID_NS) {
90 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
91
92 ohci->flags |= OHCI_QUIRK_SUPERIO;
93 ohci_dbg (ohci, "Using NSC SuperIO setup\n");
94 }
95 pci_dev_put(b);
96
97 return 0;
98}
99
100/* Check for Compaq's ZFMicro chipset, which needs short
101 * delays before control or bulk queues get re-activated
102 * in finish_unlinks()
103 */
David Brownell931384f2007-04-17 13:06:29 -0700104static int ohci_quirk_zfmicro(struct usb_hcd *hcd)
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100105{
106 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
107
108 ohci->flags |= OHCI_QUIRK_ZFMICRO;
Mike Nuss89a0fd12007-08-01 13:24:30 -0700109 ohci_dbg(ohci, "enabled Compaq ZFMicro chipset quirks\n");
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100110
111 return 0;
112}
113
Benjamin Herrenschmidt11d1a4a2006-12-15 06:54:03 +1100114/* Check for Toshiba SCC OHCI which has big endian registers
115 * and little endian in memory data structures
116 */
David Brownell931384f2007-04-17 13:06:29 -0700117static int ohci_quirk_toshiba_scc(struct usb_hcd *hcd)
Benjamin Herrenschmidt11d1a4a2006-12-15 06:54:03 +1100118{
119 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
120
121 /* That chip is only present in the southbridge of some
122 * cell based platforms which are supposed to select
123 * CONFIG_USB_OHCI_BIG_ENDIAN_MMIO. We verify here if
124 * that was the case though.
125 */
126#ifdef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO
127 ohci->flags |= OHCI_QUIRK_BE_MMIO;
128 ohci_dbg (ohci, "enabled big endian Toshiba quirk\n");
129 return 0;
130#else
131 ohci_err (ohci, "unsupported big endian Toshiba quirk\n");
132 return -ENXIO;
133#endif
134}
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100135
Michael Hanselmannd576bb92007-05-31 23:34:27 +0200136/* Check for NEC chip and apply quirk for allegedly lost interrupts.
137 */
Mike Nuss89a0fd12007-08-01 13:24:30 -0700138
139static void ohci_quirk_nec_worker(struct work_struct *work)
140{
141 struct ohci_hcd *ohci = container_of(work, struct ohci_hcd, nec_work);
142 int status;
143
144 status = ohci_init(ohci);
145 if (status != 0) {
146 ohci_err(ohci, "Restarting NEC controller failed in %s, %d\n",
147 "ohci_init", status);
148 return;
149 }
150
151 status = ohci_restart(ohci);
152 if (status != 0)
153 ohci_err(ohci, "Restarting NEC controller failed in %s, %d\n",
154 "ohci_restart", status);
155}
156
Michael Hanselmannd576bb92007-05-31 23:34:27 +0200157static int ohci_quirk_nec(struct usb_hcd *hcd)
158{
159 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
160
161 ohci->flags |= OHCI_QUIRK_NEC;
Mike Nuss89a0fd12007-08-01 13:24:30 -0700162 INIT_WORK(&ohci->nec_work, ohci_quirk_nec_worker);
Michael Hanselmannd576bb92007-05-31 23:34:27 +0200163 ohci_dbg (ohci, "enabled NEC chipset lost interrupt quirk\n");
164
165 return 0;
166}
167
Libin Yangab1666c2008-08-08 15:03:31 +0800168static int ohci_quirk_amd700(struct usb_hcd *hcd)
169{
170 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
171 u8 rev = 0;
172
173 if (!amd_smbus_dev)
174 amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI,
175 PCI_DEVICE_ID_ATI_SBX00_SMBUS, NULL);
176 if (!amd_smbus_dev)
177 return 0;
178
179 pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
Libin Yanga1f17a872009-11-04 14:55:18 +0800180
181 /* SB800 needs pre-fetch fix */
182 if ((rev >= 0x40) && (rev <= 0x4f)) {
183 ohci->flags |= OHCI_QUIRK_AMD_PREFETCH;
184 ohci_dbg(ohci, "enabled AMD prefetch quirk\n");
185 }
186
Libin Yangab1666c2008-08-08 15:03:31 +0800187 if ((rev > 0x3b) || (rev < 0x30)) {
188 pci_dev_put(amd_smbus_dev);
189 amd_smbus_dev = NULL;
190 return 0;
191 }
192
193 amd_ohci_iso_count++;
194
195 if (!amd_hb_dev)
196 amd_hb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x9600, NULL);
197
198 ohci->flags |= OHCI_QUIRK_AMD_ISO;
199 ohci_dbg(ohci, "enabled AMD ISO transfers quirk\n");
200
201 return 0;
202}
203
Alan Stern3df71692010-09-10 16:37:05 -0400204/* nVidia controllers continue to drive Reset signalling on the bus
205 * even after system shutdown, wasting power. This flag tells the
206 * shutdown routine to leave the controller OPERATIONAL instead of RESET.
207 */
208static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd)
209{
210 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
211
212 ohci->flags |= OHCI_QUIRK_SHUTDOWN;
213 ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");
214
215 return 0;
216}
217
Libin Yangab1666c2008-08-08 15:03:31 +0800218/*
219 * The hardware normally enables the A-link power management feature, which
220 * lets the system lower the power consumption in idle states.
221 *
222 * Assume the system is configured to have USB 1.1 ISO transfers going
223 * to or from a USB device. Without this quirk, that stream may stutter
224 * or have breaks occasionally. For transfers going to speakers, this
225 * makes a very audible mess...
226 *
227 * That audio playback corruption is due to the audio stream getting
228 * interrupted occasionally when the link goes in lower power state
229 * This USB quirk prevents the link going into that lower power state
230 * during audio playback or other ISO operations.
231 */
232static void quirk_amd_pll(int on)
233{
234 u32 addr;
235 u32 val;
236 u32 bit = (on > 0) ? 1 : 0;
237
238 pci_read_config_dword(amd_smbus_dev, AB_REG_BAR, &addr);
239
240 /* BIT names/meanings are NDA-protected, sorry ... */
241
242 outl(AX_INDXC, AB_INDX(addr));
243 outl(0x40, AB_DATA(addr));
244 outl(AX_DATAC, AB_INDX(addr));
245 val = inl(AB_DATA(addr));
246 val &= ~((1 << 3) | (1 << 4) | (1 << 9));
247 val |= (bit << 3) | ((!bit) << 4) | ((!bit) << 9);
248 outl(val, AB_DATA(addr));
249
250 if (amd_hb_dev) {
251 addr = PCIE_P_CNTL;
252 pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_ADDR, addr);
253
254 pci_read_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, &val);
255 val &= ~(1 | (1 << 3) | (1 << 4) | (1 << 9) | (1 << 12));
256 val |= bit | (bit << 3) | (bit << 12);
257 val |= ((!bit) << 4) | ((!bit) << 9);
258 pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, val);
259
260 addr = BIF_NB;
261 pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_ADDR, addr);
262
263 pci_read_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, &val);
264 val &= ~(1 << 8);
265 val |= bit << 8;
266 pci_write_config_dword(amd_hb_dev, NB_PCIE_INDX_DATA, val);
267 }
268}
269
270static void amd_iso_dev_put(void)
271{
272 amd_ohci_iso_count--;
273 if (amd_ohci_iso_count == 0) {
274 if (amd_smbus_dev) {
275 pci_dev_put(amd_smbus_dev);
276 amd_smbus_dev = NULL;
277 }
278 if (amd_hb_dev) {
279 pci_dev_put(amd_hb_dev);
280 amd_hb_dev = NULL;
281 }
282 }
283
284}
285
Libin Yanga1f17a872009-11-04 14:55:18 +0800286static void sb800_prefetch(struct ohci_hcd *ohci, int on)
287{
288 struct pci_dev *pdev;
289 u16 misc;
290
291 pdev = to_pci_dev(ohci_to_hcd(ohci)->self.controller);
292 pci_read_config_word(pdev, 0x50, &misc);
293 if (on == 0)
294 pci_write_config_word(pdev, 0x50, misc & 0xfcff);
295 else
296 pci_write_config_word(pdev, 0x50, misc | 0x0300);
297}
298
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100299/* List of quirks for OHCI */
300static const struct pci_device_id ohci_pci_quirks[] = {
301 {
302 PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x740c),
303 .driver_data = (unsigned long)ohci_quirk_amd756,
304 },
305 {
306 PCI_DEVICE(PCI_VENDOR_ID_OPTI, 0xc861),
307 .driver_data = (unsigned long)ohci_quirk_opti,
308 },
309 {
310 PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_ANY_ID),
311 .driver_data = (unsigned long)ohci_quirk_ns,
312 },
313 {
314 PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xa0f8),
315 .driver_data = (unsigned long)ohci_quirk_zfmicro,
316 },
Benjamin Herrenschmidt11d1a4a2006-12-15 06:54:03 +1100317 {
318 PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA_2, 0x01b6),
319 .driver_data = (unsigned long)ohci_quirk_toshiba_scc,
320 },
David Brownell931384f2007-04-17 13:06:29 -0700321 {
Michael Hanselmannd576bb92007-05-31 23:34:27 +0200322 PCI_DEVICE(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB),
323 .driver_data = (unsigned long)ohci_quirk_nec,
324 },
325 {
David Brownell931384f2007-04-17 13:06:29 -0700326 /* Toshiba portege 4000 */
327 .vendor = PCI_VENDOR_ID_AL,
328 .device = 0x5237,
Andrey Borzenkov8ab5e8c2007-05-19 14:23:28 -0700329 .subvendor = PCI_VENDOR_ID_TOSHIBA,
David Brownell931384f2007-04-17 13:06:29 -0700330 .subdevice = 0x0004,
331 .driver_data = (unsigned long) broken_suspend,
332 },
Raphael Assenat33f73e52007-04-17 13:09:18 -0700333 {
334 PCI_DEVICE(PCI_VENDOR_ID_ITE, 0x8152),
335 .driver_data = (unsigned long) broken_suspend,
336 },
Libin Yangab1666c2008-08-08 15:03:31 +0800337 {
338 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4397),
339 .driver_data = (unsigned long)ohci_quirk_amd700,
340 },
341 {
342 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4398),
343 .driver_data = (unsigned long)ohci_quirk_amd700,
344 },
345 {
346 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399),
347 .driver_data = (unsigned long)ohci_quirk_amd700,
348 },
Alan Stern3df71692010-09-10 16:37:05 -0400349 {
350 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID),
351 .driver_data = (unsigned long) ohci_quirk_nvidia_shutdown,
352 },
Libin Yangab1666c2008-08-08 15:03:31 +0800353
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100354 /* FIXME for some of the early AMD 760 southbridges, OHCI
355 * won't work at all. blacklist them.
356 */
Benjamin Herrenschmidt11d1a4a2006-12-15 06:54:03 +1100357
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100358 {},
359};
360
361static int ohci_pci_reset (struct usb_hcd *hcd)
362{
363 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
364 int ret = 0;
365
366 if (hcd->self.controller) {
367 struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
368 const struct pci_device_id *quirk_id;
369
370 quirk_id = pci_match_id(ohci_pci_quirks, pdev);
371 if (quirk_id != NULL) {
372 int (*quirk)(struct usb_hcd *ohci);
373 quirk = (void *)quirk_id->driver_data;
374 ret = quirk(hcd);
375 }
376 }
377 if (ret == 0) {
378 ohci_hcd_init (ohci);
379 return ohci_init (ohci);
380 }
381 return ret;
382}
383
384
385static int __devinit ohci_pci_start (struct usb_hcd *hcd)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386{
387 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
388 int ret;
389
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100390#ifdef CONFIG_PM /* avoid warnings about unused pdev */
David Brownell6a9062f2006-01-23 15:28:07 -0800391 if (hcd->self.controller) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392 struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
393
David Brownell6a9062f2006-01-23 15:28:07 -0800394 /* RWC may not be set for add-in PCI cards, since boot
395 * firmware probably ignored them. This transfers PCI
Alan Stern6fd90862008-12-17 17:20:38 -0500396 * PM wakeup capabilities.
David Brownell6a9062f2006-01-23 15:28:07 -0800397 */
Alan Stern6fd90862008-12-17 17:20:38 -0500398 if (device_can_wakeup(&pdev->dev))
David Brownell6a9062f2006-01-23 15:28:07 -0800399 ohci->hc_control |= OHCI_CTRL_RWC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 }
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100401#endif /* CONFIG_PM */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100403 ret = ohci_run (ohci);
404 if (ret < 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405 ohci_err (ohci, "can't start\n");
406 ohci_stop (hcd);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 }
Benjamin Herrenschmidt4302a5952006-12-15 06:53:55 +1100408 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409}
410
411#ifdef CONFIG_PM
412
Alan Stern41472002010-06-25 14:02:14 -0400413static int ohci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414{
Benjamin Herrenschmidt8de98402005-11-25 09:59:46 +1100415 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
416 unsigned long flags;
417 int rc = 0;
418
419 /* Root hub was already suspended. Disable irq emission and
420 * mark HW unaccessible, bail out if RH has been resumed. Use
421 * the spinlock to properly synchronize with possible pending
422 * RH suspend or resume activity.
423 *
424 * This is still racy as hcd->state is manipulated outside of
425 * any locks =P But that will be a different fix.
426 */
427 spin_lock_irqsave (&ohci->lock, flags);
428 if (hcd->state != HC_STATE_SUSPENDED) {
429 rc = -EINVAL;
430 goto bail;
431 }
432 ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
433 (void)ohci_readl(ohci, &ohci->regs->intrdisable);
David Brownell18584992006-08-14 23:11:06 -0700434
Benjamin Herrenschmidt8de98402005-11-25 09:59:46 +1100435 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
436 bail:
437 spin_unlock_irqrestore (&ohci->lock, flags);
438
439 return rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440}
441
442
Alan Stern6ec4beb2009-04-27 13:33:41 -0400443static int ohci_pci_resume(struct usb_hcd *hcd, bool hibernated)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444{
Benjamin Herrenschmidt8de98402005-11-25 09:59:46 +1100445 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
Alan Stern6ec4beb2009-04-27 13:33:41 -0400446
447 /* Make sure resume from hibernation re-enumerates everything */
448 if (hibernated)
449 ohci_usb_reset(hcd_to_ohci(hcd));
450
Alan Stern43bbb7e2008-04-03 18:03:17 -0400451 ohci_finish_controller_resume(hcd);
David Brownellf197b2c2005-09-22 22:42:53 -0700452 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453}
454
455#endif /* CONFIG_PM */
456
457
458/*-------------------------------------------------------------------------*/
459
460static const struct hc_driver ohci_pci_hc_driver = {
461 .description = hcd_name,
462 .product_desc = "OHCI Host Controller",
463 .hcd_priv_size = sizeof(struct ohci_hcd),
464
465 /*
466 * generic hardware linkage
467 */
468 .irq = ohci_irq,
469 .flags = HCD_MEMORY | HCD_USB11,
470
471 /*
472 * basic lifecycle operations
473 */
474 .reset = ohci_pci_reset,
475 .start = ohci_pci_start,
David Brownelld4139842006-08-04 11:31:55 -0700476 .stop = ohci_stop,
Aleksey Gorelov64a21d02006-08-08 17:24:08 -0700477 .shutdown = ohci_shutdown,
David Brownelld4139842006-08-04 11:31:55 -0700478
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479#ifdef CONFIG_PM
Alan Stern7be7d742008-04-03 18:03:06 -0400480 .pci_suspend = ohci_pci_suspend,
481 .pci_resume = ohci_pci_resume,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700482#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483
484 /*
485 * managing i/o requests and associated device resources
486 */
487 .urb_enqueue = ohci_urb_enqueue,
488 .urb_dequeue = ohci_urb_dequeue,
489 .endpoint_disable = ohci_endpoint_disable,
490
491 /*
492 * scheduling support
493 */
494 .get_frame_number = ohci_get_frame,
495
496 /*
497 * root hub support
498 */
499 .hub_status_data = ohci_hub_status_data,
500 .hub_control = ohci_hub_control,
David Brownell8ad7fe12005-09-13 19:59:11 -0700501#ifdef CONFIG_PM
Alan Stern0c0382e2005-10-13 17:08:02 -0400502 .bus_suspend = ohci_bus_suspend,
503 .bus_resume = ohci_bus_resume,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504#endif
505 .start_port_reset = ohci_start_port_reset,
506};
507
508/*-------------------------------------------------------------------------*/
509
510
511static const struct pci_device_id pci_ids [] = { {
512 /* handle any USB OHCI controller */
Jean Delvarec67808e2006-04-09 20:07:35 +0200513 PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_OHCI, ~0),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514 .driver_data = (unsigned long) &ohci_pci_hc_driver,
515 }, { /* end: all zeroes */ }
516};
517MODULE_DEVICE_TABLE (pci, pci_ids);
518
519/* pci driver glue; this is a "new style" PCI driver module */
520static struct pci_driver ohci_pci_driver = {
521 .name = (char *) hcd_name,
522 .id_table = pci_ids,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700523
524 .probe = usb_hcd_pci_probe,
525 .remove = usb_hcd_pci_remove,
Aleksey Gorelov64a21d02006-08-08 17:24:08 -0700526 .shutdown = usb_hcd_pci_shutdown,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527
Alan Sternabb30642009-04-27 13:33:24 -0400528#ifdef CONFIG_PM_SLEEP
529 .driver = {
530 .pm = &usb_hcd_pci_pm_ops
531 },
532#endif
533};