18 #error "This file is PCI bus glue. CONFIG_PCI must be defined."
21 #include <linux/pci.h>
27 static int broken_suspend(
struct usb_hcd *hcd)
36 static int ohci_quirk_amd756(
struct usb_hcd *hcd)
41 ohci_dbg (ohci,
"AMD756 erratum 4 workaround\n");
44 return broken_suspend(hcd);
51 static int ohci_quirk_opti(
struct usb_hcd *hcd)
55 ohci_dbg (ohci,
"WARNING: OPTi workarounds unavailable\n");
64 static int ohci_quirk_ns(
struct usb_hcd *hcd)
75 ohci_dbg (ohci,
"Using NSC SuperIO setup\n");
86 static int ohci_quirk_zfmicro(
struct usb_hcd *hcd)
91 ohci_dbg(ohci,
"enabled Compaq ZFMicro chipset quirks\n");
99 static int ohci_quirk_toshiba_scc(
struct usb_hcd *hcd)
108 #ifdef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO
110 ohci_dbg (ohci,
"enabled big endian Toshiba quirk\n");
113 ohci_err (ohci,
"unsupported big endian Toshiba quirk\n");
126 status = ohci_init(ohci);
128 ohci_err(ohci,
"Restarting NEC controller failed in %s, %d\n",
129 "ohci_init", status);
133 status = ohci_restart(ohci);
135 ohci_err(ohci,
"Restarting NEC controller failed in %s, %d\n",
136 "ohci_restart", status);
139 static int ohci_quirk_nec(
struct usb_hcd *hcd)
141 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
145 ohci_dbg (ohci,
"enabled NEC chipset lost interrupt quirk\n");
150 static int ohci_quirk_amd700(
struct usb_hcd *hcd)
152 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
167 if ((rev >= 0x40) && (rev <= 0x4f)) {
169 ohci_dbg(ohci,
"enabled AMD prefetch quirk\n");
173 amd_smbus_dev =
NULL;
178 static void sb800_prefetch(
struct ohci_hcd *ohci,
int on)
184 pci_read_config_word(pdev, 0x50, &misc);
186 pci_write_config_word(pdev, 0x50, misc & 0xfcff);
188 pci_write_config_word(pdev, 0x50, misc | 0x0300);
195 .driver_data = (
unsigned long)ohci_quirk_amd756,
199 .driver_data = (
unsigned long)ohci_quirk_opti,
203 .driver_data = (
unsigned long)ohci_quirk_ns,
207 .driver_data = (
unsigned long)ohci_quirk_zfmicro,
211 .driver_data = (
unsigned long)ohci_quirk_toshiba_scc,
215 .driver_data = (
unsigned long)ohci_quirk_nec,
223 .driver_data = (
unsigned long) broken_suspend,
227 .driver_data = (
unsigned long) broken_suspend,
231 .driver_data = (
unsigned long)ohci_quirk_amd700,
235 .driver_data = (
unsigned long)ohci_quirk_amd700,
239 .driver_data = (
unsigned long)ohci_quirk_amd700,
249 static int ohci_pci_reset (
struct usb_hcd *hcd)
251 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
254 if (hcd->self.controller) {
259 if (quirk_id !=
NULL) {
260 int (*quirk)(
struct usb_hcd *ohci);
266 ohci_hcd_init (ohci);
267 return ohci_init (ohci);
273 static int __devinit ohci_pci_start (
struct usb_hcd *hcd)
275 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
279 if (hcd->self.controller) {
286 if (device_can_wakeup(&pdev->
dev))
291 ret = ohci_run (ohci);
301 static int ohci_pci_suspend(
struct usb_hcd *hcd,
bool do_wakeup)
303 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
320 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
322 spin_unlock_irqrestore (&ohci->
lock, flags);
328 static int ohci_pci_resume(
struct usb_hcd *hcd,
bool hibernated)
330 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
334 ohci_usb_reset(hcd_to_ohci(hcd));
336 ohci_finish_controller_resume(hcd);
345 static const struct hc_driver ohci_pci_hc_driver = {
346 .description = hcd_name,
347 .product_desc =
"OHCI Host Controller",
348 .hcd_priv_size =
sizeof(
struct ohci_hcd),
354 .flags = HCD_MEMORY | HCD_USB11,
359 .reset = ohci_pci_reset,
360 .start = ohci_pci_start,
362 .shutdown = ohci_shutdown,
365 .pci_suspend = ohci_pci_suspend,
366 .pci_resume = ohci_pci_resume,
372 .urb_enqueue = ohci_urb_enqueue,
373 .urb_dequeue = ohci_urb_dequeue,
374 .endpoint_disable = ohci_endpoint_disable,
379 .get_frame_number = ohci_get_frame,
384 .hub_status_data = ohci_hub_status_data,
385 .hub_control = ohci_hub_control,
387 .bus_suspend = ohci_bus_suspend,
388 .bus_resume = ohci_bus_resume,
399 .driver_data = (
unsigned long) &ohci_pci_hc_driver,
403 .driver_data = (
unsigned long) &ohci_pci_hc_driver,
410 .name = (
char *) hcd_name,
417 #ifdef CONFIG_PM_SLEEP
419 .pm = &usb_hcd_pci_pm_ops