diff options
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-dbg.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-mem.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-q.c | 13 | ||||
-rw-r--r-- | drivers/usb/host/ohci.h | 1 | ||||
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 9 |
11 files changed, 43 insertions, 24 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 495e2a3ef6f1..9b347d765383 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c | |||
@@ -394,7 +394,7 @@ static void qh_lines ( | |||
394 | mark = ' '; | 394 | mark = ' '; |
395 | if (hw_curr == td->qtd_dma) | 395 | if (hw_curr == td->qtd_dma) |
396 | mark = '*'; | 396 | mark = '*'; |
397 | else if (qh->hw_qtd_next == td->qtd_dma) | 397 | else if (qh->hw_qtd_next == cpu_to_le32(td->qtd_dma)) |
398 | mark = '+'; | 398 | mark = '+'; |
399 | else if (QTD_LENGTH (scratch)) { | 399 | else if (QTD_LENGTH (scratch)) { |
400 | if (td->hw_alt_next == ehci->async->hw_alt_next) | 400 | if (td->hw_alt_next == ehci->async->hw_alt_next) |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index a63bb792e2c7..84d2b93aca37 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -721,7 +721,7 @@ static int ehci_get_frame (struct usb_hcd *hcd) | |||
721 | * the right sort of wakeup. | 721 | * the right sort of wakeup. |
722 | */ | 722 | */ |
723 | 723 | ||
724 | static int ehci_suspend (struct usb_hcd *hcd, u32 state) | 724 | static int ehci_suspend (struct usb_hcd *hcd, pm_message_t message) |
725 | { | 725 | { |
726 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); | 726 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
727 | 727 | ||
@@ -729,7 +729,7 @@ static int ehci_suspend (struct usb_hcd *hcd, u32 state) | |||
729 | msleep (100); | 729 | msleep (100); |
730 | 730 | ||
731 | #ifdef CONFIG_USB_SUSPEND | 731 | #ifdef CONFIG_USB_SUSPEND |
732 | (void) usb_suspend_device (hcd->self.root_hub, state); | 732 | (void) usb_suspend_device (hcd->self.root_hub, message); |
733 | #else | 733 | #else |
734 | usb_lock_device (hcd->self.root_hub); | 734 | usb_lock_device (hcd->self.root_hub); |
735 | (void) ehci_hub_suspend (hcd); | 735 | (void) ehci_hub_suspend (hcd); |
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 9938697ff361..5c38ad869485 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c | |||
@@ -156,8 +156,7 @@ static void ehci_mem_cleanup (struct ehci_hcd *ehci) | |||
156 | ehci->periodic = NULL; | 156 | ehci->periodic = NULL; |
157 | 157 | ||
158 | /* shadow periodic table */ | 158 | /* shadow periodic table */ |
159 | if (ehci->pshadow) | 159 | kfree(ehci->pshadow); |
160 | kfree (ehci->pshadow); | ||
161 | ehci->pshadow = NULL; | 160 | ehci->pshadow = NULL; |
162 | } | 161 | } |
163 | 162 | ||
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index f6c86354e304..2fa1ffee5ff3 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -310,9 +310,9 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
310 | 310 | ||
311 | for (i = qh->start; i < ehci->periodic_size; i += period) { | 311 | for (i = qh->start; i < ehci->periodic_size; i += period) { |
312 | union ehci_shadow *prev = &ehci->pshadow [i]; | 312 | union ehci_shadow *prev = &ehci->pshadow [i]; |
313 | u32 *hw_p = &ehci->periodic [i]; | 313 | __le32 *hw_p = &ehci->periodic [i]; |
314 | union ehci_shadow here = *prev; | 314 | union ehci_shadow here = *prev; |
315 | u32 type = 0; | 315 | __le32 type = 0; |
316 | 316 | ||
317 | /* skip the iso nodes at list head */ | 317 | /* skip the iso nodes at list head */ |
318 | while (here.ptr) { | 318 | while (here.ptr) { |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 67988dba9eb7..e763a8399a75 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -364,7 +364,7 @@ union ehci_shadow { | |||
364 | struct ehci_itd *itd; /* Q_TYPE_ITD */ | 364 | struct ehci_itd *itd; /* Q_TYPE_ITD */ |
365 | struct ehci_sitd *sitd; /* Q_TYPE_SITD */ | 365 | struct ehci_sitd *sitd; /* Q_TYPE_SITD */ |
366 | struct ehci_fstn *fstn; /* Q_TYPE_FSTN */ | 366 | struct ehci_fstn *fstn; /* Q_TYPE_FSTN */ |
367 | u32 *hw_next; /* (all types) */ | 367 | __le32 *hw_next; /* (all types) */ |
368 | void *ptr; | 368 | void *ptr; |
369 | }; | 369 | }; |
370 | 370 | ||
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 90285f180f87..8aab5907afe9 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -458,9 +458,11 @@ static int ohci_hcd_omap_drv_remove(struct device *dev) | |||
458 | 458 | ||
459 | /* states match PCI usage, always suspending the root hub except that | 459 | /* states match PCI usage, always suspending the root hub except that |
460 | * 4 ~= D3cold (ACPI D3) with clock off (resume sees reset). | 460 | * 4 ~= D3cold (ACPI D3) with clock off (resume sees reset). |
461 | * | ||
462 | * FIXME: above comment is not right, and code is wrong, too :-(. | ||
461 | */ | 463 | */ |
462 | 464 | ||
463 | static int ohci_omap_suspend(struct device *dev, u32 state, u32 level) | 465 | static int ohci_omap_suspend(struct device *dev, pm_message_t state, u32 level) |
464 | { | 466 | { |
465 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 467 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); |
466 | int status = -EINVAL; | 468 | int status = -EINVAL; |
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index b611582e6bcf..57fd07d00549 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -54,7 +54,7 @@ ohci_pci_start (struct usb_hcd *hcd) | |||
54 | if (pdev->vendor == PCI_VENDOR_ID_AMD | 54 | if (pdev->vendor == PCI_VENDOR_ID_AMD |
55 | && pdev->device == 0x740c) { | 55 | && pdev->device == 0x740c) { |
56 | ohci->flags = OHCI_QUIRK_AMD756; | 56 | ohci->flags = OHCI_QUIRK_AMD756; |
57 | ohci_info (ohci, "AMD756 erratum 4 workaround\n"); | 57 | ohci_dbg (ohci, "AMD756 erratum 4 workaround\n"); |
58 | // also somewhat erratum 10 (suspend/resume issues) | 58 | // also somewhat erratum 10 (suspend/resume issues) |
59 | } | 59 | } |
60 | 60 | ||
@@ -68,7 +68,7 @@ ohci_pci_start (struct usb_hcd *hcd) | |||
68 | */ | 68 | */ |
69 | else if (pdev->vendor == PCI_VENDOR_ID_OPTI | 69 | else if (pdev->vendor == PCI_VENDOR_ID_OPTI |
70 | && pdev->device == 0xc861) { | 70 | && pdev->device == 0xc861) { |
71 | ohci_info (ohci, | 71 | ohci_dbg (ohci, |
72 | "WARNING: OPTi workarounds unavailable\n"); | 72 | "WARNING: OPTi workarounds unavailable\n"); |
73 | } | 73 | } |
74 | 74 | ||
@@ -84,9 +84,20 @@ ohci_pci_start (struct usb_hcd *hcd) | |||
84 | if (b && b->device == PCI_DEVICE_ID_NS_87560_LIO | 84 | if (b && b->device == PCI_DEVICE_ID_NS_87560_LIO |
85 | && b->vendor == PCI_VENDOR_ID_NS) { | 85 | && b->vendor == PCI_VENDOR_ID_NS) { |
86 | ohci->flags |= OHCI_QUIRK_SUPERIO; | 86 | ohci->flags |= OHCI_QUIRK_SUPERIO; |
87 | ohci_info (ohci, "Using NSC SuperIO setup\n"); | 87 | ohci_dbg (ohci, "Using NSC SuperIO setup\n"); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | |||
91 | /* Check for Compaq's ZFMicro chipset, which needs short | ||
92 | * delays before control or bulk queues get re-activated | ||
93 | * in finish_unlinks() | ||
94 | */ | ||
95 | else if (pdev->vendor == PCI_VENDOR_ID_COMPAQ | ||
96 | && pdev->device == 0xa0f8) { | ||
97 | ohci->flags |= OHCI_QUIRK_ZFMICRO; | ||
98 | ohci_dbg (ohci, | ||
99 | "enabled Compaq ZFMicro chipset quirk\n"); | ||
100 | } | ||
90 | } | 101 | } |
91 | 102 | ||
92 | /* NOTE: there may have already been a first reset, to | 103 | /* NOTE: there may have already been a first reset, to |
@@ -102,7 +113,7 @@ ohci_pci_start (struct usb_hcd *hcd) | |||
102 | 113 | ||
103 | #ifdef CONFIG_PM | 114 | #ifdef CONFIG_PM |
104 | 115 | ||
105 | static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state) | 116 | static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) |
106 | { | 117 | { |
107 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 118 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
108 | 119 | ||
@@ -111,7 +122,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state) | |||
111 | msleep (100); | 122 | msleep (100); |
112 | 123 | ||
113 | #ifdef CONFIG_USB_SUSPEND | 124 | #ifdef CONFIG_USB_SUSPEND |
114 | (void) usb_suspend_device (hcd->self.root_hub, state); | 125 | (void) usb_suspend_device (hcd->self.root_hub, message); |
115 | #else | 126 | #else |
116 | usb_lock_device (hcd->self.root_hub); | 127 | usb_lock_device (hcd->self.root_hub); |
117 | (void) ohci_hub_suspend (hcd); | 128 | (void) ohci_hub_suspend (hcd); |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 6f3464a95779..e5bc1789d18a 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -337,7 +337,7 @@ static int ohci_hcd_pxa27x_drv_remove(struct device *dev) | |||
337 | return 0; | 337 | return 0; |
338 | } | 338 | } |
339 | 339 | ||
340 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, u32 state, u32 level) | 340 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state, u32 level) |
341 | { | 341 | { |
342 | // struct platform_device *pdev = to_platform_device(dev); | 342 | // struct platform_device *pdev = to_platform_device(dev); |
343 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | 343 | // struct usb_hcd *hcd = dev_get_drvdata(dev); |
@@ -346,7 +346,7 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, u32 state, u32 level) | |||
346 | return 0; | 346 | return 0; |
347 | } | 347 | } |
348 | 348 | ||
349 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev, u32 state) | 349 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev, u32 level) |
350 | { | 350 | { |
351 | // struct platform_device *pdev = to_platform_device(dev); | 351 | // struct platform_device *pdev = to_platform_device(dev); |
352 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | 352 | // struct usb_hcd *hcd = dev_get_drvdata(dev); |
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index c90114a77277..e372306ed0da 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c | |||
@@ -1021,6 +1021,8 @@ rescan_this: | |||
1021 | 1021 | ||
1022 | if (ohci->ed_controltail) { | 1022 | if (ohci->ed_controltail) { |
1023 | command |= OHCI_CLF; | 1023 | command |= OHCI_CLF; |
1024 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) | ||
1025 | mdelay(1); | ||
1024 | if (!(ohci->hc_control & OHCI_CTRL_CLE)) { | 1026 | if (!(ohci->hc_control & OHCI_CTRL_CLE)) { |
1025 | control |= OHCI_CTRL_CLE; | 1027 | control |= OHCI_CTRL_CLE; |
1026 | ohci_writel (ohci, 0, | 1028 | ohci_writel (ohci, 0, |
@@ -1029,6 +1031,8 @@ rescan_this: | |||
1029 | } | 1031 | } |
1030 | if (ohci->ed_bulktail) { | 1032 | if (ohci->ed_bulktail) { |
1031 | command |= OHCI_BLF; | 1033 | command |= OHCI_BLF; |
1034 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) | ||
1035 | mdelay(1); | ||
1032 | if (!(ohci->hc_control & OHCI_CTRL_BLE)) { | 1036 | if (!(ohci->hc_control & OHCI_CTRL_BLE)) { |
1033 | control |= OHCI_CTRL_BLE; | 1037 | control |= OHCI_CTRL_BLE; |
1034 | ohci_writel (ohci, 0, | 1038 | ohci_writel (ohci, 0, |
@@ -1039,12 +1043,17 @@ rescan_this: | |||
1039 | /* CLE/BLE to enable, CLF/BLF to (maybe) kickstart */ | 1043 | /* CLE/BLE to enable, CLF/BLF to (maybe) kickstart */ |
1040 | if (control) { | 1044 | if (control) { |
1041 | ohci->hc_control |= control; | 1045 | ohci->hc_control |= control; |
1046 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) | ||
1047 | mdelay(1); | ||
1042 | ohci_writel (ohci, ohci->hc_control, | 1048 | ohci_writel (ohci, ohci->hc_control, |
1043 | &ohci->regs->control); | 1049 | &ohci->regs->control); |
1044 | } | 1050 | } |
1045 | if (command) | 1051 | if (command) { |
1052 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) | ||
1053 | mdelay(1); | ||
1046 | ohci_writel (ohci, command, &ohci->regs->cmdstatus); | 1054 | ohci_writel (ohci, command, &ohci->regs->cmdstatus); |
1047 | } | 1055 | } |
1056 | } | ||
1048 | } | 1057 | } |
1049 | 1058 | ||
1050 | 1059 | ||
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 2ba6e2b0210c..22e1ac138ac0 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h | |||
@@ -396,6 +396,7 @@ struct ohci_hcd { | |||
396 | #define OHCI_QUIRK_SUPERIO 0x02 /* natsemi */ | 396 | #define OHCI_QUIRK_SUPERIO 0x02 /* natsemi */ |
397 | #define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */ | 397 | #define OHCI_QUIRK_INITRESET 0x04 /* SiS, OPTi, ... */ |
398 | #define OHCI_BIG_ENDIAN 0x08 /* big endian HC */ | 398 | #define OHCI_BIG_ENDIAN 0x08 /* big endian HC */ |
399 | #define OHCI_QUIRK_ZFMICRO 0x10 /* Compaq ZFMicro chipset*/ | ||
399 | // there are also chip quirks/bugs in init logic | 400 | // there are also chip quirks/bugs in init logic |
400 | 401 | ||
401 | }; | 402 | }; |
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index 324a1a9bbdb2..49bd83ee0c75 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -716,7 +716,7 @@ static void uhci_stop(struct usb_hcd *hcd) | |||
716 | } | 716 | } |
717 | 717 | ||
718 | #ifdef CONFIG_PM | 718 | #ifdef CONFIG_PM |
719 | static int uhci_suspend(struct usb_hcd *hcd, u32 state) | 719 | static int uhci_suspend(struct usb_hcd *hcd, pm_message_t message) |
720 | { | 720 | { |
721 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 721 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |
722 | 722 | ||
@@ -890,8 +890,7 @@ up_failed: | |||
890 | debugfs_remove(uhci_debugfs_root); | 890 | debugfs_remove(uhci_debugfs_root); |
891 | 891 | ||
892 | debug_failed: | 892 | debug_failed: |
893 | if (errbuf) | 893 | kfree(errbuf); |
894 | kfree(errbuf); | ||
895 | 894 | ||
896 | errbuf_failed: | 895 | errbuf_failed: |
897 | 896 | ||
@@ -906,9 +905,7 @@ static void __exit uhci_hcd_cleanup(void) | |||
906 | warn("not all urb_priv's were freed!"); | 905 | warn("not all urb_priv's were freed!"); |
907 | 906 | ||
908 | debugfs_remove(uhci_debugfs_root); | 907 | debugfs_remove(uhci_debugfs_root); |
909 | 908 | kfree(errbuf); | |
910 | if (errbuf) | ||
911 | kfree(errbuf); | ||
912 | } | 909 | } |
913 | 910 | ||
914 | module_init(uhci_hcd_init); | 911 | module_init(uhci_hcd_init); |