Lines Matching +full:overcurrent +full:- +full:retry
1 // SPDX-License-Identifier: GPL-1.0+
8 * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net>
16 * OHCI is the main "non-Intel/VIA" standard for USB 1.1 host controller
17 * interfaces (though some non-x86 Intel chips use it). It supports
39 #include <linux/dma-mapping.h>
54 /*-------------------------------------------------------------------------*/
63 /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
72 /*-------------------------------------------------------------------------*/
81 #include "pci-quirks.h"
87 #include "ohci-hub.c"
88 #include "ohci-dbg.c"
89 #include "ohci-mem.c"
90 #include "ohci-q.c"
94 * On architectures with edge-triggered interrupts we must never return
97 #if defined(CONFIG_SA1111) /* ... or other edge-triggered systems */
104 /* Some boards misreport power switching/overcurrent */
108 "true to distrust firmware power/overcurrent setup");
115 /*-------------------------------------------------------------------------*/
122 len = urb->transfer_buffer_length; in number_of_tds()
123 i = urb->num_mapped_sgs; in number_of_tds()
125 if (len > 0 && i > 0) { /* Scatter-gather transfer */ in number_of_tds()
127 sg = urb->sg; in number_of_tds()
131 len -= this_sg_len; in number_of_tds()
132 if (--i <= 0 || len <= 0) in number_of_tds()
137 } else { /* Non-SG transfer */ in number_of_tds()
155 unsigned int pipe = urb->pipe; in ohci_urb_enqueue()
161 ed = ed_get(ohci, urb->ep, urb->dev, pipe, urb->interval); in ohci_urb_enqueue()
163 return -ENOMEM; in ohci_urb_enqueue()
166 switch (ed->type) { in ohci_urb_enqueue()
169 if (urb->transfer_buffer_length > 4096) in ohci_urb_enqueue()
170 return -EMSGSIZE; in ohci_urb_enqueue()
179 /* maybe a zero-length packet to wrap it up */ in ohci_urb_enqueue()
182 else if ((urb->transfer_flags & URB_ZERO_PACKET) != 0 in ohci_urb_enqueue()
183 && (urb->transfer_buffer_length in ohci_urb_enqueue()
184 % usb_maxpacket(urb->dev, pipe)) == 0) in ohci_urb_enqueue()
188 size = urb->number_of_packets; in ohci_urb_enqueue()
195 return -ENOMEM; in ohci_urb_enqueue()
196 INIT_LIST_HEAD (&urb_priv->pending); in ohci_urb_enqueue()
197 urb_priv->length = size; in ohci_urb_enqueue()
198 urb_priv->ed = ed; in ohci_urb_enqueue()
202 urb_priv->td [i] = td_alloc (ohci, mem_flags); in ohci_urb_enqueue()
203 if (!urb_priv->td [i]) { in ohci_urb_enqueue()
204 urb_priv->length = i; in ohci_urb_enqueue()
206 return -ENOMEM; in ohci_urb_enqueue()
210 spin_lock_irqsave (&ohci->lock, flags); in ohci_urb_enqueue()
214 retval = -ENODEV; in ohci_urb_enqueue()
217 if (ohci->rh_state != OHCI_RH_RUNNING) { in ohci_urb_enqueue()
218 retval = -ENODEV; in ohci_urb_enqueue()
226 if (ed->state == ED_IDLE) { in ohci_urb_enqueue()
234 if (ohci->prev_frame_no == IO_WATCHDOG_OFF && in ohci_urb_enqueue()
235 list_empty(&ohci->eds_in_use) && in ohci_urb_enqueue()
236 !(ohci->flags & OHCI_QUIRK_QEMU)) { in ohci_urb_enqueue()
237 ohci->prev_frame_no = ohci_frame_no(ohci); in ohci_urb_enqueue()
238 mod_timer(&ohci->io_watchdog, in ohci_urb_enqueue()
241 list_add(&ed->in_use_list, &ohci->eds_in_use); in ohci_urb_enqueue()
243 if (ed->type == PIPE_ISOCHRONOUS) { in ohci_urb_enqueue()
247 frame += max_t (u16, 8, ed->interval); in ohci_urb_enqueue()
248 frame &= ~(ed->interval - 1); in ohci_urb_enqueue()
249 frame |= ed->branch; in ohci_urb_enqueue()
250 urb->start_frame = frame; in ohci_urb_enqueue()
251 ed->last_iso = frame + ed->interval * (size - 1); in ohci_urb_enqueue()
253 } else if (ed->type == PIPE_ISOCHRONOUS) { in ohci_urb_enqueue()
255 u16 frame = ed->last_iso + ed->interval; in ohci_urb_enqueue()
256 u16 length = ed->interval * (size - 1); in ohci_urb_enqueue()
262 if (urb->transfer_flags & URB_ISO_ASAP) { in ohci_urb_enqueue()
263 frame += (next - frame + ed->interval - 1) & in ohci_urb_enqueue()
264 -ed->interval; in ohci_urb_enqueue()
278 urb_priv->td_cnt = DIV_ROUND_UP( in ohci_urb_enqueue()
279 (u16) (next - frame), in ohci_urb_enqueue()
280 ed->interval); in ohci_urb_enqueue()
281 if (urb_priv->td_cnt >= urb_priv->length) { in ohci_urb_enqueue()
282 ++urb_priv->td_cnt; /* Mark it */ in ohci_urb_enqueue()
289 urb->start_frame = frame; in ohci_urb_enqueue()
290 ed->last_iso = frame + length; in ohci_urb_enqueue()
297 urb->hcpriv = urb_priv; in ohci_urb_enqueue()
303 spin_unlock_irqrestore (&ohci->lock, flags); in ohci_urb_enqueue()
320 spin_lock_irqsave (&ohci->lock, flags); in ohci_urb_dequeue()
328 urb_priv = urb->hcpriv; in ohci_urb_dequeue()
329 if (urb_priv->ed->state == ED_OPER) in ohci_urb_dequeue()
330 start_ed_unlink(ohci, urb_priv->ed); in ohci_urb_dequeue()
332 if (ohci->rh_state != OHCI_RH_RUNNING) { in ohci_urb_dequeue()
337 spin_unlock_irqrestore (&ohci->lock, flags); in ohci_urb_dequeue()
341 /*-------------------------------------------------------------------------*/
352 struct ed *ed = ep->hcpriv; in ohci_endpoint_disable()
362 spin_lock_irqsave (&ohci->lock, flags); in ohci_endpoint_disable()
364 if (ohci->rh_state != OHCI_RH_RUNNING) { in ohci_endpoint_disable()
366 ed->state = ED_IDLE; in ohci_endpoint_disable()
370 switch (ed->state) { in ohci_endpoint_disable()
373 if (limit-- == 0) { in ohci_endpoint_disable()
377 spin_unlock_irqrestore (&ohci->lock, flags); in ohci_endpoint_disable()
381 if (list_empty (&ed->td_list)) { in ohci_endpoint_disable()
382 td_free (ohci, ed->dummy); in ohci_endpoint_disable()
392 ed, ep->desc.bEndpointAddress, ed->state, in ohci_endpoint_disable()
393 list_empty (&ed->td_list) ? "" : " (has tds)"); in ohci_endpoint_disable()
394 td_free (ohci, ed->dummy); in ohci_endpoint_disable()
397 ep->hcpriv = NULL; in ohci_endpoint_disable()
398 spin_unlock_irqrestore (&ohci->lock, flags); in ohci_endpoint_disable()
410 ohci->hc_control = ohci_readl (ohci, &ohci->regs->control); in ohci_usb_reset()
411 ohci->hc_control &= OHCI_CTRL_RWC; in ohci_usb_reset()
412 ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); in ohci_usb_reset()
413 ohci->rh_state = OHCI_RH_HALTED; in ohci_usb_reset()
418 * "firmware". this is bus-neutral, unlike shutdown() methods.
425 ohci_writel(ohci, (u32) ~0, &ohci->regs->intrdisable); in _ohci_shutdown()
428 ohci_writel(ohci, OHCI_HCR, &ohci->regs->cmdstatus); in _ohci_shutdown()
429 ohci_readl(ohci, &ohci->regs->cmdstatus); /* flush the writes */ in _ohci_shutdown()
432 ohci_writel(ohci, ohci->fminterval, &ohci->regs->fminterval); in _ohci_shutdown()
433 ohci->rh_state = OHCI_RH_HALTED; in _ohci_shutdown()
441 spin_lock_irqsave(&ohci->lock, flags); in ohci_shutdown()
443 spin_unlock_irqrestore(&ohci->lock, flags); in ohci_shutdown()
446 /*-------------------------------------------------------------------------*
448 *-------------------------------------------------------------------------*/
457 /* Accept arbitrarily long scatter-gather lists */ in ohci_init()
458 if (!hcd->localmem_pool) in ohci_init()
459 hcd->self.sg_tablesize = ~0; in ohci_init()
462 ohci->flags |= OHCI_QUIRK_HUB_POWER; in ohci_init()
464 ohci->rh_state = OHCI_RH_HALTED; in ohci_init()
465 ohci->regs = hcd->regs; in ohci_init()
468 * was never needed for most non-PCI systems ... remove the code? in ohci_init()
474 &ohci->regs->control) & OHCI_CTRL_IR) { in ohci_init()
485 ohci_writel (ohci, OHCI_INTR_OC, &ohci->regs->intrenable); in ohci_init()
486 ohci_writel (ohci, OHCI_OCR, &ohci->regs->cmdstatus); in ohci_init()
487 while (ohci_readl (ohci, &ohci->regs->control) & OHCI_CTRL_IR) { in ohci_init()
489 if (--temp == 0) { in ohci_init()
492 return -EBUSY; in ohci_init()
500 ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); in ohci_init()
503 if (ohci_readl (ohci, &ohci->regs->control) & OHCI_CTRL_RWC) in ohci_init()
504 ohci->hc_control |= OHCI_CTRL_RWC; in ohci_init()
507 if (ohci->num_ports == 0) in ohci_init()
508 ohci->num_ports = roothub_a(ohci) & RH_A_NDP; in ohci_init()
510 if (ohci->hcca) in ohci_init()
513 timer_setup(&ohci->io_watchdog, io_watchdog_func, 0); in ohci_init()
514 ohci->prev_frame_no = IO_WATCHDOG_OFF; in ohci_init()
516 if (hcd->localmem_pool) in ohci_init()
517 ohci->hcca = gen_pool_dma_alloc_align(hcd->localmem_pool, in ohci_init()
518 sizeof(*ohci->hcca), in ohci_init()
519 &ohci->hcca_dma, 256); in ohci_init()
521 ohci->hcca = dma_alloc_coherent(hcd->self.controller, in ohci_init()
522 sizeof(*ohci->hcca), in ohci_init()
523 &ohci->hcca_dma, in ohci_init()
525 if (!ohci->hcca) in ohci_init()
526 return -ENOMEM; in ohci_init()
537 /*-------------------------------------------------------------------------*/
546 int first = ohci->fminterval == 0; in ohci_run()
549 ohci->rh_state = OHCI_RH_HALTED; in ohci_run()
554 val = ohci_readl (ohci, &ohci->regs->fminterval); in ohci_run()
555 ohci->fminterval = val & 0x3fff; in ohci_run()
556 if (ohci->fminterval != FI) in ohci_run()
558 ohci->fminterval - FI); in ohci_run()
559 ohci->fminterval |= FSMP (ohci->fminterval) << 16; in ohci_run()
560 /* also: power/overcurrent flags in roothub.a */ in ohci_run()
569 if ((ohci->hc_control & OHCI_CTRL_RWC) != 0) in ohci_run()
570 device_set_wakeup_capable(hcd->self.controller, 1); in ohci_run()
572 switch (ohci->hc_control & OHCI_CTRL_HCFS) { in ohci_run()
578 ohci->hc_control &= OHCI_CTRL_RWC; in ohci_run()
579 ohci->hc_control |= OHCI_USB_RESUME; in ohci_run()
584 ohci->hc_control &= OHCI_CTRL_RWC; in ohci_run()
585 ohci->hc_control |= OHCI_USB_RESET; in ohci_run()
589 ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); in ohci_run()
591 (void) ohci_readl (ohci, &ohci->regs->control); in ohci_run()
594 memset (ohci->hcca, 0, sizeof (struct ohci_hcca)); in ohci_run()
597 spin_lock_irq (&ohci->lock); in ohci_run()
599 retry: in ohci_run()
601 ohci_writel (ohci, OHCI_HCR, &ohci->regs->cmdstatus); in ohci_run()
603 while ((ohci_readl (ohci, &ohci->regs->cmdstatus) & OHCI_HCR) != 0) { in ohci_run()
604 if (--val == 0) { in ohci_run()
605 spin_unlock_irq (&ohci->lock); in ohci_run()
607 return -1; in ohci_run()
621 if (ohci->flags & OHCI_QUIRK_INITRESET) { in ohci_run()
622 ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); in ohci_run()
624 (void) ohci_readl (ohci, &ohci->regs->control); in ohci_run()
629 ohci_writel (ohci, 0, &ohci->regs->ed_controlhead); in ohci_run()
630 ohci_writel (ohci, 0, &ohci->regs->ed_bulkhead); in ohci_run()
633 ohci_writel (ohci, (u32) ohci->hcca_dma, &ohci->regs->hcca); in ohci_run()
640 if ((ohci_readl (ohci, &ohci->regs->fminterval) & 0x3fff0000) == 0 in ohci_run()
641 || !ohci_readl (ohci, &ohci->regs->periodicstart)) { in ohci_run()
642 if (!(ohci->flags & OHCI_QUIRK_INITRESET)) { in ohci_run()
643 ohci->flags |= OHCI_QUIRK_INITRESET; in ohci_run()
645 goto retry; in ohci_run()
647 spin_unlock_irq (&ohci->lock); in ohci_run()
649 ohci_readl (ohci, &ohci->regs->fminterval), in ohci_run()
650 ohci_readl (ohci, &ohci->regs->periodicstart)); in ohci_run()
651 return -EOVERFLOW; in ohci_run()
655 set_bit(HCD_FLAG_POLL_RH, &hcd->flags); in ohci_run()
656 hcd->uses_new_polling = 1; in ohci_run()
659 ohci->hc_control &= OHCI_CTRL_RWC; in ohci_run()
660 ohci->hc_control |= OHCI_CONTROL_INIT | OHCI_USB_OPER; in ohci_run()
661 ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); in ohci_run()
662 ohci->rh_state = OHCI_RH_RUNNING; in ohci_run()
665 ohci_writel (ohci, RH_HS_DRWE, &ohci->regs->roothub.status); in ohci_run()
669 ohci_writel (ohci, ~0, &ohci->regs->intrstatus); in ohci_run()
670 ohci_writel (ohci, mask, &ohci->regs->intrenable); in ohci_run()
674 /* Configure for per-port over-current protection by default */ in ohci_run()
677 if (ohci->flags & OHCI_QUIRK_SUPERIO) { in ohci_run()
679 * Ganged power switching, no over-current protection. in ohci_run()
683 } else if ((ohci->flags & OHCI_QUIRK_AMD756) || in ohci_run()
684 (ohci->flags & OHCI_QUIRK_HUB_POWER)) { in ohci_run()
685 /* hub power always on; required for AMD-756 and some in ohci_run()
690 ohci_writel(ohci, val, &ohci->regs->roothub.a); in ohci_run()
692 ohci_writel (ohci, RH_HS_LPSC, &ohci->regs->roothub.status); in ohci_run()
694 &ohci->regs->roothub.b); in ohci_run()
696 (void) ohci_readl (ohci, &ohci->regs->control); in ohci_run()
698 ohci->next_statechange = jiffies + STATECHANGE_DELAY; in ohci_run()
699 spin_unlock_irq (&ohci->lock); in ohci_run()
701 // POTPGT delay is bits 24-31, in 2 ms units. in ohci_run()
735 /*-------------------------------------------------------------------------*/
758 spin_lock_irqsave(&ohci->lock, flags); in io_watchdog_func()
764 * was non-empty at that time, something is badly wrong with the in io_watchdog_func()
767 status = ohci_readl(ohci, &ohci->regs->intrstatus); in io_watchdog_func()
768 if (!(status & OHCI_INTR_WDH) && ohci->wdh_cnt == ohci->prev_wdh_cnt) { in io_watchdog_func()
769 if (ohci->prev_donehead) { in io_watchdog_func()
783 list_for_each_entry(ed, &ohci->eds_in_use, in_use_list) { in io_watchdog_func()
784 if (ed->pending_td) { in io_watchdog_func()
787 unsigned tmp = hc32_to_cpu(ohci, ed->hwINFO); in io_watchdog_func()
793 add_to_done_list(ohci, ed->pending_td); in io_watchdog_func()
798 td = ed->pending_td; in io_watchdog_func()
802 list_for_each_entry(td_next, &ed->td_list, td_list) { in io_watchdog_func()
803 if (!td_next->next_dl_td) in io_watchdog_func()
810 head = hc32_to_cpu(ohci, READ_ONCE(ed->hwHeadP)) & TD_MASK; in io_watchdog_func()
812 td_next = list_prepare_entry(td, &ed->td_list, td_list); in io_watchdog_func()
813 list_for_each_entry_continue(td_next, &ed->td_list, td_list) { in io_watchdog_func()
814 if (head == (u32) td_next->td_dma) in io_watchdog_func()
824 ed->takeback_wdh_cnt = ohci->wdh_cnt + 2; in io_watchdog_func()
825 ed->pending_td = td; in io_watchdog_func()
831 if (ohci->rh_state == OHCI_RH_RUNNING) { in io_watchdog_func()
842 if (frame_no == ohci->prev_frame_no) { in io_watchdog_func()
847 for (i = 0; i < ohci->num_ports; ++i) { in io_watchdog_func()
859 if (!list_empty(&ohci->eds_in_use)) { in io_watchdog_func()
861 ohci->prev_wdh_cnt = ohci->wdh_cnt; in io_watchdog_func()
862 ohci->prev_donehead = ohci_readl(ohci, in io_watchdog_func()
863 &ohci->regs->donehead); in io_watchdog_func()
864 mod_timer(&ohci->io_watchdog, in io_watchdog_func()
870 ohci->prev_frame_no = prev_frame_no; in io_watchdog_func()
871 spin_unlock_irqrestore(&ohci->lock, flags); in io_watchdog_func()
879 struct ohci_regs __iomem *regs = ohci->regs; in ohci_irq()
883 * optimization of checking the LSB of hcca->done_head; it doesn't in ohci_irq()
886 ints = ohci_readl(ohci, ®s->intrstatus); in ohci_irq()
893 ohci->rh_state = OHCI_RH_HALTED; in ohci_irq()
900 ints &= ohci_readl(ohci, ®s->intrenable); in ohci_irq()
903 if (ints == 0 || unlikely(ohci->rh_state == OHCI_RH_HALTED)) in ohci_irq()
914 ohci_writel (ohci, OHCI_INTR_UE, ®s->intrdisable); in ohci_irq()
916 schedule_work (&ohci->nec_work); in ohci_irq()
919 ohci->rh_state = OHCI_RH_HALTED; in ohci_irq()
929 ohci->next_statechange = jiffies + STATECHANGE_DELAY; in ohci_irq()
931 ®s->intrstatus); in ohci_irq()
936 * change bit. With others it's level-triggered, active in ohci_irq()
939 * re-enables it. in ohci_irq()
941 ohci_writel(ohci, OHCI_INTR_RHSC, ®s->intrdisable); in ohci_irq()
951 ohci_writel(ohci, OHCI_INTR_RD, ®s->intrstatus); in ohci_irq()
952 set_bit(HCD_FLAG_POLL_RH, &hcd->flags); in ohci_irq()
953 if (ohci->autostop) { in ohci_irq()
954 spin_lock (&ohci->lock); in ohci_irq()
956 spin_unlock (&ohci->lock); in ohci_irq()
961 spin_lock(&ohci->lock); in ohci_irq()
971 if ((ints & OHCI_INTR_SF) != 0 && !ohci->ed_rm_list in ohci_irq()
972 && ohci->rh_state == OHCI_RH_RUNNING) in ohci_irq()
973 ohci_writel (ohci, OHCI_INTR_SF, ®s->intrdisable); in ohci_irq()
975 if (ohci->rh_state == OHCI_RH_RUNNING) { in ohci_irq()
976 ohci_writel (ohci, ints, ®s->intrstatus); in ohci_irq()
978 ++ohci->wdh_cnt; in ohci_irq()
980 ohci_writel (ohci, OHCI_INTR_MIE, ®s->intrenable); in ohci_irq()
982 (void) ohci_readl (ohci, &ohci->regs->control); in ohci_irq()
984 spin_unlock(&ohci->lock); in ohci_irq()
987 if (ohci->rh_state != OHCI_RH_HALTED) { in ohci_irq()
988 ints = ohci_readl(ohci, ®s->intrstatus); in ohci_irq()
989 if (ints && (ints & ohci_readl(ohci, ®s->intrenable))) in ohci_irq()
996 /*-------------------------------------------------------------------------*/
1005 flush_work(&ohci->nec_work); in ohci_stop()
1006 del_timer_sync(&ohci->io_watchdog); in ohci_stop()
1007 ohci->prev_frame_no = IO_WATCHDOG_OFF; in ohci_stop()
1009 ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); in ohci_stop()
1011 free_irq(hcd->irq, hcd); in ohci_stop()
1012 hcd->irq = 0; in ohci_stop()
1019 if (ohci->hcca) { in ohci_stop()
1020 if (hcd->localmem_pool) in ohci_stop()
1021 gen_pool_free(hcd->localmem_pool, in ohci_stop()
1022 (unsigned long)ohci->hcca, in ohci_stop()
1023 sizeof(*ohci->hcca)); in ohci_stop()
1025 dma_free_coherent(hcd->self.controller, in ohci_stop()
1026 sizeof(*ohci->hcca), in ohci_stop()
1027 ohci->hcca, ohci->hcca_dma); in ohci_stop()
1028 ohci->hcca = NULL; in ohci_stop()
1029 ohci->hcca_dma = 0; in ohci_stop()
1033 /*-------------------------------------------------------------------------*/
1045 spin_lock_irq(&ohci->lock); in ohci_restart()
1046 ohci->rh_state = OHCI_RH_HALTED; in ohci_restart()
1049 if (!list_empty (&ohci->pending)) in ohci_restart()
1051 list_for_each_entry (priv, &ohci->pending, pending) { in ohci_restart()
1052 struct urb *urb = priv->td[0]->urb; in ohci_restart()
1053 struct ed *ed = priv->ed; in ohci_restart()
1055 switch (ed->state) { in ohci_restart()
1057 ed->state = ED_UNLINK; in ohci_restart()
1058 ed->hwINFO |= cpu_to_hc32(ohci, ED_DEQUEUE); in ohci_restart()
1061 ed->ed_next = ohci->ed_rm_list; in ohci_restart()
1062 ed->ed_prev = NULL; in ohci_restart()
1063 ohci->ed_rm_list = ed; in ohci_restart()
1069 ed, ed->state); in ohci_restart()
1072 if (!urb->unlinked) in ohci_restart()
1073 urb->unlinked = -ESHUTDOWN; in ohci_restart()
1076 spin_unlock_irq(&ohci->lock); in ohci_restart()
1081 for (i = 0; i < NUM_INTS; i++) ohci->load [i] = 0; in ohci_restart()
1082 for (i = 0; i < NUM_INTS; i++) ohci->hcca->int_table [i] = 0; in ohci_restart()
1085 ohci->ed_rm_list = NULL; in ohci_restart()
1088 ohci->ed_controltail = NULL; in ohci_restart()
1089 ohci->ed_bulktail = NULL; in ohci_restart()
1114 spin_lock_irqsave (&ohci->lock, flags); in ohci_suspend()
1115 ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); in ohci_suspend()
1116 (void)ohci_readl(ohci, &ohci->regs->intrdisable); in ohci_suspend()
1118 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in ohci_suspend()
1119 spin_unlock_irqrestore (&ohci->lock, flags); in ohci_suspend()
1121 synchronize_irq(hcd->irq); in ohci_suspend()
1125 rc = -EBUSY; in ohci_suspend()
1138 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in ohci_resume()
1140 /* Make sure resume from hibernation re-enumerates everything */ in ohci_resume()
1145 ohci->hc_control = ohci_readl(ohci, &ohci->regs->control); in ohci_resume()
1146 if (ohci->hc_control & (OHCI_CTRL_IR | OHCI_SCHED_ENABLES)) { in ohci_resume()
1149 switch (ohci->hc_control & OHCI_CTRL_HCFS) { in ohci_resume()
1158 spin_lock_irq(&ohci->lock); in ohci_resume()
1161 spin_unlock_irq(&ohci->lock); in ohci_resume()
1167 for (port = 0; port < ohci->num_ports; port++) in ohci_resume()
1169 &ohci->regs->roothub.portstatus[port]); in ohci_resume()
1171 ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrenable); in ohci_resume()
1172 ohci_readl(ohci, &ohci->regs->intrenable); in ohci_resume()
1184 /*-------------------------------------------------------------------------*/
1241 drv->product_desc = over->product_desc; in ohci_init_driver()
1242 drv->hcd_priv_size += over->extra_priv_size; in ohci_init_driver()
1243 if (over->reset) in ohci_init_driver()
1244 drv->reset = over->reset; in ohci_init_driver()
1249 /*-------------------------------------------------------------------------*/
1256 #include "ohci-sa1111.c"
1261 #include "ohci-ppc-of.c"
1266 #include "ohci-ps3.c"
1271 #include "ohci-sm501.c"
1280 return -ENODEV; in ohci_hcd_mod_init()