aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/Kconfig23
-rw-r--r--drivers/usb/host/ehci-hcd.c25
-rw-r--r--drivers/usb/host/ehci-ps3.c1
-rw-r--r--drivers/usb/host/ehci-sched.c4
-rw-r--r--drivers/usb/host/isp1760-if.c22
-rw-r--r--drivers/usb/host/ohci-ps3.c3
-rw-r--r--drivers/usb/host/r8a66597-hcd.c5
7 files changed, 37 insertions, 46 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 56f592dc0b36..f3a75a929e0a 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -110,29 +110,18 @@ config USB_ISP116X_HCD
110 110
111config USB_ISP1760_HCD 111config USB_ISP1760_HCD
112 tristate "ISP 1760 HCD support" 112 tristate "ISP 1760 HCD support"
113 depends on USB && EXPERIMENTAL 113 depends on USB && EXPERIMENTAL && (PCI || PPC_OF)
114 ---help--- 114 ---help---
115 The ISP1760 chip is a USB 2.0 host controller. 115 The ISP1760 chip is a USB 2.0 host controller.
116 116
117 This driver does not support isochronous transfers or OTG. 117 This driver does not support isochronous transfers or OTG.
118 This USB controller is usually attached to a non-DMA-Master
119 capable bus. NXP's eval kit brings this chip on PCI card
120 where the chip itself is behind a PLB to simulate such
121 a bus.
118 122
119 To compile this driver as a module, choose M here: the 123 To compile this driver as a module, choose M here: the
120 module will be called isp1760-hcd. 124 module will be called isp1760.
121
122config USB_ISP1760_PCI
123 bool "Support for the PCI bus"
124 depends on USB_ISP1760_HCD && PCI
125 ---help---
126 Enables support for the device present on the PCI bus.
127 This should only be required if you happen to have the eval kit from
128 NXP and you are going to test it.
129
130config USB_ISP1760_OF
131 bool "Support for the OF platform bus"
132 depends on USB_ISP1760_HCD && PPC_OF
133 ---help---
134 Enables support for the device present on the PowerPC
135 OpenFirmware platform bus.
136 125
137config USB_OHCI_HCD 126config USB_OHCI_HCD
138 tristate "OHCI HCD support" 127 tristate "OHCI HCD support"
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 15a803b206b8..4725d15d096f 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -643,7 +643,7 @@ static int ehci_run (struct usb_hcd *hcd)
643static irqreturn_t ehci_irq (struct usb_hcd *hcd) 643static irqreturn_t ehci_irq (struct usb_hcd *hcd)
644{ 644{
645 struct ehci_hcd *ehci = hcd_to_ehci (hcd); 645 struct ehci_hcd *ehci = hcd_to_ehci (hcd);
646 u32 status, pcd_status = 0, cmd; 646 u32 status, masked_status, pcd_status = 0, cmd;
647 int bh; 647 int bh;
648 648
649 spin_lock (&ehci->lock); 649 spin_lock (&ehci->lock);
@@ -656,14 +656,14 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
656 goto dead; 656 goto dead;
657 } 657 }
658 658
659 status &= INTR_MASK; 659 masked_status = status & INTR_MASK;
660 if (!status) { /* irq sharing? */ 660 if (!masked_status) { /* irq sharing? */
661 spin_unlock(&ehci->lock); 661 spin_unlock(&ehci->lock);
662 return IRQ_NONE; 662 return IRQ_NONE;
663 } 663 }
664 664
665 /* clear (just) interrupts */ 665 /* clear (just) interrupts */
666 ehci_writel(ehci, status, &ehci->regs->status); 666 ehci_writel(ehci, masked_status, &ehci->regs->status);
667 cmd = ehci_readl(ehci, &ehci->regs->command); 667 cmd = ehci_readl(ehci, &ehci->regs->command);
668 bh = 0; 668 bh = 0;
669 669
@@ -734,18 +734,17 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
734 734
735 /* PCI errors [4.15.2.4] */ 735 /* PCI errors [4.15.2.4] */
736 if (unlikely ((status & STS_FATAL) != 0)) { 736 if (unlikely ((status & STS_FATAL) != 0)) {
737 ehci_err(ehci, "fatal error\n");
737 dbg_cmd(ehci, "fatal", cmd); 738 dbg_cmd(ehci, "fatal", cmd);
738 dbg_status(ehci, "fatal", status); 739 dbg_status(ehci, "fatal", status);
739 if (status & STS_HALT) { 740 ehci_halt(ehci);
740 ehci_err (ehci, "fatal error\n");
741dead: 741dead:
742 ehci_reset (ehci); 742 ehci_reset(ehci);
743 ehci_writel(ehci, 0, &ehci->regs->configured_flag); 743 ehci_writel(ehci, 0, &ehci->regs->configured_flag);
744 /* generic layer kills/unlinks all urbs, then 744 /* generic layer kills/unlinks all urbs, then
745 * uses ehci_stop to clean up the rest 745 * uses ehci_stop to clean up the rest
746 */ 746 */
747 bh = 1; 747 bh = 1;
748 }
749 } 748 }
750 749
751 if (bh) 750 if (bh)
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 0eba894bcb01..9c9da35abc6c 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -205,6 +205,7 @@ static int ps3_ehci_remove(struct ps3_system_bus_device *dev)
205 205
206 tmp = hcd->irq; 206 tmp = hcd->irq;
207 207
208 ehci_shutdown(hcd);
208 usb_remove_hcd(hcd); 209 usb_remove_hcd(hcd);
209 210
210 ps3_system_bus_set_driver_data(dev, NULL); 211 ps3_system_bus_set_driver_data(dev, NULL);
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 4a0c5a78b2ed..a081ee65bde6 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -918,7 +918,7 @@ iso_stream_init (
918 */ 918 */
919 stream->usecs = HS_USECS_ISO (maxp); 919 stream->usecs = HS_USECS_ISO (maxp);
920 bandwidth = stream->usecs * 8; 920 bandwidth = stream->usecs * 8;
921 bandwidth /= 1 << (interval - 1); 921 bandwidth /= interval;
922 922
923 } else { 923 } else {
924 u32 addr; 924 u32 addr;
@@ -951,7 +951,7 @@ iso_stream_init (
951 } else 951 } else
952 stream->raw_mask = smask_out [hs_transfers - 1]; 952 stream->raw_mask = smask_out [hs_transfers - 1];
953 bandwidth = stream->usecs + stream->c_usecs; 953 bandwidth = stream->usecs + stream->c_usecs;
954 bandwidth /= 1 << (interval + 2); 954 bandwidth /= interval << 3;
955 955
956 /* stream->splits gets created from raw_mask later */ 956 /* stream->splits gets created from raw_mask later */
957 stream->address = cpu_to_hc32(ehci, addr); 957 stream->address = cpu_to_hc32(ehci, addr);
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index af849f596135..b87ca7cf4b37 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -14,16 +14,16 @@
14#include "../core/hcd.h" 14#include "../core/hcd.h"
15#include "isp1760-hcd.h" 15#include "isp1760-hcd.h"
16 16
17#ifdef CONFIG_USB_ISP1760_OF 17#ifdef CONFIG_PPC_OF
18#include <linux/of.h> 18#include <linux/of.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#endif 20#endif
21 21
22#ifdef CONFIG_USB_ISP1760_PCI 22#ifdef CONFIG_PCI
23#include <linux/pci.h> 23#include <linux/pci.h>
24#endif 24#endif
25 25
26#ifdef CONFIG_USB_ISP1760_OF 26#ifdef CONFIG_PPC_OF
27static int of_isp1760_probe(struct of_device *dev, 27static int of_isp1760_probe(struct of_device *dev,
28 const struct of_device_id *match) 28 const struct of_device_id *match)
29{ 29{
@@ -128,7 +128,7 @@ static struct of_platform_driver isp1760_of_driver = {
128}; 128};
129#endif 129#endif
130 130
131#ifdef CONFIG_USB_ISP1760_PCI 131#ifdef CONFIG_PCI
132static u32 nxp_pci_io_base; 132static u32 nxp_pci_io_base;
133static u32 iolength; 133static u32 iolength;
134static u32 pci_mem_phy0; 134static u32 pci_mem_phy0;
@@ -288,28 +288,28 @@ static struct pci_driver isp1761_pci_driver = {
288 288
289static int __init isp1760_init(void) 289static int __init isp1760_init(void)
290{ 290{
291 int ret = -ENODEV; 291 int ret;
292 292
293 init_kmem_once(); 293 init_kmem_once();
294 294
295#ifdef CONFIG_USB_ISP1760_OF 295#ifdef CONFIG_PPC_OF
296 ret = of_register_platform_driver(&isp1760_of_driver); 296 ret = of_register_platform_driver(&isp1760_of_driver);
297 if (ret) { 297 if (ret) {
298 deinit_kmem_cache(); 298 deinit_kmem_cache();
299 return ret; 299 return ret;
300 } 300 }
301#endif 301#endif
302#ifdef CONFIG_USB_ISP1760_PCI 302#ifdef CONFIG_PCI
303 ret = pci_register_driver(&isp1761_pci_driver); 303 ret = pci_register_driver(&isp1761_pci_driver);
304 if (ret) 304 if (ret)
305 goto unreg_of; 305 goto unreg_of;
306#endif 306#endif
307 return ret; 307 return ret;
308 308
309#ifdef CONFIG_USB_ISP1760_PCI 309#ifdef CONFIG_PCI
310unreg_of: 310unreg_of:
311#endif 311#endif
312#ifdef CONFIG_USB_ISP1760_OF 312#ifdef CONFIG_PPC_OF
313 of_unregister_platform_driver(&isp1760_of_driver); 313 of_unregister_platform_driver(&isp1760_of_driver);
314#endif 314#endif
315 deinit_kmem_cache(); 315 deinit_kmem_cache();
@@ -319,10 +319,10 @@ module_init(isp1760_init);
319 319
320static void __exit isp1760_exit(void) 320static void __exit isp1760_exit(void)
321{ 321{
322#ifdef CONFIG_USB_ISP1760_OF 322#ifdef CONFIG_PPC_OF
323 of_unregister_platform_driver(&isp1760_of_driver); 323 of_unregister_platform_driver(&isp1760_of_driver);
324#endif 324#endif
325#ifdef CONFIG_USB_ISP1760_PCI 325#ifdef CONFIG_PCI
326 pci_unregister_driver(&isp1761_pci_driver); 326 pci_unregister_driver(&isp1761_pci_driver);
327#endif 327#endif
328 deinit_kmem_cache(); 328 deinit_kmem_cache();
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
index 2089d8a46c4b..3c1a3b5f89f1 100644
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -192,7 +192,7 @@ fail_start:
192 return result; 192 return result;
193} 193}
194 194
195static int ps3_ohci_remove (struct ps3_system_bus_device *dev) 195static int ps3_ohci_remove(struct ps3_system_bus_device *dev)
196{ 196{
197 unsigned int tmp; 197 unsigned int tmp;
198 struct usb_hcd *hcd = 198 struct usb_hcd *hcd =
@@ -205,6 +205,7 @@ static int ps3_ohci_remove (struct ps3_system_bus_device *dev)
205 205
206 tmp = hcd->irq; 206 tmp = hcd->irq;
207 207
208 ohci_shutdown(hcd);
208 usb_remove_hcd(hcd); 209 usb_remove_hcd(hcd);
209 210
210 ps3_system_bus_set_driver_data(dev, NULL); 211 ps3_system_bus_set_driver_data(dev, NULL);
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index c18d8790c410..2376f24f3c83 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -1763,11 +1763,12 @@ static void r8a66597_timer(unsigned long _r8a66597)
1763{ 1763{
1764 struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; 1764 struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597;
1765 unsigned long flags; 1765 unsigned long flags;
1766 int port;
1766 1767
1767 spin_lock_irqsave(&r8a66597->lock, flags); 1768 spin_lock_irqsave(&r8a66597->lock, flags);
1768 1769
1769 r8a66597_root_hub_control(r8a66597, 0); 1770 for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
1770 r8a66597_root_hub_control(r8a66597, 1); 1771 r8a66597_root_hub_control(r8a66597, port);
1771 1772
1772 spin_unlock_irqrestore(&r8a66597->lock, flags); 1773 spin_unlock_irqrestore(&r8a66597->lock, flags);
1773} 1774}