22 #error "This file is PCI bus glue. CONFIG_PCI must be defined."
26 #define PCI_DEVICE_ID_INTEL_CE4100_USB 0x2e70
48 static int ehci_pci_setup(
struct usb_hcd *hcd)
50 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
57 ehci->
caps = hcd->regs;
71 if (pdev->
device == 0x01b5) {
72 #ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
76 "unsupported big endian Toshiba quirk\n");
90 if (pci_set_consistent_dma_mask(pdev,
93 "workaround for >2GB RAM\n");
119 if (pdev->
device == 0x7463) {
120 ehci_info(ehci,
"ignoring AMD8111 (errata)\n");
132 if (pdev->
device == 0x7808) {
134 ehci_info(ehci,
"applying AMD SB700/SB800/Hudson-2/3 EHCI dummy qh workaround\n");
145 pci_read_config_byte(pdev, 0x4b, &tmp);
148 pci_write_config_byte(pdev, 0x4b, tmp | 0x20);
163 if (pdev->
device == 0x4396) {
165 ehci_info(ehci,
"applying AMD SB700/SB800/Hudson-2/3 EHCI dummy qh workaround\n");
170 if ((pdev->
device == 0x4386) || (pdev->
device == 0x4396)) {
177 if ((pdev->
device == 0x4386) || (rev == 0x3a)
180 ehci_info(ehci,
"applying AMD SB600/SB700 USB "
181 "freeze workaround\n");
182 pci_read_config_byte(pdev, 0x53, &tmp);
183 pci_write_config_byte(pdev, 0x53, tmp | (1<<3));
190 ehci_info(ehci,
"applying MosChip frame-index workaround\n");
195 retval = ehci_setup(hcd);
207 || pdev->
device == 0x0829) {
208 ehci_info(ehci,
"disable lpm for langwell/penwell\n");
220 ehci_info(ehci,
"disable lpm/ppcd for nvidia mcp89");
232 pci_read_config_dword(pdev, temp, &temp);
234 if ((temp & (3 << 13)) == (1 << 13)) {
237 temp = ehci_readl(ehci, &ehci->
debug->control);
252 ehci_dbg(ehci,
"bogus port configuration: "
253 "cc=%d x pcc=%d < ports=%d\n",
275 pci_read_config_byte(pdev, 0x60, &ehci->
sbrn);
282 if (!device_can_wakeup(&pdev->
dev)) {
285 pci_read_config_word(pdev, 0x62, &port_wake);
286 if (port_wake & 0x0001) {
292 #ifdef CONFIG_USB_SUSPEND
304 ehci_warn(ehci,
"selective suspend/wakeup unavailable\n");
307 ehci_port_power(ehci, 1);
308 retval = ehci_pci_reinit(ehci, pdev);
326 static int ehci_pci_suspend(
struct usb_hcd *hcd,
bool do_wakeup)
328 return ehci_suspend(hcd, do_wakeup);
331 static bool usb_is_intel_switchable_ehci(
struct pci_dev *pdev)
335 (pdev->
device == 0x1E26 ||
340 static void ehci_enable_xhci_companion(
void)
353 static int ehci_pci_resume(
struct usb_hcd *hcd,
bool hibernated)
355 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
374 if (usb_is_intel_switchable_ehci(pdev))
375 ehci_enable_xhci_companion();
377 if (ehci_resume(hcd, hibernated) != 0)
378 (
void) ehci_pci_reinit(ehci, pdev);
383 static int ehci_update_device(
struct usb_hcd *hcd,
struct usb_device *
udev)
385 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
391 if (ehci->
has_lpm && !udev->parent->parent) {
392 rc = ehci_lpm_set_da(ehci, udev->devnum, udev->portnum);
394 rc = ehci_lpm_check(ehci, udev->portnum);
399 static const struct hc_driver ehci_pci_hc_driver = {
400 .description = hcd_name,
401 .product_desc =
"EHCI Host Controller",
402 .hcd_priv_size =
sizeof(
struct ehci_hcd),
408 .flags = HCD_MEMORY | HCD_USB2,
413 .reset = ehci_pci_setup,
416 .pci_suspend = ehci_pci_suspend,
417 .pci_resume = ehci_pci_resume,
420 .shutdown = ehci_shutdown,
425 .urb_enqueue = ehci_urb_enqueue,
426 .urb_dequeue = ehci_urb_dequeue,
427 .endpoint_disable = ehci_endpoint_disable,
428 .endpoint_reset = ehci_endpoint_reset,
433 .get_frame_number = ehci_get_frame,
438 .hub_status_data = ehci_hub_status_data,
439 .hub_control = ehci_hub_control,
442 .relinquish_port = ehci_relinquish_port,
443 .port_handed_over = ehci_port_handed_over,
448 .update_device = ehci_update_device,
450 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
459 .driver_data = (
unsigned long) &ehci_pci_hc_driver,
462 .driver_data = (
unsigned long) &ehci_pci_hc_driver,
470 .name = (
char *) hcd_name,
477 #ifdef CONFIG_PM_SLEEP
479 .pm = &usb_hcd_pci_pm_ops