diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci-au1xxx.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-dbg.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci-ep93xx.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 106 | ||||
-rw-r--r-- | drivers/usb/host/ohci-hub.c | 12 | ||||
-rw-r--r-- | drivers/usb/host/ohci-lh7a404.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci-mem.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pci.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pnx4008.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-ppc-soc.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 10 | ||||
-rw-r--r-- | drivers/usb/host/ohci-q.c | 103 | ||||
-rw-r--r-- | drivers/usb/host/ohci-s3c2410.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-sa1111.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci.h | 86 |
17 files changed, 169 insertions, 226 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index b466581beb4a..f15c84ea2869 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -221,7 +221,7 @@ static const struct hc_driver ohci_at91_hc_driver = { | |||
221 | */ | 221 | */ |
222 | .start = ohci_at91_start, | 222 | .start = ohci_at91_start, |
223 | .stop = ohci_stop, | 223 | .stop = ohci_stop, |
224 | .shutdown = ohci_shutdown, | 224 | .shutdown = ohci_shutdown, |
225 | 225 | ||
226 | /* | 226 | /* |
227 | * managing i/o requests and associated device resources | 227 | * managing i/o requests and associated device resources |
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c index 24e23c5783d8..e70b2430e2a9 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c | |||
@@ -269,7 +269,7 @@ static const struct hc_driver ohci_au1xxx_hc_driver = { | |||
269 | */ | 269 | */ |
270 | .start = ohci_au1xxx_start, | 270 | .start = ohci_au1xxx_start, |
271 | .stop = ohci_stop, | 271 | .stop = ohci_stop, |
272 | .shutdown = ohci_shutdown, | 272 | .shutdown = ohci_shutdown, |
273 | 273 | ||
274 | /* | 274 | /* |
275 | * managing i/o requests and associated device resources | 275 | * managing i/o requests and associated device resources |
@@ -336,7 +336,7 @@ static int ohci_hcd_au1xxx_drv_resume(struct platform_device *dev) | |||
336 | static struct platform_driver ohci_hcd_au1xxx_driver = { | 336 | static struct platform_driver ohci_hcd_au1xxx_driver = { |
337 | .probe = ohci_hcd_au1xxx_drv_probe, | 337 | .probe = ohci_hcd_au1xxx_drv_probe, |
338 | .remove = ohci_hcd_au1xxx_drv_remove, | 338 | .remove = ohci_hcd_au1xxx_drv_remove, |
339 | .shutdown = usb_hcd_platform_shutdown, | 339 | .shutdown = usb_hcd_platform_shutdown, |
340 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ | 340 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ |
341 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ | 341 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ |
342 | .driver = { | 342 | .driver = { |
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c index 0f47a57dac28..273d5ddb72be 100644 --- a/drivers/usb/host/ohci-dbg.c +++ b/drivers/usb/host/ohci-dbg.c | |||
@@ -16,7 +16,7 @@ | |||
16 | case PIPE_CONTROL: temp = "ctrl"; break; \ | 16 | case PIPE_CONTROL: temp = "ctrl"; break; \ |
17 | case PIPE_BULK: temp = "bulk"; break; \ | 17 | case PIPE_BULK: temp = "bulk"; break; \ |
18 | case PIPE_INTERRUPT: temp = "intr"; break; \ | 18 | case PIPE_INTERRUPT: temp = "intr"; break; \ |
19 | default: temp = "isoc"; break; \ | 19 | default: temp = "isoc"; break; \ |
20 | }; temp;}) | 20 | }; temp;}) |
21 | #define pipestring(pipe) edstring(usb_pipetype(pipe)) | 21 | #define pipestring(pipe) edstring(usb_pipetype(pipe)) |
22 | 22 | ||
@@ -205,13 +205,13 @@ ohci_dump_status (struct ohci_hcd *controller, char **next, unsigned *size) | |||
205 | (temp & RH_PS_PSSC) ? " PSSC" : "", \ | 205 | (temp & RH_PS_PSSC) ? " PSSC" : "", \ |
206 | (temp & RH_PS_PESC) ? " PESC" : "", \ | 206 | (temp & RH_PS_PESC) ? " PESC" : "", \ |
207 | (temp & RH_PS_CSC) ? " CSC" : "", \ | 207 | (temp & RH_PS_CSC) ? " CSC" : "", \ |
208 | \ | 208 | \ |
209 | (temp & RH_PS_LSDA) ? " LSDA" : "", \ | 209 | (temp & RH_PS_LSDA) ? " LSDA" : "", \ |
210 | (temp & RH_PS_PPS) ? " PPS" : "", \ | 210 | (temp & RH_PS_PPS) ? " PPS" : "", \ |
211 | (temp & RH_PS_PRS) ? " PRS" : "", \ | 211 | (temp & RH_PS_PRS) ? " PRS" : "", \ |
212 | (temp & RH_PS_POCI) ? " POCI" : "", \ | 212 | (temp & RH_PS_POCI) ? " POCI" : "", \ |
213 | (temp & RH_PS_PSS) ? " PSS" : "", \ | 213 | (temp & RH_PS_PSS) ? " PSS" : "", \ |
214 | \ | 214 | \ |
215 | (temp & RH_PS_PES) ? " PES" : "", \ | 215 | (temp & RH_PS_PES) ? " PES" : "", \ |
216 | (temp & RH_PS_CCS) ? " CCS" : "" \ | 216 | (temp & RH_PS_CCS) ? " CCS" : "" \ |
217 | ); | 217 | ); |
@@ -563,7 +563,7 @@ show_periodic (struct class_device *class_dev, char *buf) | |||
563 | (info & ED_SKIP) ? " K" : "", | 563 | (info & ED_SKIP) ? " K" : "", |
564 | (ed->hwHeadP & | 564 | (ed->hwHeadP & |
565 | cpu_to_hc32(ohci, ED_H)) ? | 565 | cpu_to_hc32(ohci, ED_H)) ? |
566 | " H" : ""); | 566 | " H" : ""); |
567 | size -= temp; | 567 | size -= temp; |
568 | next += temp; | 568 | next += temp; |
569 | 569 | ||
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 1bf5e7a4e735..43ae696b2ec2 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c | |||
@@ -204,7 +204,7 @@ static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev) | |||
204 | static struct platform_driver ohci_hcd_ep93xx_driver = { | 204 | static struct platform_driver ohci_hcd_ep93xx_driver = { |
205 | .probe = ohci_hcd_ep93xx_drv_probe, | 205 | .probe = ohci_hcd_ep93xx_drv_probe, |
206 | .remove = ohci_hcd_ep93xx_drv_remove, | 206 | .remove = ohci_hcd_ep93xx_drv_remove, |
207 | .shutdown = usb_hcd_platform_shutdown, | 207 | .shutdown = usb_hcd_platform_shutdown, |
208 | #ifdef CONFIG_PM | 208 | #ifdef CONFIG_PM |
209 | .suspend = ohci_hcd_ep93xx_drv_suspend, | 209 | .suspend = ohci_hcd_ep93xx_drv_suspend, |
210 | .resume = ohci_hcd_ep93xx_drv_resume, | 210 | .resume = ohci_hcd_ep93xx_drv_resume, |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index b28a9b602066..c31f00b7ab45 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -3,77 +3,21 @@ | |||
3 | * | 3 | * |
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | 4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> |
5 | * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> |
6 | * | 6 | * |
7 | * [ Initialisation is based on Linus' ] | 7 | * [ Initialisation is based on Linus' ] |
8 | * [ uhci code and gregs ohci fragments ] | 8 | * [ uhci code and gregs ohci fragments ] |
9 | * [ (C) Copyright 1999 Linus Torvalds ] | 9 | * [ (C) Copyright 1999 Linus Torvalds ] |
10 | * [ (C) Copyright 1999 Gregory P. Smith] | 10 | * [ (C) Copyright 1999 Gregory P. Smith] |
11 | * | 11 | * |
12 | * | 12 | * |
13 | * OHCI is the main "non-Intel/VIA" standard for USB 1.1 host controller | 13 | * OHCI is the main "non-Intel/VIA" standard for USB 1.1 host controller |
14 | * interfaces (though some non-x86 Intel chips use it). It supports | 14 | * interfaces (though some non-x86 Intel chips use it). It supports |
15 | * smarter hardware than UHCI. A download link for the spec available | 15 | * smarter hardware than UHCI. A download link for the spec available |
16 | * through the http://www.usb.org website. | 16 | * through the http://www.usb.org website. |
17 | * | 17 | * |
18 | * History: | ||
19 | * | ||
20 | * 2004/03/24 LH7A404 support (Durgesh Pattamatta & Marc Singer) | ||
21 | * 2004/02/04 use generic dma_* functions instead of pci_* (dsaxena@plexity.net) | ||
22 | * 2003/02/24 show registers in sysfs (Kevin Brosius) | ||
23 | * | ||
24 | * 2002/09/03 get rid of ed hashtables, rework periodic scheduling and | ||
25 | * bandwidth accounting; if debugging, show schedules in driverfs | ||
26 | * 2002/07/19 fixes to management of ED and schedule state. | ||
27 | * 2002/06/09 SA-1111 support (Christopher Hoover) | ||
28 | * 2002/06/01 remember frame when HC won't see EDs any more; use that info | ||
29 | * to fix urb unlink races caused by interrupt latency assumptions; | ||
30 | * minor ED field and function naming updates | ||
31 | * 2002/01/18 package as a patch for 2.5.3; this should match the | ||
32 | * 2.4.17 kernel modulo some bugs being fixed. | ||
33 | * | ||
34 | * 2001/10/18 merge pmac cleanup (Benjamin Herrenschmidt) and bugfixes | ||
35 | * from post-2.4.5 patches. | ||
36 | * 2001/09/20 URB_ZERO_PACKET support; hcca_dma portability, OPTi warning | ||
37 | * 2001/09/07 match PCI PM changes, errnos from Linus' tree | ||
38 | * 2001/05/05 fork 2.4.5 version into "hcd" framework, cleanup, simplify; | ||
39 | * pbook pci quirks gone (please fix pbook pci sw!) (db) | ||
40 | * | ||
41 | * 2001/04/08 Identify version on module load (gb) | ||
42 | * 2001/03/24 td/ed hashing to remove bus_to_virt (Steve Longerbeam); | ||
43 | pci_map_single (db) | ||
44 | * 2001/03/21 td and dev/ed allocation uses new pci_pool API (db) | ||
45 | * 2001/03/07 hcca allocation uses pci_alloc_consistent (Steve Longerbeam) | ||
46 | * | ||
47 | * 2000/09/26 fixed races in removing the private portion of the urb | ||
48 | * 2000/09/07 disable bulk and control lists when unlinking the last | ||
49 | * endpoint descriptor in order to avoid unrecoverable errors on | ||
50 | * the Lucent chips. (rwc@sgi) | ||
51 | * 2000/08/29 use bandwidth claiming hooks (thanks Randy!), fix some | ||
52 | * urb unlink probs, indentation fixes | ||
53 | * 2000/08/11 various oops fixes mostly affecting iso and cleanup from | ||
54 | * device unplugs. | ||
55 | * 2000/06/28 use PCI hotplug framework, for better power management | ||
56 | * and for Cardbus support (David Brownell) | ||
57 | * 2000/earlier: fixes for NEC/Lucent chips; suspend/resume handling | ||
58 | * when the controller loses power; handle UE; cleanup; ... | ||
59 | * | ||
60 | * v5.2 1999/12/07 URB 3rd preview, | ||
61 | * v5.1 1999/11/30 URB 2nd preview, cpia, (usb-scsi) | ||
62 | * v5.0 1999/11/22 URB Technical preview, Paul Mackerras powerbook susp/resume | ||
63 | * i386: HUB, Keyboard, Mouse, Printer | ||
64 | * | ||
65 | * v4.3 1999/10/27 multiple HCs, bulk_request | ||
66 | * v4.2 1999/09/05 ISO API alpha, new dev alloc, neg Error-codes | ||
67 | * v4.1 1999/08/27 Randy Dunlap's - ISO API first impl. | ||
68 | * v4.0 1999/08/18 | ||
69 | * v3.0 1999/06/25 | ||
70 | * v2.1 1999/05/09 code clean up | ||
71 | * v2.0 1999/05/04 | ||
72 | * v1.0 1999/04/27 initial release | ||
73 | * | ||
74 | * This file is licenced under the GPL. | 18 | * This file is licenced under the GPL. |
75 | */ | 19 | */ |
76 | 20 | ||
77 | #include <linux/module.h> | 21 | #include <linux/module.h> |
78 | #include <linux/moduleparam.h> | 22 | #include <linux/moduleparam.h> |
79 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
@@ -89,7 +33,7 @@ | |||
89 | #include <linux/list.h> | 33 | #include <linux/list.h> |
90 | #include <linux/usb.h> | 34 | #include <linux/usb.h> |
91 | #include <linux/usb/otg.h> | 35 | #include <linux/usb/otg.h> |
92 | #include <linux/dma-mapping.h> | 36 | #include <linux/dma-mapping.h> |
93 | #include <linux/dmapool.h> | 37 | #include <linux/dmapool.h> |
94 | #include <linux/reboot.h> | 38 | #include <linux/reboot.h> |
95 | 39 | ||
@@ -183,11 +127,11 @@ static int ohci_urb_enqueue ( | |||
183 | int i, size = 0; | 127 | int i, size = 0; |
184 | unsigned long flags; | 128 | unsigned long flags; |
185 | int retval = 0; | 129 | int retval = 0; |
186 | 130 | ||
187 | #ifdef OHCI_VERBOSE_DEBUG | 131 | #ifdef OHCI_VERBOSE_DEBUG |
188 | urb_print (urb, "SUB", usb_pipein (pipe)); | 132 | urb_print (urb, "SUB", usb_pipein (pipe)); |
189 | #endif | 133 | #endif |
190 | 134 | ||
191 | /* every endpoint has a ed, locate and maybe (re)initialize it */ | 135 | /* every endpoint has a ed, locate and maybe (re)initialize it */ |
192 | if (! (ed = ed_get (ohci, ep, urb->dev, pipe, urb->interval))) | 136 | if (! (ed = ed_get (ohci, ep, urb->dev, pipe, urb->interval))) |
193 | return -ENOMEM; | 137 | return -ENOMEM; |
@@ -232,7 +176,7 @@ static int ohci_urb_enqueue ( | |||
232 | memset (urb_priv, 0, sizeof (urb_priv_t) + size * sizeof (struct td *)); | 176 | memset (urb_priv, 0, sizeof (urb_priv_t) + size * sizeof (struct td *)); |
233 | INIT_LIST_HEAD (&urb_priv->pending); | 177 | INIT_LIST_HEAD (&urb_priv->pending); |
234 | urb_priv->length = size; | 178 | urb_priv->length = size; |
235 | urb_priv->ed = ed; | 179 | urb_priv->ed = ed; |
236 | 180 | ||
237 | /* allocate the TDs (deferring hash chain updates) */ | 181 | /* allocate the TDs (deferring hash chain updates) */ |
238 | for (i = 0; i < size; i++) { | 182 | for (i = 0; i < size; i++) { |
@@ -242,7 +186,7 @@ static int ohci_urb_enqueue ( | |||
242 | urb_free_priv (ohci, urb_priv); | 186 | urb_free_priv (ohci, urb_priv); |
243 | return -ENOMEM; | 187 | return -ENOMEM; |
244 | } | 188 | } |
245 | } | 189 | } |
246 | 190 | ||
247 | spin_lock_irqsave (&ohci->lock, flags); | 191 | spin_lock_irqsave (&ohci->lock, flags); |
248 | 192 | ||
@@ -313,13 +257,13 @@ static int ohci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb) | |||
313 | { | 257 | { |
314 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 258 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
315 | unsigned long flags; | 259 | unsigned long flags; |
316 | 260 | ||
317 | #ifdef OHCI_VERBOSE_DEBUG | 261 | #ifdef OHCI_VERBOSE_DEBUG |
318 | urb_print (urb, "UNLINK", 1); | 262 | urb_print (urb, "UNLINK", 1); |
319 | #endif | 263 | #endif |
320 | 264 | ||
321 | spin_lock_irqsave (&ohci->lock, flags); | 265 | spin_lock_irqsave (&ohci->lock, flags); |
322 | if (HC_IS_RUNNING(hcd->state)) { | 266 | if (HC_IS_RUNNING(hcd->state)) { |
323 | urb_priv_t *urb_priv; | 267 | urb_priv_t *urb_priv; |
324 | 268 | ||
325 | /* Unless an IRQ completed the unlink while it was being | 269 | /* Unless an IRQ completed the unlink while it was being |
@@ -512,11 +456,11 @@ static int ohci_init (struct ohci_hcd *ohci) | |||
512 | 456 | ||
513 | /* Start an OHCI controller, set the BUS operational | 457 | /* Start an OHCI controller, set the BUS operational |
514 | * resets USB and controller | 458 | * resets USB and controller |
515 | * enable interrupts | 459 | * enable interrupts |
516 | */ | 460 | */ |
517 | static int ohci_run (struct ohci_hcd *ohci) | 461 | static int ohci_run (struct ohci_hcd *ohci) |
518 | { | 462 | { |
519 | u32 mask, temp; | 463 | u32 mask, temp; |
520 | int first = ohci->fminterval == 0; | 464 | int first = ohci->fminterval == 0; |
521 | struct usb_hcd *hcd = ohci_to_hcd(ohci); | 465 | struct usb_hcd *hcd = ohci_to_hcd(ohci); |
522 | 466 | ||
@@ -534,7 +478,7 @@ static int ohci_run (struct ohci_hcd *ohci) | |||
534 | /* also: power/overcurrent flags in roothub.a */ | 478 | /* also: power/overcurrent flags in roothub.a */ |
535 | } | 479 | } |
536 | 480 | ||
537 | /* Reset USB nearly "by the book". RemoteWakeupConnected was | 481 | /* Reset USB nearly "by the book". RemoteWakeupConnected was |
538 | * saved if boot firmware (BIOS/SMM/...) told us it's connected, | 482 | * saved if boot firmware (BIOS/SMM/...) told us it's connected, |
539 | * or if bus glue did the same (e.g. for PCI add-in cards with | 483 | * or if bus glue did the same (e.g. for PCI add-in cards with |
540 | * PCI PM support). | 484 | * PCI PM support). |
@@ -765,9 +709,9 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd) | |||
765 | dl_done_list (ohci); | 709 | dl_done_list (ohci); |
766 | spin_unlock (&ohci->lock); | 710 | spin_unlock (&ohci->lock); |
767 | if (HC_IS_RUNNING(hcd->state)) | 711 | if (HC_IS_RUNNING(hcd->state)) |
768 | ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrenable); | 712 | ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrenable); |
769 | } | 713 | } |
770 | 714 | ||
771 | /* could track INTR_SO to reduce available PCI/... bandwidth */ | 715 | /* could track INTR_SO to reduce available PCI/... bandwidth */ |
772 | 716 | ||
773 | /* handle any pending URB/ED unlinks, leaving INTR_SF enabled | 717 | /* handle any pending URB/ED unlinks, leaving INTR_SF enabled |
@@ -778,12 +722,12 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd) | |||
778 | finish_unlinks (ohci, ohci_frame_no(ohci)); | 722 | finish_unlinks (ohci, ohci_frame_no(ohci)); |
779 | if ((ints & OHCI_INTR_SF) != 0 && !ohci->ed_rm_list | 723 | if ((ints & OHCI_INTR_SF) != 0 && !ohci->ed_rm_list |
780 | && HC_IS_RUNNING(hcd->state)) | 724 | && HC_IS_RUNNING(hcd->state)) |
781 | ohci_writel (ohci, OHCI_INTR_SF, ®s->intrdisable); | 725 | ohci_writel (ohci, OHCI_INTR_SF, ®s->intrdisable); |
782 | spin_unlock (&ohci->lock); | 726 | spin_unlock (&ohci->lock); |
783 | 727 | ||
784 | if (HC_IS_RUNNING(hcd->state)) { | 728 | if (HC_IS_RUNNING(hcd->state)) { |
785 | ohci_writel (ohci, ints, ®s->intrstatus); | 729 | ohci_writel (ohci, ints, ®s->intrstatus); |
786 | ohci_writel (ohci, OHCI_INTR_MIE, ®s->intrenable); | 730 | ohci_writel (ohci, OHCI_INTR_MIE, ®s->intrenable); |
787 | // flush those writes | 731 | // flush those writes |
788 | (void) ohci_readl (ohci, &ohci->regs->control); | 732 | (void) ohci_readl (ohci, &ohci->regs->control); |
789 | } | 733 | } |
@@ -794,7 +738,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd) | |||
794 | /*-------------------------------------------------------------------------*/ | 738 | /*-------------------------------------------------------------------------*/ |
795 | 739 | ||
796 | static void ohci_stop (struct usb_hcd *hcd) | 740 | static void ohci_stop (struct usb_hcd *hcd) |
797 | { | 741 | { |
798 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 742 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
799 | 743 | ||
800 | ohci_dbg (ohci, "stop %s controller (state 0x%02x)\n", | 744 | ohci_dbg (ohci, "stop %s controller (state 0x%02x)\n", |
@@ -812,8 +756,8 @@ static void ohci_stop (struct usb_hcd *hcd) | |||
812 | remove_debug_files (ohci); | 756 | remove_debug_files (ohci); |
813 | ohci_mem_cleanup (ohci); | 757 | ohci_mem_cleanup (ohci); |
814 | if (ohci->hcca) { | 758 | if (ohci->hcca) { |
815 | dma_free_coherent (hcd->self.controller, | 759 | dma_free_coherent (hcd->self.controller, |
816 | sizeof *ohci->hcca, | 760 | sizeof *ohci->hcca, |
817 | ohci->hcca, ohci->hcca_dma); | 761 | ohci->hcca, ohci->hcca_dma); |
818 | ohci->hcca = NULL; | 762 | ohci->hcca = NULL; |
819 | ohci->hcca_dma = 0; | 763 | ohci->hcca_dma = 0; |
@@ -836,7 +780,7 @@ static int ohci_restart (struct ohci_hcd *ohci) | |||
836 | * recycle any "live" eds/tds (and urbs) right away. | 780 | * recycle any "live" eds/tds (and urbs) right away. |
837 | * later, khubd disconnect processing will recycle the other state, | 781 | * later, khubd disconnect processing will recycle the other state, |
838 | * (either as disconnect/reconnect, or maybe someday as a reset). | 782 | * (either as disconnect/reconnect, or maybe someday as a reset). |
839 | */ | 783 | */ |
840 | spin_lock_irq(&ohci->lock); | 784 | spin_lock_irq(&ohci->lock); |
841 | disable (ohci); | 785 | disable (ohci); |
842 | usb_root_hub_lost_power(ohci_to_hcd(ohci)->self.root_hub); | 786 | usb_root_hub_lost_power(ohci_to_hcd(ohci)->self.root_hub); |
@@ -875,11 +819,11 @@ static int ohci_restart (struct ohci_hcd *ohci) | |||
875 | /* empty the interrupt branches */ | 819 | /* empty the interrupt branches */ |
876 | for (i = 0; i < NUM_INTS; i++) ohci->load [i] = 0; | 820 | for (i = 0; i < NUM_INTS; i++) ohci->load [i] = 0; |
877 | for (i = 0; i < NUM_INTS; i++) ohci->hcca->int_table [i] = 0; | 821 | for (i = 0; i < NUM_INTS; i++) ohci->hcca->int_table [i] = 0; |
878 | 822 | ||
879 | /* no EDs to remove */ | 823 | /* no EDs to remove */ |
880 | ohci->ed_rm_list = NULL; | 824 | ohci->ed_rm_list = NULL; |
881 | 825 | ||
882 | /* empty control and bulk lists */ | 826 | /* empty control and bulk lists */ |
883 | ohci->ed_controltail = NULL; | 827 | ohci->ed_controltail = NULL; |
884 | ohci->ed_bulktail = NULL; | 828 | ohci->ed_bulktail = NULL; |
885 | 829 | ||
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 2441642cb7b4..f9748b67e5e7 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * OHCI HCD (Host Controller Driver) for USB. | 2 | * OHCI HCD (Host Controller Driver) for USB. |
3 | * | 3 | * |
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | 4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> |
5 | * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> |
6 | * | 6 | * |
7 | * This file is licenced under GPL | 7 | * This file is licenced under GPL |
8 | */ | 8 | */ |
9 | 9 | ||
@@ -23,13 +23,13 @@ | |||
23 | (temp & RH_PS_PSSC) ? " PSSC" : "", \ | 23 | (temp & RH_PS_PSSC) ? " PSSC" : "", \ |
24 | (temp & RH_PS_PESC) ? " PESC" : "", \ | 24 | (temp & RH_PS_PESC) ? " PESC" : "", \ |
25 | (temp & RH_PS_CSC) ? " CSC" : "", \ | 25 | (temp & RH_PS_CSC) ? " CSC" : "", \ |
26 | \ | 26 | \ |
27 | (temp & RH_PS_LSDA) ? " LSDA" : "", \ | 27 | (temp & RH_PS_LSDA) ? " LSDA" : "", \ |
28 | (temp & RH_PS_PPS) ? " PPS" : "", \ | 28 | (temp & RH_PS_PPS) ? " PPS" : "", \ |
29 | (temp & RH_PS_PRS) ? " PRS" : "", \ | 29 | (temp & RH_PS_PRS) ? " PRS" : "", \ |
30 | (temp & RH_PS_POCI) ? " POCI" : "", \ | 30 | (temp & RH_PS_POCI) ? " POCI" : "", \ |
31 | (temp & RH_PS_PSS) ? " PSS" : "", \ | 31 | (temp & RH_PS_PSS) ? " PSS" : "", \ |
32 | \ | 32 | \ |
33 | (temp & RH_PS_PES) ? " PES" : "", \ | 33 | (temp & RH_PS_PES) ? " PES" : "", \ |
34 | (temp & RH_PS_CCS) ? " CCS" : "" \ | 34 | (temp & RH_PS_CCS) ? " CCS" : "" \ |
35 | ); | 35 | ); |
@@ -484,7 +484,7 @@ ohci_hub_descriptor ( | |||
484 | temp = 0; | 484 | temp = 0; |
485 | if (rh & RH_A_NPS) /* no power switching? */ | 485 | if (rh & RH_A_NPS) /* no power switching? */ |
486 | temp |= 0x0002; | 486 | temp |= 0x0002; |
487 | if (rh & RH_A_PSM) /* per-port power switching? */ | 487 | if (rh & RH_A_PSM) /* per-port power switching? */ |
488 | temp |= 0x0001; | 488 | temp |= 0x0001; |
489 | if (rh & RH_A_NOCP) /* no overcurrent reporting? */ | 489 | if (rh & RH_A_NOCP) /* no overcurrent reporting? */ |
490 | temp |= 0x0010; | 490 | temp |= 0x0010; |
@@ -573,7 +573,7 @@ static inline void root_port_reset (struct ohci_hcd *ohci, unsigned port) | |||
573 | if (!(temp & RH_PS_PRS)) | 573 | if (!(temp & RH_PS_PRS)) |
574 | break; | 574 | break; |
575 | udelay (500); | 575 | udelay (500); |
576 | } | 576 | } |
577 | 577 | ||
578 | if (!(temp & RH_PS_CCS)) | 578 | if (!(temp & RH_PS_CCS)) |
579 | break; | 579 | break; |
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c index e121d97ed91c..e9807cf73a2f 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c | |||
@@ -38,7 +38,7 @@ static void lh7a404_start_hc(struct platform_device *dev) | |||
38 | CSC_PWRCNT |= CSC_PWRCNT_USBH_EN; /* Enable clock */ | 38 | CSC_PWRCNT |= CSC_PWRCNT_USBH_EN; /* Enable clock */ |
39 | udelay(1000); | 39 | udelay(1000); |
40 | USBH_CMDSTATUS = OHCI_HCR; | 40 | USBH_CMDSTATUS = OHCI_HCR; |
41 | 41 | ||
42 | printk(KERN_DEBUG __FILE__ | 42 | printk(KERN_DEBUG __FILE__ |
43 | ": Clock to USB host has been enabled \n"); | 43 | ": Clock to USB host has been enabled \n"); |
44 | } | 44 | } |
@@ -89,7 +89,7 @@ int usb_hcd_lh7a404_probe (const struct hc_driver *driver, | |||
89 | retval = -EBUSY; | 89 | retval = -EBUSY; |
90 | goto err1; | 90 | goto err1; |
91 | } | 91 | } |
92 | 92 | ||
93 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); | 93 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); |
94 | if (!hcd->regs) { | 94 | if (!hcd->regs) { |
95 | pr_debug("ioremap failed"); | 95 | pr_debug("ioremap failed"); |
@@ -174,7 +174,7 @@ static const struct hc_driver ohci_lh7a404_hc_driver = { | |||
174 | */ | 174 | */ |
175 | .start = ohci_lh7a404_start, | 175 | .start = ohci_lh7a404_start, |
176 | .stop = ohci_stop, | 176 | .stop = ohci_stop, |
177 | .shutdown = ohci_shutdown, | 177 | .shutdown = ohci_shutdown, |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * managing i/o requests and associated device resources | 180 | * managing i/o requests and associated device resources |
@@ -242,7 +242,7 @@ static int ohci_hcd_lh7a404_drv_resume(struct platform_device *dev) | |||
242 | static struct platform_driver ohci_hcd_lh7a404_driver = { | 242 | static struct platform_driver ohci_hcd_lh7a404_driver = { |
243 | .probe = ohci_hcd_lh7a404_drv_probe, | 243 | .probe = ohci_hcd_lh7a404_drv_probe, |
244 | .remove = ohci_hcd_lh7a404_drv_remove, | 244 | .remove = ohci_hcd_lh7a404_drv_remove, |
245 | .shutdown = usb_hcd_platform_shutdown, | 245 | .shutdown = usb_hcd_platform_shutdown, |
246 | /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ | 246 | /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ |
247 | /*.resume = ohci_hcd_lh7a404_drv_resume, */ | 247 | /*.resume = ohci_hcd_lh7a404_drv_resume, */ |
248 | .driver = { | 248 | .driver = { |
diff --git a/drivers/usb/host/ohci-mem.c b/drivers/usb/host/ohci-mem.c index d976614eebd3..2f20d3dc895b 100644 --- a/drivers/usb/host/ohci-mem.c +++ b/drivers/usb/host/ohci-mem.c | |||
@@ -1,24 +1,24 @@ | |||
1 | /* | 1 | /* |
2 | * OHCI HCD (Host Controller Driver) for USB. | 2 | * OHCI HCD (Host Controller Driver) for USB. |
3 | * | 3 | * |
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | 4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> |
5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> |
6 | * | 6 | * |
7 | * This file is licenced under the GPL. | 7 | * This file is licenced under the GPL. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | /*-------------------------------------------------------------------------*/ | 10 | /*-------------------------------------------------------------------------*/ |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * There's basically three types of memory: | 13 | * OHCI deals with three types of memory: |
14 | * - data used only by the HCD ... kmalloc is fine | 14 | * - data used only by the HCD ... kmalloc is fine |
15 | * - async and periodic schedules, shared by HC and HCD ... these | 15 | * - async and periodic schedules, shared by HC and HCD ... these |
16 | * need to use dma_pool or dma_alloc_coherent | 16 | * need to use dma_pool or dma_alloc_coherent |
17 | * - driver buffers, read/written by HC ... the hcd glue or the | 17 | * - driver buffers, read/written by HC ... the hcd glue or the |
18 | * device driver provides us with dma addresses | 18 | * device driver provides us with dma addresses |
19 | * | 19 | * |
20 | * There's also PCI "register" data, which is memory mapped. | 20 | * There's also "register" data, which is memory mapped. |
21 | * No memory seen by this driver is pagable. | 21 | * No memory seen by this driver (or any HCD) may be paged out. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /*-------------------------------------------------------------------------*/ | 24 | /*-------------------------------------------------------------------------*/ |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 9c02177de50a..27be1f936885 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -447,7 +447,7 @@ static const struct hc_driver ohci_omap_hc_driver = { | |||
447 | .reset = ohci_omap_init, | 447 | .reset = ohci_omap_init, |
448 | .start = ohci_omap_start, | 448 | .start = ohci_omap_start, |
449 | .stop = ohci_omap_stop, | 449 | .stop = ohci_omap_stop, |
450 | .shutdown = ohci_shutdown, | 450 | .shutdown = ohci_shutdown, |
451 | 451 | ||
452 | /* | 452 | /* |
453 | * managing i/o requests and associated device resources | 453 | * managing i/o requests and associated device resources |
@@ -533,7 +533,7 @@ static int ohci_omap_resume(struct platform_device *dev) | |||
533 | static struct platform_driver ohci_hcd_omap_driver = { | 533 | static struct platform_driver ohci_hcd_omap_driver = { |
534 | .probe = ohci_hcd_omap_drv_probe, | 534 | .probe = ohci_hcd_omap_drv_probe, |
535 | .remove = ohci_hcd_omap_drv_remove, | 535 | .remove = ohci_hcd_omap_drv_remove, |
536 | .shutdown = usb_hcd_platform_shutdown, | 536 | .shutdown = usb_hcd_platform_shutdown, |
537 | #ifdef CONFIG_PM | 537 | #ifdef CONFIG_PM |
538 | .suspend = ohci_omap_suspend, | 538 | .suspend = ohci_omap_suspend, |
539 | .resume = ohci_omap_resume, | 539 | .resume = ohci_omap_resume, |
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 874418552789..596e0b41e606 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -3,17 +3,17 @@ | |||
3 | * | 3 | * |
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | 4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> |
5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> |
6 | * | 6 | * |
7 | * [ Initialisation is based on Linus' ] | 7 | * [ Initialisation is based on Linus' ] |
8 | * [ uhci code and gregs ohci fragments ] | 8 | * [ uhci code and gregs ohci fragments ] |
9 | * [ (C) Copyright 1999 Linus Torvalds ] | 9 | * [ (C) Copyright 1999 Linus Torvalds ] |
10 | * [ (C) Copyright 1999 Gregory P. Smith] | 10 | * [ (C) Copyright 1999 Gregory P. Smith] |
11 | * | 11 | * |
12 | * PCI Bus Glue | 12 | * PCI Bus Glue |
13 | * | 13 | * |
14 | * This file is licenced under the GPL. | 14 | * This file is licenced under the GPL. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef CONFIG_PCI | 17 | #ifndef CONFIG_PCI |
18 | #error "This file is PCI bus glue. CONFIG_PCI must be defined." | 18 | #error "This file is PCI bus glue. CONFIG_PCI must be defined." |
19 | #endif | 19 | #endif |
@@ -83,7 +83,7 @@ ohci_pci_start (struct usb_hcd *hcd) | |||
83 | pci_dev_put(b); | 83 | pci_dev_put(b); |
84 | } | 84 | } |
85 | 85 | ||
86 | /* Check for Compaq's ZFMicro chipset, which needs short | 86 | /* Check for Compaq's ZFMicro chipset, which needs short |
87 | * delays before control or bulk queues get re-activated | 87 | * delays before control or bulk queues get re-activated |
88 | * in finish_unlinks() | 88 | * in finish_unlinks() |
89 | */ | 89 | */ |
@@ -238,8 +238,8 @@ static struct pci_driver ohci_pci_driver = { | |||
238 | .shutdown = usb_hcd_pci_shutdown, | 238 | .shutdown = usb_hcd_pci_shutdown, |
239 | }; | 239 | }; |
240 | 240 | ||
241 | 241 | ||
242 | static int __init ohci_hcd_pci_init (void) | 242 | static int __init ohci_hcd_pci_init (void) |
243 | { | 243 | { |
244 | printk (KERN_DEBUG "%s: " DRIVER_INFO " (PCI)\n", hcd_name); | 244 | printk (KERN_DEBUG "%s: " DRIVER_INFO " (PCI)\n", hcd_name); |
245 | if (usb_disabled()) | 245 | if (usb_disabled()) |
@@ -253,8 +253,8 @@ module_init (ohci_hcd_pci_init); | |||
253 | 253 | ||
254 | /*-------------------------------------------------------------------------*/ | 254 | /*-------------------------------------------------------------------------*/ |
255 | 255 | ||
256 | static void __exit ohci_hcd_pci_cleanup (void) | 256 | static void __exit ohci_hcd_pci_cleanup (void) |
257 | { | 257 | { |
258 | pci_unregister_driver (&ohci_pci_driver); | 258 | pci_unregister_driver (&ohci_pci_driver); |
259 | } | 259 | } |
260 | module_exit (ohci_hcd_pci_cleanup); | 260 | module_exit (ohci_hcd_pci_cleanup); |
diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c index 7f26f9bdbaf1..3a8cbfb69054 100644 --- a/drivers/usb/host/ohci-pnx4008.c +++ b/drivers/usb/host/ohci-pnx4008.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * driver for Philips PNX4008 USB Host | 4 | * driver for Philips PNX4008 USB Host |
5 | * | 5 | * |
6 | * Authors: Dmitry Chigirev <source@mvista.com> | 6 | * Authors: Dmitry Chigirev <source@mvista.com> |
7 | * Vitaly Wool <vitalywool@gmail.com> | 7 | * Vitaly Wool <vitalywool@gmail.com> |
8 | * | 8 | * |
9 | * register initialization is based on code examples provided by Philips | 9 | * register initialization is based on code examples provided by Philips |
10 | * Copyright (c) 2005 Koninklijke Philips Electronics N.V. | 10 | * Copyright (c) 2005 Koninklijke Philips Electronics N.V. |
@@ -29,7 +29,7 @@ | |||
29 | #include <asm/arch/irqs.h> | 29 | #include <asm/arch/irqs.h> |
30 | #include <asm/arch/gpio.h> | 30 | #include <asm/arch/gpio.h> |
31 | 31 | ||
32 | #define USB_CTRL IO_ADDRESS(PNX4008_PWRMAN_BASE + 0x64) | 32 | #define USB_CTRL IO_ADDRESS(PNX4008_PWRMAN_BASE + 0x64) |
33 | 33 | ||
34 | /* USB_CTRL bit defines */ | 34 | /* USB_CTRL bit defines */ |
35 | #define USB_SLAVE_HCLK_EN (1 << 24) | 35 | #define USB_SLAVE_HCLK_EN (1 << 24) |
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c index d9d1ae236bd5..e1a7eb817313 100644 --- a/drivers/usb/host/ohci-ppc-soc.c +++ b/drivers/usb/host/ohci-ppc-soc.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> |
6 | * (C) Copyright 2002 Hewlett-Packard Company | 6 | * (C) Copyright 2002 Hewlett-Packard Company |
7 | * (C) Copyright 2003-2005 MontaVista Software Inc. | 7 | * (C) Copyright 2003-2005 MontaVista Software Inc. |
8 | * | 8 | * |
9 | * Bus Glue for PPC On-Chip OHCI driver | 9 | * Bus Glue for PPC On-Chip OHCI driver |
10 | * Tested on Freescale MPC5200 and IBM STB04xxx | 10 | * Tested on Freescale MPC5200 and IBM STB04xxx |
11 | * | 11 | * |
@@ -85,7 +85,7 @@ static int usb_hcd_ppc_soc_probe(const struct hc_driver *driver, | |||
85 | err2: | 85 | err2: |
86 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | 86 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
87 | err1: | 87 | err1: |
88 | usb_put_hcd(hcd); | 88 | usb_put_hcd(hcd); |
89 | return retval; | 89 | return retval; |
90 | } | 90 | } |
91 | 91 | ||
@@ -148,7 +148,7 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = { | |||
148 | */ | 148 | */ |
149 | .start = ohci_ppc_soc_start, | 149 | .start = ohci_ppc_soc_start, |
150 | .stop = ohci_stop, | 150 | .stop = ohci_stop, |
151 | .shutdown = ohci_shutdown, | 151 | .shutdown = ohci_shutdown, |
152 | 152 | ||
153 | /* | 153 | /* |
154 | * managing i/o requests and associated device resources | 154 | * managing i/o requests and associated device resources |
@@ -197,7 +197,7 @@ static int ohci_hcd_ppc_soc_drv_remove(struct platform_device *pdev) | |||
197 | static struct platform_driver ohci_hcd_ppc_soc_driver = { | 197 | static struct platform_driver ohci_hcd_ppc_soc_driver = { |
198 | .probe = ohci_hcd_ppc_soc_drv_probe, | 198 | .probe = ohci_hcd_ppc_soc_drv_probe, |
199 | .remove = ohci_hcd_ppc_soc_drv_remove, | 199 | .remove = ohci_hcd_ppc_soc_drv_remove, |
200 | .shutdown = usb_hcd_platform_shutdown, | 200 | .shutdown = usb_hcd_platform_shutdown, |
201 | #ifdef CONFIG_PM | 201 | #ifdef CONFIG_PM |
202 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ | 202 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ |
203 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ | 203 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index e176b04d7aeb..3bbea844a9e3 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -47,7 +47,7 @@ static int pxa27x_ohci_select_pmm( int mode ) | |||
47 | switch ( mode ) { | 47 | switch ( mode ) { |
48 | case PMM_NPS_MODE: | 48 | case PMM_NPS_MODE: |
49 | UHCRHDA |= RH_A_NPS; | 49 | UHCRHDA |= RH_A_NPS; |
50 | break; | 50 | break; |
51 | case PMM_GLOBAL_MODE: | 51 | case PMM_GLOBAL_MODE: |
52 | UHCRHDA &= ~(RH_A_NPS & RH_A_PSM); | 52 | UHCRHDA &= ~(RH_A_NPS & RH_A_PSM); |
53 | break; | 53 | break; |
@@ -60,7 +60,7 @@ static int pxa27x_ohci_select_pmm( int mode ) | |||
60 | break; | 60 | break; |
61 | default: | 61 | default: |
62 | printk( KERN_ERR | 62 | printk( KERN_ERR |
63 | "Invalid mode %d, set to non-power switch mode.\n", | 63 | "Invalid mode %d, set to non-power switch mode.\n", |
64 | mode ); | 64 | mode ); |
65 | 65 | ||
66 | UHCRHDA |= RH_A_NPS; | 66 | UHCRHDA |= RH_A_NPS; |
@@ -270,7 +270,7 @@ static const struct hc_driver ohci_pxa27x_hc_driver = { | |||
270 | */ | 270 | */ |
271 | .start = ohci_pxa27x_start, | 271 | .start = ohci_pxa27x_start, |
272 | .stop = ohci_stop, | 272 | .stop = ohci_stop, |
273 | .shutdown = ohci_shutdown, | 273 | .shutdown = ohci_shutdown, |
274 | 274 | ||
275 | /* | 275 | /* |
276 | * managing i/o requests and associated device resources | 276 | * managing i/o requests and associated device resources |
@@ -359,9 +359,9 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) | |||
359 | static struct platform_driver ohci_hcd_pxa27x_driver = { | 359 | static struct platform_driver ohci_hcd_pxa27x_driver = { |
360 | .probe = ohci_hcd_pxa27x_drv_probe, | 360 | .probe = ohci_hcd_pxa27x_drv_probe, |
361 | .remove = ohci_hcd_pxa27x_drv_remove, | 361 | .remove = ohci_hcd_pxa27x_drv_remove, |
362 | .shutdown = usb_hcd_platform_shutdown, | 362 | .shutdown = usb_hcd_platform_shutdown, |
363 | #ifdef CONFIG_PM | 363 | #ifdef CONFIG_PM |
364 | .suspend = ohci_hcd_pxa27x_drv_suspend, | 364 | .suspend = ohci_hcd_pxa27x_drv_suspend, |
365 | .resume = ohci_hcd_pxa27x_drv_resume, | 365 | .resume = ohci_hcd_pxa27x_drv_resume, |
366 | #endif | 366 | #endif |
367 | .driver = { | 367 | .driver = { |
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index fe1fe2f97cb5..830a3fe8615e 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * OHCI HCD (Host Controller Driver) for USB. | 2 | * OHCI HCD (Host Controller Driver) for USB. |
3 | * | 3 | * |
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | 4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> |
5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> |
6 | * | 6 | * |
7 | * This file is licenced under the GPL. | 7 | * This file is licenced under the GPL. |
8 | */ | 8 | */ |
9 | 9 | ||
@@ -89,7 +89,7 @@ __acquires(ohci->lock) | |||
89 | 89 | ||
90 | /*-------------------------------------------------------------------------* | 90 | /*-------------------------------------------------------------------------* |
91 | * ED handling functions | 91 | * ED handling functions |
92 | *-------------------------------------------------------------------------*/ | 92 | *-------------------------------------------------------------------------*/ |
93 | 93 | ||
94 | /* search for the right schedule branch to use for a periodic ed. | 94 | /* search for the right schedule branch to use for a periodic ed. |
95 | * does some load balancing; returns the branch, or negative errno. | 95 | * does some load balancing; returns the branch, or negative errno. |
@@ -107,7 +107,6 @@ static int balance (struct ohci_hcd *ohci, int interval, int load) | |||
107 | */ | 107 | */ |
108 | for (i = 0; i < interval ; i++) { | 108 | for (i = 0; i < interval ; i++) { |
109 | if (branch < 0 || ohci->load [branch] > ohci->load [i]) { | 109 | if (branch < 0 || ohci->load [branch] > ohci->load [i]) { |
110 | #if 1 /* CONFIG_USB_BANDWIDTH */ | ||
111 | int j; | 110 | int j; |
112 | 111 | ||
113 | /* usb 1.1 says 90% of one frame */ | 112 | /* usb 1.1 says 90% of one frame */ |
@@ -117,8 +116,7 @@ static int balance (struct ohci_hcd *ohci, int interval, int load) | |||
117 | } | 116 | } |
118 | if (j < NUM_INTS) | 117 | if (j < NUM_INTS) |
119 | continue; | 118 | continue; |
120 | #endif | 119 | branch = i; |
121 | branch = i; | ||
122 | } | 120 | } |
123 | } | 121 | } |
124 | return branch; | 122 | return branch; |
@@ -171,7 +169,7 @@ static void periodic_link (struct ohci_hcd *ohci, struct ed *ed) | |||
171 | /* link an ed into one of the HC chains */ | 169 | /* link an ed into one of the HC chains */ |
172 | 170 | ||
173 | static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) | 171 | static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) |
174 | { | 172 | { |
175 | int branch; | 173 | int branch; |
176 | 174 | ||
177 | if (ohci_to_hcd(ohci)->state == HC_STATE_QUIESCING) | 175 | if (ohci_to_hcd(ohci)->state == HC_STATE_QUIESCING) |
@@ -248,7 +246,7 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) | |||
248 | } | 246 | } |
249 | ed->branch = branch; | 247 | ed->branch = branch; |
250 | periodic_link (ohci, ed); | 248 | periodic_link (ohci, ed); |
251 | } | 249 | } |
252 | 250 | ||
253 | /* the HC may not see the schedule updates yet, but if it does | 251 | /* the HC may not see the schedule updates yet, but if it does |
254 | * then they'll be properly ordered. | 252 | * then they'll be properly ordered. |
@@ -277,7 +275,7 @@ static void periodic_unlink (struct ohci_hcd *ohci, struct ed *ed) | |||
277 | *prev = ed->ed_next; | 275 | *prev = ed->ed_next; |
278 | } | 276 | } |
279 | ohci->load [i] -= ed->load; | 277 | ohci->load [i] -= ed->load; |
280 | } | 278 | } |
281 | ohci_to_hcd(ohci)->self.bandwidth_allocated -= ed->load / ed->interval; | 279 | ohci_to_hcd(ohci)->self.bandwidth_allocated -= ed->load / ed->interval; |
282 | 280 | ||
283 | ohci_vdbg (ohci, "unlink %sed %p branch %d [%dus.], interval %d\n", | 281 | ohci_vdbg (ohci, "unlink %sed %p branch %d [%dus.], interval %d\n", |
@@ -285,7 +283,7 @@ static void periodic_unlink (struct ohci_hcd *ohci, struct ed *ed) | |||
285 | ed, ed->branch, ed->load, ed->interval); | 283 | ed, ed->branch, ed->load, ed->interval); |
286 | } | 284 | } |
287 | 285 | ||
288 | /* unlink an ed from one of the HC chains. | 286 | /* unlink an ed from one of the HC chains. |
289 | * just the link to the ed is unlinked. | 287 | * just the link to the ed is unlinked. |
290 | * the link from the ed still points to another operational ed or 0 | 288 | * the link from the ed still points to another operational ed or 0 |
291 | * so the HC can eventually finish the processing of the unlinked ed | 289 | * so the HC can eventually finish the processing of the unlinked ed |
@@ -307,7 +305,7 @@ static void periodic_unlink (struct ohci_hcd *ohci, struct ed *ed) | |||
307 | * When finish_unlinks() runs later, after SOF interrupt, it will often | 305 | * When finish_unlinks() runs later, after SOF interrupt, it will often |
308 | * complete one or more URB unlinks before making that state change. | 306 | * complete one or more URB unlinks before making that state change. |
309 | */ | 307 | */ |
310 | static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed) | 308 | static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed) |
311 | { | 309 | { |
312 | ed->hwINFO |= cpu_to_hc32 (ohci, ED_SKIP); | 310 | ed->hwINFO |= cpu_to_hc32 (ohci, ED_SKIP); |
313 | wmb (); | 311 | wmb (); |
@@ -397,7 +395,7 @@ static struct ed *ed_get ( | |||
397 | unsigned int pipe, | 395 | unsigned int pipe, |
398 | int interval | 396 | int interval |
399 | ) { | 397 | ) { |
400 | struct ed *ed; | 398 | struct ed *ed; |
401 | unsigned long flags; | 399 | unsigned long flags; |
402 | 400 | ||
403 | spin_lock_irqsave (&ohci->lock, flags); | 401 | spin_lock_irqsave (&ohci->lock, flags); |
@@ -413,9 +411,9 @@ static struct ed *ed_get ( | |||
413 | goto done; | 411 | goto done; |
414 | } | 412 | } |
415 | 413 | ||
416 | /* dummy td; end of td list for ed */ | 414 | /* dummy td; end of td list for ed */ |
417 | td = td_alloc (ohci, GFP_ATOMIC); | 415 | td = td_alloc (ohci, GFP_ATOMIC); |
418 | if (!td) { | 416 | if (!td) { |
419 | /* out of memory */ | 417 | /* out of memory */ |
420 | ed_free (ohci, ed); | 418 | ed_free (ohci, ed); |
421 | ed = NULL; | 419 | ed = NULL; |
@@ -462,7 +460,7 @@ static struct ed *ed_get ( | |||
462 | 460 | ||
463 | done: | 461 | done: |
464 | spin_unlock_irqrestore (&ohci->lock, flags); | 462 | spin_unlock_irqrestore (&ohci->lock, flags); |
465 | return ed; | 463 | return ed; |
466 | } | 464 | } |
467 | 465 | ||
468 | /*-------------------------------------------------------------------------*/ | 466 | /*-------------------------------------------------------------------------*/ |
@@ -474,7 +472,7 @@ done: | |||
474 | * and that ed->state is ED_OPER | 472 | * and that ed->state is ED_OPER |
475 | */ | 473 | */ |
476 | static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed) | 474 | static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed) |
477 | { | 475 | { |
478 | ed->hwINFO |= cpu_to_hc32 (ohci, ED_DEQUEUE); | 476 | ed->hwINFO |= cpu_to_hc32 (ohci, ED_DEQUEUE); |
479 | ed_deschedule (ohci, ed); | 477 | ed_deschedule (ohci, ed); |
480 | 478 | ||
@@ -541,7 +539,7 @@ td_fill (struct ohci_hcd *ohci, u32 info, | |||
541 | td->ed = urb_priv->ed; | 539 | td->ed = urb_priv->ed; |
542 | td->next_dl_td = NULL; | 540 | td->next_dl_td = NULL; |
543 | td->index = index; | 541 | td->index = index; |
544 | td->urb = urb; | 542 | td->urb = urb; |
545 | td->data_dma = data; | 543 | td->data_dma = data; |
546 | if (!len) | 544 | if (!len) |
547 | data = 0; | 545 | data = 0; |
@@ -553,8 +551,8 @@ td_fill (struct ohci_hcd *ohci, u32 info, | |||
553 | (data & 0x0FFF) | 0xE000); | 551 | (data & 0x0FFF) | 0xE000); |
554 | td->ed->last_iso = info & 0xffff; | 552 | td->ed->last_iso = info & 0xffff; |
555 | } else { | 553 | } else { |
556 | td->hwCBP = cpu_to_hc32 (ohci, data); | 554 | td->hwCBP = cpu_to_hc32 (ohci, data); |
557 | } | 555 | } |
558 | if (data) | 556 | if (data) |
559 | td->hwBE = cpu_to_hc32 (ohci, data + len - 1); | 557 | td->hwBE = cpu_to_hc32 (ohci, data + len - 1); |
560 | else | 558 | else |
@@ -597,7 +595,7 @@ static void td_submit_urb ( | |||
597 | * use the device toggle bits for resetting, and rely on the fact | 595 | * use the device toggle bits for resetting, and rely on the fact |
598 | * that resetting toggle is meaningless if the endpoint is active. | 596 | * that resetting toggle is meaningless if the endpoint is active. |
599 | */ | 597 | */ |
600 | if (!usb_gettoggle (urb->dev, usb_pipeendpoint (urb->pipe), is_out)) { | 598 | if (!usb_gettoggle (urb->dev, usb_pipeendpoint (urb->pipe), is_out)) { |
601 | usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), | 599 | usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), |
602 | is_out, 1); | 600 | is_out, 1); |
603 | urb_priv->ed->hwHeadP &= ~cpu_to_hc32 (ohci, ED_C); | 601 | urb_priv->ed->hwHeadP &= ~cpu_to_hc32 (ohci, ED_C); |
@@ -721,16 +719,16 @@ static void td_done (struct ohci_hcd *ohci, struct urb *urb, struct td *td) | |||
721 | list_del (&td->td_list); | 719 | list_del (&td->td_list); |
722 | 720 | ||
723 | /* ISO ... drivers see per-TD length/status */ | 721 | /* ISO ... drivers see per-TD length/status */ |
724 | if (tdINFO & TD_ISO) { | 722 | if (tdINFO & TD_ISO) { |
725 | u16 tdPSW = ohci_hwPSW (ohci, td, 0); | 723 | u16 tdPSW = ohci_hwPSW (ohci, td, 0); |
726 | int dlen = 0; | 724 | int dlen = 0; |
727 | 725 | ||
728 | /* NOTE: assumes FC in tdINFO == 0, and that | 726 | /* NOTE: assumes FC in tdINFO == 0, and that |
729 | * only the first of 0..MAXPSW psws is used. | 727 | * only the first of 0..MAXPSW psws is used. |
730 | */ | 728 | */ |
731 | 729 | ||
732 | cc = (tdPSW >> 12) & 0xF; | 730 | cc = (tdPSW >> 12) & 0xF; |
733 | if (tdINFO & TD_CC) /* hc didn't touch? */ | 731 | if (tdINFO & TD_CC) /* hc didn't touch? */ |
734 | return; | 732 | return; |
735 | 733 | ||
736 | if (usb_pipeout (urb->pipe)) | 734 | if (usb_pipeout (urb->pipe)) |
@@ -758,7 +756,7 @@ static void td_done (struct ohci_hcd *ohci, struct urb *urb, struct td *td) | |||
758 | int type = usb_pipetype (urb->pipe); | 756 | int type = usb_pipetype (urb->pipe); |
759 | u32 tdBE = hc32_to_cpup (ohci, &td->hwBE); | 757 | u32 tdBE = hc32_to_cpup (ohci, &td->hwBE); |
760 | 758 | ||
761 | cc = TD_CC_GET (tdINFO); | 759 | cc = TD_CC_GET (tdINFO); |
762 | 760 | ||
763 | /* update packet status if needed (short is normally ok) */ | 761 | /* update packet status if needed (short is normally ok) */ |
764 | if (cc == TD_DATAUNDERRUN | 762 | if (cc == TD_DATAUNDERRUN |
@@ -787,7 +785,7 @@ static void td_done (struct ohci_hcd *ohci, struct urb *urb, struct td *td) | |||
787 | urb, td, 1 + td->index, cc, | 785 | urb, td, 1 + td->index, cc, |
788 | urb->actual_length, | 786 | urb->actual_length, |
789 | urb->transfer_buffer_length); | 787 | urb->transfer_buffer_length); |
790 | } | 788 | } |
791 | } | 789 | } |
792 | 790 | ||
793 | /*-------------------------------------------------------------------------*/ | 791 | /*-------------------------------------------------------------------------*/ |
@@ -795,7 +793,7 @@ static void td_done (struct ohci_hcd *ohci, struct urb *urb, struct td *td) | |||
795 | static inline struct td * | 793 | static inline struct td * |
796 | ed_halted (struct ohci_hcd *ohci, struct td *td, int cc, struct td *rev) | 794 | ed_halted (struct ohci_hcd *ohci, struct td *td, int cc, struct td *rev) |
797 | { | 795 | { |
798 | struct urb *urb = td->urb; | 796 | struct urb *urb = td->urb; |
799 | struct ed *ed = td->ed; | 797 | struct ed *ed = td->ed; |
800 | struct list_head *tmp = td->td_list.next; | 798 | struct list_head *tmp = td->td_list.next; |
801 | __hc32 toggle = ed->hwHeadP & cpu_to_hc32 (ohci, ED_C); | 799 | __hc32 toggle = ed->hwHeadP & cpu_to_hc32 (ohci, ED_C); |
@@ -805,7 +803,7 @@ ed_halted (struct ohci_hcd *ohci, struct td *td, int cc, struct td *rev) | |||
805 | */ | 803 | */ |
806 | ed->hwINFO |= cpu_to_hc32 (ohci, ED_SKIP); | 804 | ed->hwINFO |= cpu_to_hc32 (ohci, ED_SKIP); |
807 | wmb (); | 805 | wmb (); |
808 | ed->hwHeadP &= ~cpu_to_hc32 (ohci, ED_H); | 806 | ed->hwHeadP &= ~cpu_to_hc32 (ohci, ED_H); |
809 | 807 | ||
810 | /* put any later tds from this urb onto the donelist, after 'td', | 808 | /* put any later tds from this urb onto the donelist, after 'td', |
811 | * order won't matter here: no errors, and nothing was transferred. | 809 | * order won't matter here: no errors, and nothing was transferred. |
@@ -833,7 +831,7 @@ ed_halted (struct ohci_hcd *ohci, struct td *td, int cc, struct td *rev) | |||
833 | info &= ~cpu_to_hc32 (ohci, TD_CC); | 831 | info &= ~cpu_to_hc32 (ohci, TD_CC); |
834 | next->hwINFO = info; | 832 | next->hwINFO = info; |
835 | 833 | ||
836 | next->next_dl_td = rev; | 834 | next->next_dl_td = rev; |
837 | rev = next; | 835 | rev = next; |
838 | 836 | ||
839 | ed->hwHeadP = next->hwNextTD | toggle; | 837 | ed->hwHeadP = next->hwNextTD | toggle; |
@@ -881,8 +879,8 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci) | |||
881 | /* get TD from hc's singly linked list, and | 879 | /* get TD from hc's singly linked list, and |
882 | * prepend to ours. ed->td_list changes later. | 880 | * prepend to ours. ed->td_list changes later. |
883 | */ | 881 | */ |
884 | while (td_dma) { | 882 | while (td_dma) { |
885 | int cc; | 883 | int cc; |
886 | 884 | ||
887 | td = dma_to_td (ohci, td_dma); | 885 | td = dma_to_td (ohci, td_dma); |
888 | if (!td) { | 886 | if (!td) { |
@@ -901,10 +899,10 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci) | |||
901 | && (td->ed->hwHeadP & cpu_to_hc32 (ohci, ED_H))) | 899 | && (td->ed->hwHeadP & cpu_to_hc32 (ohci, ED_H))) |
902 | td_rev = ed_halted (ohci, td, cc, td_rev); | 900 | td_rev = ed_halted (ohci, td, cc, td_rev); |
903 | 901 | ||
904 | td->next_dl_td = td_rev; | 902 | td->next_dl_td = td_rev; |
905 | td_rev = td; | 903 | td_rev = td; |
906 | td_dma = hc32_to_cpup (ohci, &td->hwNextTD); | 904 | td_dma = hc32_to_cpup (ohci, &td->hwNextTD); |
907 | } | 905 | } |
908 | return td_rev; | 906 | return td_rev; |
909 | } | 907 | } |
910 | 908 | ||
@@ -1013,9 +1011,9 @@ rescan_this: | |||
1013 | 1011 | ||
1014 | if (modified) | 1012 | if (modified) |
1015 | goto rescan_all; | 1013 | goto rescan_all; |
1016 | } | 1014 | } |
1017 | 1015 | ||
1018 | /* maybe reenable control and bulk lists */ | 1016 | /* maybe reenable control and bulk lists */ |
1019 | if (HC_IS_RUNNING(ohci_to_hcd(ohci)->state) | 1017 | if (HC_IS_RUNNING(ohci_to_hcd(ohci)->state) |
1020 | && ohci_to_hcd(ohci)->state != HC_STATE_QUIESCING | 1018 | && ohci_to_hcd(ohci)->state != HC_STATE_QUIESCING |
1021 | && !ohci->ed_rm_list) { | 1019 | && !ohci->ed_rm_list) { |
@@ -1041,20 +1039,20 @@ rescan_this: | |||
1041 | &ohci->regs->ed_bulkcurrent); | 1039 | &ohci->regs->ed_bulkcurrent); |
1042 | } | 1040 | } |
1043 | } | 1041 | } |
1044 | 1042 | ||
1045 | /* CLE/BLE to enable, CLF/BLF to (maybe) kickstart */ | 1043 | /* CLE/BLE to enable, CLF/BLF to (maybe) kickstart */ |
1046 | if (control) { | 1044 | if (control) { |
1047 | ohci->hc_control |= control; | 1045 | ohci->hc_control |= control; |
1048 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) | 1046 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) |
1049 | mdelay(1); | 1047 | mdelay(1); |
1050 | ohci_writel (ohci, ohci->hc_control, | 1048 | ohci_writel (ohci, ohci->hc_control, |
1051 | &ohci->regs->control); | 1049 | &ohci->regs->control); |
1052 | } | 1050 | } |
1053 | if (command) { | 1051 | if (command) { |
1054 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) | 1052 | if (ohci->flags & OHCI_QUIRK_ZFMICRO) |
1055 | mdelay(1); | 1053 | mdelay(1); |
1056 | ohci_writel (ohci, command, &ohci->regs->cmdstatus); | 1054 | ohci_writel (ohci, command, &ohci->regs->cmdstatus); |
1057 | } | 1055 | } |
1058 | } | 1056 | } |
1059 | } | 1057 | } |
1060 | 1058 | ||
@@ -1074,19 +1072,19 @@ dl_done_list (struct ohci_hcd *ohci) | |||
1074 | { | 1072 | { |
1075 | struct td *td = dl_reverse_done_list (ohci); | 1073 | struct td *td = dl_reverse_done_list (ohci); |
1076 | 1074 | ||
1077 | while (td) { | 1075 | while (td) { |
1078 | struct td *td_next = td->next_dl_td; | 1076 | struct td *td_next = td->next_dl_td; |
1079 | struct urb *urb = td->urb; | 1077 | struct urb *urb = td->urb; |
1080 | urb_priv_t *urb_priv = urb->hcpriv; | 1078 | urb_priv_t *urb_priv = urb->hcpriv; |
1081 | struct ed *ed = td->ed; | 1079 | struct ed *ed = td->ed; |
1082 | 1080 | ||
1083 | /* update URB's length and status from TD */ | 1081 | /* update URB's length and status from TD */ |
1084 | td_done (ohci, urb, td); | 1082 | td_done (ohci, urb, td); |
1085 | urb_priv->td_cnt++; | 1083 | urb_priv->td_cnt++; |
1086 | 1084 | ||
1087 | /* If all this urb's TDs are done, call complete() */ | 1085 | /* If all this urb's TDs are done, call complete() */ |
1088 | if (urb_priv->td_cnt == urb_priv->length) | 1086 | if (urb_priv->td_cnt == urb_priv->length) |
1089 | finish_urb (ohci, urb); | 1087 | finish_urb (ohci, urb); |
1090 | 1088 | ||
1091 | /* clean schedule: unlink EDs that are no longer busy */ | 1089 | /* clean schedule: unlink EDs that are no longer busy */ |
1092 | if (list_empty (&ed->td_list)) { | 1090 | if (list_empty (&ed->td_list)) { |
@@ -1094,25 +1092,26 @@ dl_done_list (struct ohci_hcd *ohci) | |||
1094 | start_ed_unlink (ohci, ed); | 1092 | start_ed_unlink (ohci, ed); |
1095 | 1093 | ||
1096 | /* ... reenabling halted EDs only after fault cleanup */ | 1094 | /* ... reenabling halted EDs only after fault cleanup */ |
1097 | } else if ((ed->hwINFO & cpu_to_hc32 (ohci, ED_SKIP | ED_DEQUEUE)) | 1095 | } else if ((ed->hwINFO & cpu_to_hc32 (ohci, |
1096 | ED_SKIP | ED_DEQUEUE)) | ||
1098 | == cpu_to_hc32 (ohci, ED_SKIP)) { | 1097 | == cpu_to_hc32 (ohci, ED_SKIP)) { |
1099 | td = list_entry (ed->td_list.next, struct td, td_list); | 1098 | td = list_entry (ed->td_list.next, struct td, td_list); |
1100 | if (!(td->hwINFO & cpu_to_hc32 (ohci, TD_DONE))) { | 1099 | if (!(td->hwINFO & cpu_to_hc32 (ohci, TD_DONE))) { |
1101 | ed->hwINFO &= ~cpu_to_hc32 (ohci, ED_SKIP); | 1100 | ed->hwINFO &= ~cpu_to_hc32 (ohci, ED_SKIP); |
1102 | /* ... hc may need waking-up */ | 1101 | /* ... hc may need waking-up */ |
1103 | switch (ed->type) { | 1102 | switch (ed->type) { |
1104 | case PIPE_CONTROL: | 1103 | case PIPE_CONTROL: |
1105 | ohci_writel (ohci, OHCI_CLF, | 1104 | ohci_writel (ohci, OHCI_CLF, |
1106 | &ohci->regs->cmdstatus); | 1105 | &ohci->regs->cmdstatus); |
1107 | break; | 1106 | break; |
1108 | case PIPE_BULK: | 1107 | case PIPE_BULK: |
1109 | ohci_writel (ohci, OHCI_BLF, | 1108 | ohci_writel (ohci, OHCI_BLF, |
1110 | &ohci->regs->cmdstatus); | 1109 | &ohci->regs->cmdstatus); |
1111 | break; | 1110 | break; |
1112 | } | 1111 | } |
1113 | } | 1112 | } |
1114 | } | 1113 | } |
1115 | 1114 | ||
1116 | td = td_next; | 1115 | td = td_next; |
1117 | } | 1116 | } |
1118 | } | 1117 | } |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 59e436424d41..b350d45033e7 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -447,7 +447,7 @@ static const struct hc_driver ohci_s3c2410_hc_driver = { | |||
447 | */ | 447 | */ |
448 | .start = ohci_s3c2410_start, | 448 | .start = ohci_s3c2410_start, |
449 | .stop = ohci_stop, | 449 | .stop = ohci_stop, |
450 | .shutdown = ohci_shutdown, | 450 | .shutdown = ohci_shutdown, |
451 | 451 | ||
452 | /* | 452 | /* |
453 | * managing i/o requests and associated device resources | 453 | * managing i/o requests and associated device resources |
@@ -492,7 +492,7 @@ static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev) | |||
492 | static struct platform_driver ohci_hcd_s3c2410_driver = { | 492 | static struct platform_driver ohci_hcd_s3c2410_driver = { |
493 | .probe = ohci_hcd_s3c2410_drv_probe, | 493 | .probe = ohci_hcd_s3c2410_drv_probe, |
494 | .remove = ohci_hcd_s3c2410_drv_remove, | 494 | .remove = ohci_hcd_s3c2410_drv_remove, |
495 | .shutdown = usb_hcd_platform_shutdown, | 495 | .shutdown = usb_hcd_platform_shutdown, |
496 | /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ | 496 | /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ |
497 | /*.resume = ohci_hcd_s3c2410_drv_resume, */ | 497 | /*.resume = ohci_hcd_s3c2410_drv_resume, */ |
498 | .driver = { | 498 | .driver = { |
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c index 71371de32ada..fe0090e33675 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | 4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> |
5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> |
6 | * (C) Copyright 2002 Hewlett-Packard Company | 6 | * (C) Copyright 2002 Hewlett-Packard Company |
7 | * | 7 | * |
8 | * SA1111 Bus Glue | 8 | * SA1111 Bus Glue |
9 | * | 9 | * |
10 | * Written by Christopher Hoover <ch@hpl.hp.com> | 10 | * Written by Christopher Hoover <ch@hpl.hp.com> |
@@ -12,7 +12,7 @@ | |||
12 | * | 12 | * |
13 | * This file is licenced under the GPL. | 13 | * This file is licenced under the GPL. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <asm/hardware.h> | 16 | #include <asm/hardware.h> |
17 | #include <asm/mach-types.h> | 17 | #include <asm/mach-types.h> |
18 | #include <asm/arch/assabet.h> | 18 | #include <asm/arch/assabet.h> |
@@ -31,7 +31,7 @@ static void sa1111_start_hc(struct sa1111_dev *dev) | |||
31 | { | 31 | { |
32 | unsigned int usb_rst = 0; | 32 | unsigned int usb_rst = 0; |
33 | 33 | ||
34 | printk(KERN_DEBUG __FILE__ | 34 | printk(KERN_DEBUG __FILE__ |
35 | ": starting SA-1111 OHCI USB Controller\n"); | 35 | ": starting SA-1111 OHCI USB Controller\n"); |
36 | 36 | ||
37 | #ifdef CONFIG_SA1100_BADGE4 | 37 | #ifdef CONFIG_SA1100_BADGE4 |
@@ -65,7 +65,7 @@ static void sa1111_start_hc(struct sa1111_dev *dev) | |||
65 | static void sa1111_stop_hc(struct sa1111_dev *dev) | 65 | static void sa1111_stop_hc(struct sa1111_dev *dev) |
66 | { | 66 | { |
67 | unsigned int usb_rst; | 67 | unsigned int usb_rst; |
68 | printk(KERN_DEBUG __FILE__ | 68 | printk(KERN_DEBUG __FILE__ |
69 | ": stopping SA-1111 OHCI USB Controller\n"); | 69 | ": stopping SA-1111 OHCI USB Controller\n"); |
70 | 70 | ||
71 | /* | 71 | /* |
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index fd93e7eca7bf..405257f3e853 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * OHCI HCD (Host Controller Driver) for USB. | 2 | * OHCI HCD (Host Controller Driver) for USB. |
3 | * | 3 | * |
4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> | 4 | * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> |
5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> | 5 | * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> |
6 | * | 6 | * |
7 | * This file is licenced under the GPL. | 7 | * This file is licenced under the GPL. |
8 | */ | 8 | */ |
9 | 9 | ||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | typedef __u32 __bitwise __hc32; | 15 | typedef __u32 __bitwise __hc32; |
16 | typedef __u16 __bitwise __hc16; | 16 | typedef __u16 __bitwise __hc16; |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * OHCI Endpoint Descriptor (ED) ... holds TD queue | 19 | * OHCI Endpoint Descriptor (ED) ... holds TD queue |
20 | * See OHCI spec, section 4.2 | 20 | * See OHCI spec, section 4.2 |
@@ -24,7 +24,7 @@ typedef __u16 __bitwise __hc16; | |||
24 | */ | 24 | */ |
25 | struct ed { | 25 | struct ed { |
26 | /* first fields are hardware-specified */ | 26 | /* first fields are hardware-specified */ |
27 | __hc32 hwINFO; /* endpoint config bitmap */ | 27 | __hc32 hwINFO; /* endpoint config bitmap */ |
28 | /* info bits defined by hcd */ | 28 | /* info bits defined by hcd */ |
29 | #define ED_DEQUEUE (1 << 27) | 29 | #define ED_DEQUEUE (1 << 27) |
30 | /* info bits defined by the hardware */ | 30 | /* info bits defined by the hardware */ |
@@ -52,11 +52,11 @@ struct ed { | |||
52 | * usually: OPER --> UNLINK --> (IDLE | OPER) --> ... | 52 | * usually: OPER --> UNLINK --> (IDLE | OPER) --> ... |
53 | */ | 53 | */ |
54 | u8 state; /* ED_{IDLE,UNLINK,OPER} */ | 54 | u8 state; /* ED_{IDLE,UNLINK,OPER} */ |
55 | #define ED_IDLE 0x00 /* NOT linked to HC */ | 55 | #define ED_IDLE 0x00 /* NOT linked to HC */ |
56 | #define ED_UNLINK 0x01 /* being unlinked from hc */ | 56 | #define ED_UNLINK 0x01 /* being unlinked from hc */ |
57 | #define ED_OPER 0x02 /* IS linked to hc */ | 57 | #define ED_OPER 0x02 /* IS linked to hc */ |
58 | 58 | ||
59 | u8 type; /* PIPE_{BULK,...} */ | 59 | u8 type; /* PIPE_{BULK,...} */ |
60 | 60 | ||
61 | /* periodic scheduling params (for intr and iso) */ | 61 | /* periodic scheduling params (for intr and iso) */ |
62 | u8 branch; | 62 | u8 branch; |
@@ -70,7 +70,7 @@ struct ed { | |||
70 | 70 | ||
71 | #define ED_MASK ((u32)~0x0f) /* strip hw status in low addr bits */ | 71 | #define ED_MASK ((u32)~0x0f) /* strip hw status in low addr bits */ |
72 | 72 | ||
73 | 73 | ||
74 | /* | 74 | /* |
75 | * OHCI Transfer Descriptor (TD) ... one per transfer segment | 75 | * OHCI Transfer Descriptor (TD) ... one per transfer segment |
76 | * See OHCI spec, sections 4.3.1 (general = control/bulk/interrupt) | 76 | * See OHCI spec, sections 4.3.1 (general = control/bulk/interrupt) |
@@ -107,22 +107,22 @@ struct td { | |||
107 | 107 | ||
108 | /* (no hwINFO #defines yet for iso tds) */ | 108 | /* (no hwINFO #defines yet for iso tds) */ |
109 | 109 | ||
110 | __hc32 hwCBP; /* Current Buffer Pointer (or 0) */ | 110 | __hc32 hwCBP; /* Current Buffer Pointer (or 0) */ |
111 | __hc32 hwNextTD; /* Next TD Pointer */ | 111 | __hc32 hwNextTD; /* Next TD Pointer */ |
112 | __hc32 hwBE; /* Memory Buffer End Pointer */ | 112 | __hc32 hwBE; /* Memory Buffer End Pointer */ |
113 | 113 | ||
114 | /* PSW is only for ISO. Only 1 PSW entry is used, but on | 114 | /* PSW is only for ISO. Only 1 PSW entry is used, but on |
115 | * big-endian PPC hardware that's the second entry. | 115 | * big-endian PPC hardware that's the second entry. |
116 | */ | 116 | */ |
117 | #define MAXPSW 2 | 117 | #define MAXPSW 2 |
118 | __hc16 hwPSW [MAXPSW]; | 118 | __hc16 hwPSW [MAXPSW]; |
119 | 119 | ||
120 | /* rest are purely for the driver's use */ | 120 | /* rest are purely for the driver's use */ |
121 | __u8 index; | 121 | __u8 index; |
122 | struct ed *ed; | 122 | struct ed *ed; |
123 | struct td *td_hash; /* dma-->td hashtable */ | 123 | struct td *td_hash; /* dma-->td hashtable */ |
124 | struct td *next_dl_td; | 124 | struct td *next_dl_td; |
125 | struct urb *urb; | 125 | struct urb *urb; |
126 | 126 | ||
127 | dma_addr_t td_dma; /* addr of this TD */ | 127 | dma_addr_t td_dma; /* addr of this TD */ |
128 | dma_addr_t data_dma; /* addr of data it points to */ | 128 | dma_addr_t data_dma; /* addr of data it points to */ |
@@ -152,8 +152,8 @@ struct td { | |||
152 | #define TD_NOTACCESSED 0x0F | 152 | #define TD_NOTACCESSED 0x0F |
153 | 153 | ||
154 | 154 | ||
155 | /* map OHCI TD status codes (CC) to errno values */ | 155 | /* map OHCI TD status codes (CC) to errno values */ |
156 | static const int cc_to_error [16] = { | 156 | static const int cc_to_error [16] = { |
157 | /* No Error */ 0, | 157 | /* No Error */ 0, |
158 | /* CRC Error */ -EILSEQ, | 158 | /* CRC Error */ -EILSEQ, |
159 | /* Bit Stuff */ -EPROTO, | 159 | /* Bit Stuff */ -EPROTO, |
@@ -169,7 +169,7 @@ static const int cc_to_error [16] = { | |||
169 | /* BufferOver */ -ECOMM, | 169 | /* BufferOver */ -ECOMM, |
170 | /* BuffUnder */ -ENOSR, | 170 | /* BuffUnder */ -ENOSR, |
171 | /* (for HCD) */ -EALREADY, | 171 | /* (for HCD) */ -EALREADY, |
172 | /* (for HCD) */ -EALREADY | 172 | /* (for HCD) */ -EALREADY |
173 | }; | 173 | }; |
174 | 174 | ||
175 | 175 | ||
@@ -182,7 +182,7 @@ struct ohci_hcca { | |||
182 | #define NUM_INTS 32 | 182 | #define NUM_INTS 32 |
183 | __hc32 int_table [NUM_INTS]; /* periodic schedule */ | 183 | __hc32 int_table [NUM_INTS]; /* periodic schedule */ |
184 | 184 | ||
185 | /* | 185 | /* |
186 | * OHCI defines u16 frame_no, followed by u16 zero pad. | 186 | * OHCI defines u16 frame_no, followed by u16 zero pad. |
187 | * Since some processors can't do 16 bit bus accesses, | 187 | * Since some processors can't do 16 bit bus accesses, |
188 | * portable access must be a 32 bits wide. | 188 | * portable access must be a 32 bits wide. |
@@ -262,10 +262,10 @@ struct ohci_regs { | |||
262 | * HcCommandStatus (cmdstatus) register masks | 262 | * HcCommandStatus (cmdstatus) register masks |
263 | */ | 263 | */ |
264 | #define OHCI_HCR (1 << 0) /* host controller reset */ | 264 | #define OHCI_HCR (1 << 0) /* host controller reset */ |
265 | #define OHCI_CLF (1 << 1) /* control list filled */ | 265 | #define OHCI_CLF (1 << 1) /* control list filled */ |
266 | #define OHCI_BLF (1 << 2) /* bulk list filled */ | 266 | #define OHCI_BLF (1 << 2) /* bulk list filled */ |
267 | #define OHCI_OCR (1 << 3) /* ownership change request */ | 267 | #define OHCI_OCR (1 << 3) /* ownership change request */ |
268 | #define OHCI_SOC (3 << 16) /* scheduling overrun count */ | 268 | #define OHCI_SOC (3 << 16) /* scheduling overrun count */ |
269 | 269 | ||
270 | /* | 270 | /* |
271 | * masks used with interrupt registers: | 271 | * masks used with interrupt registers: |
@@ -285,20 +285,20 @@ struct ohci_regs { | |||
285 | 285 | ||
286 | 286 | ||
287 | /* OHCI ROOT HUB REGISTER MASKS */ | 287 | /* OHCI ROOT HUB REGISTER MASKS */ |
288 | 288 | ||
289 | /* roothub.portstatus [i] bits */ | 289 | /* roothub.portstatus [i] bits */ |
290 | #define RH_PS_CCS 0x00000001 /* current connect status */ | 290 | #define RH_PS_CCS 0x00000001 /* current connect status */ |
291 | #define RH_PS_PES 0x00000002 /* port enable status*/ | 291 | #define RH_PS_PES 0x00000002 /* port enable status*/ |
292 | #define RH_PS_PSS 0x00000004 /* port suspend status */ | 292 | #define RH_PS_PSS 0x00000004 /* port suspend status */ |
293 | #define RH_PS_POCI 0x00000008 /* port over current indicator */ | 293 | #define RH_PS_POCI 0x00000008 /* port over current indicator */ |
294 | #define RH_PS_PRS 0x00000010 /* port reset status */ | 294 | #define RH_PS_PRS 0x00000010 /* port reset status */ |
295 | #define RH_PS_PPS 0x00000100 /* port power status */ | 295 | #define RH_PS_PPS 0x00000100 /* port power status */ |
296 | #define RH_PS_LSDA 0x00000200 /* low speed device attached */ | 296 | #define RH_PS_LSDA 0x00000200 /* low speed device attached */ |
297 | #define RH_PS_CSC 0x00010000 /* connect status change */ | 297 | #define RH_PS_CSC 0x00010000 /* connect status change */ |
298 | #define RH_PS_PESC 0x00020000 /* port enable status change */ | 298 | #define RH_PS_PESC 0x00020000 /* port enable status change */ |
299 | #define RH_PS_PSSC 0x00040000 /* port suspend status change */ | 299 | #define RH_PS_PSSC 0x00040000 /* port suspend status change */ |
300 | #define RH_PS_OCIC 0x00080000 /* over current indicator change */ | 300 | #define RH_PS_OCIC 0x00080000 /* over current indicator change */ |
301 | #define RH_PS_PRSC 0x00100000 /* port reset status change */ | 301 | #define RH_PS_PRSC 0x00100000 /* port reset status change */ |
302 | 302 | ||
303 | /* roothub.status bits */ | 303 | /* roothub.status bits */ |
304 | #define RH_HS_LPS 0x00000001 /* local power status */ | 304 | #define RH_HS_LPS 0x00000001 /* local power status */ |
@@ -333,7 +333,7 @@ typedef struct urb_priv { | |||
333 | } urb_priv_t; | 333 | } urb_priv_t; |
334 | 334 | ||
335 | #define TD_HASH_SIZE 64 /* power'o'two */ | 335 | #define TD_HASH_SIZE 64 /* power'o'two */ |
336 | // sizeof (struct td) ~= 64 == 2^6 ... | 336 | // sizeof (struct td) ~= 64 == 2^6 ... |
337 | #define TD_HASH_FUNC(td_dma) ((td_dma ^ (td_dma >> 6)) % TD_HASH_SIZE) | 337 | #define TD_HASH_FUNC(td_dma) ((td_dma ^ (td_dma >> 6)) % TD_HASH_SIZE) |
338 | 338 | ||
339 | 339 | ||
@@ -364,11 +364,11 @@ struct ohci_hcd { | |||
364 | 364 | ||
365 | struct ed *ed_bulktail; /* last in bulk list */ | 365 | struct ed *ed_bulktail; /* last in bulk list */ |
366 | struct ed *ed_controltail; /* last in ctrl list */ | 366 | struct ed *ed_controltail; /* last in ctrl list */ |
367 | struct ed *periodic [NUM_INTS]; /* shadow int_table */ | 367 | struct ed *periodic [NUM_INTS]; /* shadow int_table */ |
368 | 368 | ||
369 | /* | 369 | /* |
370 | * OTG controllers and transceivers need software interaction; | 370 | * OTG controllers and transceivers need software interaction; |
371 | * other external transceivers should be software-transparent | 371 | * other external transceivers should be software-transparent |
372 | */ | 372 | */ |
373 | struct otg_transceiver *transceiver; | 373 | struct otg_transceiver *transceiver; |
374 | 374 | ||
@@ -385,7 +385,7 @@ struct ohci_hcd { | |||
385 | */ | 385 | */ |
386 | int num_ports; | 386 | int num_ports; |
387 | int load [NUM_INTS]; | 387 | int load [NUM_INTS]; |
388 | u32 hc_control; /* copy of hc control reg */ | 388 | u32 hc_control; /* copy of hc control reg */ |
389 | unsigned long next_statechange; /* suspend/resume */ | 389 | unsigned long next_statechange; /* suspend/resume */ |
390 | u32 fminterval; /* saved register */ | 390 | u32 fminterval; /* saved register */ |
391 | unsigned autostop:1; /* rh auto stopping/stopped */ | 391 | unsigned autostop:1; /* rh auto stopping/stopped */ |
@@ -598,7 +598,7 @@ static inline void disable (struct ohci_hcd *ohci) | |||
598 | } | 598 | } |
599 | 599 | ||
600 | #define FI 0x2edf /* 12000 bits per frame (-1) */ | 600 | #define FI 0x2edf /* 12000 bits per frame (-1) */ |
601 | #define FSMP(fi) (0x7fff & ((6 * ((fi) - 210)) / 7)) | 601 | #define FSMP(fi) (0x7fff & ((6 * ((fi) - 210)) / 7)) |
602 | #define FIT (1 << 31) | 602 | #define FIT (1 << 31) |
603 | #define LSTHRESH 0x628 /* lowspeed bit threshold */ | 603 | #define LSTHRESH 0x628 /* lowspeed bit threshold */ |
604 | 604 | ||