Lines Matching +full:full +full:- +full:pwr +full:- +full:cycle +full:- +full:in +full:- +full:suspend

1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2001-2004 by David Brownell
6 /* this file is part of ehci-hcd.c */
8 /*-------------------------------------------------------------------------*/
16 /*-------------------------------------------------------------------------*/
26 return !udev->maxchild && udev->persist_enabled && in persist_enabled_on_companion()
27 udev->bus->root_hub->speed < USB_SPEED_HIGH; in persist_enabled_on_companion()
41 if (!ehci->owned_ports) in ehci_handover_companion_ports()
47 * persist_enabled (by looking through all USB 1.1 buses in the system), in ehci_handover_companion_ports()
55 port = HCS_N_PORTS(ehci->hcs_params); in ehci_handover_companion_ports()
56 while (port--) { in ehci_handover_companion_ports()
57 if (test_bit(port, &ehci->owned_ports)) { in ehci_handover_companion_ports()
58 reg = &ehci->regs->port_status[port]; in ehci_handover_companion_ports()
68 spin_lock_irq(&ehci->lock); in ehci_handover_companion_ports()
69 port = HCS_N_PORTS(ehci->hcs_params); in ehci_handover_companion_ports()
70 while (port--) { in ehci_handover_companion_ports()
71 if (test_bit(port, &ehci->owned_ports)) { in ehci_handover_companion_ports()
72 reg = &ehci->regs->port_status[port]; in ehci_handover_companion_ports()
77 clear_bit(port, &ehci->owned_ports); in ehci_handover_companion_ports()
78 else if (test_bit(port, &ehci->companion_ports)) in ehci_handover_companion_ports()
81 spin_unlock_irq(&ehci->lock); in ehci_handover_companion_ports()
85 spin_lock_irq(&ehci->lock); in ehci_handover_companion_ports()
89 spin_unlock_irq(&ehci->lock); in ehci_handover_companion_ports()
91 if (!ehci->owned_ports) in ehci_handover_companion_ports()
95 spin_lock_irq(&ehci->lock); in ehci_handover_companion_ports()
96 port = HCS_N_PORTS(ehci->hcs_params); in ehci_handover_companion_ports()
97 while (port--) { in ehci_handover_companion_ports()
98 if (test_bit(port, &ehci->owned_ports)) { in ehci_handover_companion_ports()
99 spin_unlock_irq(&ehci->lock); in ehci_handover_companion_ports()
103 spin_lock_irq(&ehci->lock); in ehci_handover_companion_ports()
109 reg = &ehci->regs->port_status[port]; in ehci_handover_companion_ports()
121 ehci->owned_ports = 0; in ehci_handover_companion_ports()
122 spin_unlock_irq(&ehci->lock); in ehci_handover_companion_ports()
127 int i = HCS_N_PORTS(ehci->hcs_params); in ehci_port_change()
131 if (ehci_readl(ehci, &ehci->regs->status) & STS_PCD) in ehci_port_change()
139 while (i--) in ehci_port_change()
140 if (ehci_readl(ehci, &ehci->regs->port_status[i]) & PORT_CSC) in ehci_port_change()
154 * when the controller is suspended or resumed. In all other in ehci_adjust_port_wakeup_flags()
157 if (!ehci_to_hcd(ehci)->self.root_hub->do_remote_wakeup || do_wakeup) in ehci_adjust_port_wakeup_flags()
160 spin_lock_irq(&ehci->lock); in ehci_adjust_port_wakeup_flags()
162 /* clear phy low-power mode before changing wakeup flags */ in ehci_adjust_port_wakeup_flags()
163 if (ehci->has_tdi_phy_lpm) { in ehci_adjust_port_wakeup_flags()
164 port = HCS_N_PORTS(ehci->hcs_params); in ehci_adjust_port_wakeup_flags()
165 while (port--) { in ehci_adjust_port_wakeup_flags()
166 u32 __iomem *hostpc_reg = &ehci->regs->hostpc[port]; in ehci_adjust_port_wakeup_flags()
171 spin_unlock_irq(&ehci->lock); in ehci_adjust_port_wakeup_flags()
173 spin_lock_irq(&ehci->lock); in ehci_adjust_port_wakeup_flags()
176 port = HCS_N_PORTS(ehci->hcs_params); in ehci_adjust_port_wakeup_flags()
177 while (port--) { in ehci_adjust_port_wakeup_flags()
178 u32 __iomem *reg = &ehci->regs->port_status[port]; in ehci_adjust_port_wakeup_flags()
194 /* enter phy low-power mode again */ in ehci_adjust_port_wakeup_flags()
195 if (ehci->has_tdi_phy_lpm) { in ehci_adjust_port_wakeup_flags()
196 port = HCS_N_PORTS(ehci->hcs_params); in ehci_adjust_port_wakeup_flags()
197 while (port--) { in ehci_adjust_port_wakeup_flags()
198 u32 __iomem *hostpc_reg = &ehci->regs->hostpc[port]; in ehci_adjust_port_wakeup_flags()
209 spin_unlock_irq(&ehci->lock); in ehci_adjust_port_wakeup_flags()
221 ehci_dbg(ehci, "suspend root hub\n"); in ehci_bus_suspend()
223 if (time_before (jiffies, ehci->next_statechange)) in ehci_bus_suspend()
229 spin_lock_irq (&ehci->lock); in ehci_bus_suspend()
230 if (ehci->rh_state < EHCI_RH_RUNNING) in ehci_bus_suspend()
234 * in progress won't complete. Hence if remote wakeup is enabled in ehci_bus_suspend()
235 * for the root hub and any ports are in the middle of a resume or in ehci_bus_suspend()
236 * remote wakeup, we must fail the suspend. in ehci_bus_suspend()
238 if (hcd->self.root_hub->do_remote_wakeup) { in ehci_bus_suspend()
239 if (ehci->resuming_ports) { in ehci_bus_suspend()
240 spin_unlock_irq(&ehci->lock); in ehci_bus_suspend()
241 ehci_dbg(ehci, "suspend failed because a port is resuming\n"); in ehci_bus_suspend()
242 return -EBUSY; in ehci_bus_suspend()
247 * any notion of "global" or bus-wide suspend. The driver has in ehci_bus_suspend()
248 * to manually suspend all the active unsuspended ports, and in ehci_bus_suspend()
249 * then manually resume them in the bus_resume() routine. in ehci_bus_suspend()
251 ehci->bus_suspended = 0; in ehci_bus_suspend()
252 ehci->owned_ports = 0; in ehci_bus_suspend()
255 port = HCS_N_PORTS(ehci->hcs_params); in ehci_bus_suspend()
256 while (port--) { in ehci_bus_suspend()
257 u32 __iomem *reg = &ehci->regs->port_status [port]; in ehci_bus_suspend()
261 /* keep track of which ports we suspend */ in ehci_bus_suspend()
263 set_bit(port, &ehci->owned_ports); in ehci_bus_suspend()
266 set_bit(port, &ehci->bus_suspended); in ehci_bus_suspend()
270 if (hcd->self.root_hub->do_remote_wakeup) { in ehci_bus_suspend()
284 * On some controllers, Wake-On-Disconnect will in ehci_bus_suspend()
286 * switches over to full-speed idle. For their in ehci_bus_suspend()
297 spin_unlock_irq(&ehci->lock); in ehci_bus_suspend()
302 * enter the suspend status before initiating a port resume in ehci_bus_suspend()
303 * using the Force Port Resume bit (Not-EHCI compatible). in ehci_bus_suspend()
307 if ((changed && ehci->has_tdi_phy_lpm) || fs_idle_delay) { in ehci_bus_suspend()
309 * Wait for HCD to enter low-power mode or for the bus in ehci_bus_suspend()
310 * to switch to full-speed idle. in ehci_bus_suspend()
315 if (changed && ehci->has_tdi_phy_lpm) { in ehci_bus_suspend()
316 spin_lock_irq(&ehci->lock); in ehci_bus_suspend()
317 port = HCS_N_PORTS(ehci->hcs_params); in ehci_bus_suspend()
318 while (port--) { in ehci_bus_suspend()
319 u32 __iomem *hostpc_reg = &ehci->regs->hostpc[port]; in ehci_bus_suspend()
325 ehci_dbg(ehci, "Port %d phy low-power mode %s\n", in ehci_bus_suspend()
329 spin_unlock_irq(&ehci->lock); in ehci_bus_suspend()
332 /* Apparently some devices need a >= 1-uframe delay here */ in ehci_bus_suspend()
333 if (ehci->bus_suspended) in ehci_bus_suspend()
336 /* turn off now-idle HC */ in ehci_bus_suspend()
339 spin_lock_irq(&ehci->lock); in ehci_bus_suspend()
340 if (ehci->enabled_hrtimer_events & BIT(EHCI_HRTIMER_POLL_DEAD)) in ehci_bus_suspend()
342 if (ehci->rh_state != EHCI_RH_RUNNING) in ehci_bus_suspend()
344 ehci->rh_state = EHCI_RH_SUSPENDED; in ehci_bus_suspend()
349 ehci_writel(ehci, STS_IAA, &ehci->regs->status); in ehci_bus_suspend()
351 /* Any IAA cycle that started before the suspend is now invalid */ in ehci_bus_suspend()
359 if (!hcd->self.root_hub->do_remote_wakeup) in ehci_bus_suspend()
361 ehci_writel(ehci, mask, &ehci->regs->intr_enable); in ehci_bus_suspend()
362 ehci_readl(ehci, &ehci->regs->intr_enable); in ehci_bus_suspend()
365 ehci->next_statechange = jiffies + msecs_to_jiffies(10); in ehci_bus_suspend()
366 ehci->enabled_hrtimer_events = 0; in ehci_bus_suspend()
367 ehci->next_hrtimer_event = EHCI_HRTIMER_NO_EVENT; in ehci_bus_suspend()
368 spin_unlock_irq (&ehci->lock); in ehci_bus_suspend()
370 hrtimer_cancel(&ehci->hrtimer); in ehci_bus_suspend()
384 if (time_before (jiffies, ehci->next_statechange)) in ehci_bus_resume()
386 spin_lock_irq (&ehci->lock); in ehci_bus_resume()
387 if (!HCD_HW_ACCESSIBLE(hcd) || ehci->shutdown) in ehci_bus_resume()
390 if (unlikely(ehci->debug)) { in ehci_bus_resume()
392 ehci->debug = NULL; in ehci_bus_resume()
399 * could instead be restoring a swsusp snapshot -- so that BIOS was in ehci_bus_resume()
403 power_okay = ehci_readl(ehci, &ehci->regs->intr_enable); in ehci_bus_resume()
410 ehci_writel(ehci, 0, &ehci->regs->intr_enable); in ehci_bus_resume()
412 /* re-init operational registers */ in ehci_bus_resume()
413 ehci_writel(ehci, 0, &ehci->regs->segment); in ehci_bus_resume()
414 ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list); in ehci_bus_resume()
415 ehci_writel(ehci, (u32) ehci->async->qh_dma, &ehci->regs->async_next); in ehci_bus_resume()
418 ehci->command |= CMD_RUN; in ehci_bus_resume()
419 ehci_writel(ehci, ehci->command, &ehci->regs->command); in ehci_bus_resume()
420 ehci->rh_state = EHCI_RH_RUNNING; in ehci_bus_resume()
427 i = HCS_N_PORTS(ehci->hcs_params); in ehci_bus_resume()
428 while (i--) { in ehci_bus_resume()
429 temp = ehci_readl(ehci, &ehci->regs->port_status[i]); in ehci_bus_resume()
433 spin_unlock_irq(&ehci->lock); in ehci_bus_resume()
435 spin_lock_irq(&ehci->lock); in ehci_bus_resume()
440 if (ehci->shutdown) in ehci_bus_resume()
443 /* clear phy low-power mode before resume */ in ehci_bus_resume()
444 if (ehci->bus_suspended && ehci->has_tdi_phy_lpm) { in ehci_bus_resume()
445 i = HCS_N_PORTS(ehci->hcs_params); in ehci_bus_resume()
446 while (i--) { in ehci_bus_resume()
447 if (test_bit(i, &ehci->bus_suspended)) { in ehci_bus_resume()
449 &ehci->regs->hostpc[i]; in ehci_bus_resume()
456 spin_unlock_irq(&ehci->lock); in ehci_bus_resume()
458 spin_lock_irq(&ehci->lock); in ehci_bus_resume()
459 if (ehci->shutdown) in ehci_bus_resume()
464 i = HCS_N_PORTS (ehci->hcs_params); in ehci_bus_resume()
465 while (i--) { in ehci_bus_resume()
466 temp = ehci_readl(ehci, &ehci->regs->port_status [i]); in ehci_bus_resume()
468 if (test_bit(i, &ehci->bus_suspended) && in ehci_bus_resume()
473 ehci_writel(ehci, temp, &ehci->regs->port_status [i]); in ehci_bus_resume()
481 spin_unlock_irq(&ehci->lock); in ehci_bus_resume()
483 spin_lock_irq(&ehci->lock); in ehci_bus_resume()
484 if (ehci->shutdown) in ehci_bus_resume()
488 i = HCS_N_PORTS (ehci->hcs_params); in ehci_bus_resume()
489 while (i--) { in ehci_bus_resume()
490 temp = ehci_readl(ehci, &ehci->regs->port_status [i]); in ehci_bus_resume()
493 ehci_writel(ehci, temp, &ehci->regs->port_status [i]); in ehci_bus_resume()
497 ehci->next_statechange = jiffies + msecs_to_jiffies(5); in ehci_bus_resume()
498 spin_unlock_irq(&ehci->lock); in ehci_bus_resume()
502 /* Now we can safely re-enable irqs */ in ehci_bus_resume()
503 spin_lock_irq(&ehci->lock); in ehci_bus_resume()
504 if (ehci->shutdown) in ehci_bus_resume()
506 ehci_writel(ehci, INTR_MASK, &ehci->regs->intr_enable); in ehci_bus_resume()
507 (void) ehci_readl(ehci, &ehci->regs->intr_enable); in ehci_bus_resume()
508 spin_unlock_irq(&ehci->lock); in ehci_bus_resume()
513 spin_unlock_irq(&ehci->lock); in ehci_bus_resume()
514 return -ESHUTDOWN; in ehci_bus_resume()
521 return ehci->resuming_ports; in ehci_get_resuming_ports()
532 /*-------------------------------------------------------------------------*/
543 status_reg = &ehci->regs->port_status[portnum]; in set_owner()
550 for (try = 4; try > 0; --try) { in set_owner()
551 spin_lock_irq(&ehci->lock); in set_owner()
562 spin_unlock_irq(&ehci->lock); in set_owner()
568 /*-------------------------------------------------------------------------*/
579 /* if reset finished and it's still not enabled -- handoff */ in check_reset_complete()
590 ehci_dbg (ehci, "port %d full speed --> companion\n", in check_reset_complete()
599 if (ehci->has_amcc_usb23) in check_reset_complete()
605 if (ehci->has_amcc_usb23) in check_reset_complete()
612 /*-------------------------------------------------------------------------*/
627 /* init status to no-changes */ in ehci_hub_status_data()
629 ports = HCS_N_PORTS (ehci->hcs_params); in ehci_hub_status_data()
635 /* Inform the core about resumes-in-progress by returning in ehci_hub_status_data()
636 * a non-zero value even if there are no status changes. in ehci_hub_status_data()
638 status = ehci->resuming_ports; in ehci_hub_status_data()
644 * PORT_POWER; that's surprising, but maybe within-spec. in ehci_hub_status_data()
646 if (!ignore_oc && !ehci->spurious_oc) in ehci_hub_status_data()
655 spin_lock_irqsave (&ehci->lock, flags); in ehci_hub_status_data()
657 /* get per-port change detect bits */ in ehci_hub_status_data()
658 if (ehci->has_ppcd) in ehci_hub_status_data()
659 ppcd = ehci_readl(ehci, &ehci->regs->status) >> 16; in ehci_hub_status_data()
662 /* leverage per-port change bits feature */ in ehci_hub_status_data()
664 temp = ehci_readl(ehci, &ehci->regs->port_status[i]); in ehci_hub_status_data()
671 * high-speed device is switched over to the companion in ehci_hub_status_data()
675 if ((temp & mask) != 0 || test_bit(i, &ehci->port_c_suspend) in ehci_hub_status_data()
676 || (ehci->reset_done[i] && time_after_eq( in ehci_hub_status_data()
677 jiffies, ehci->reset_done[i])) in ehci_hub_status_data()
682 buf [1] |= 1 << (i - 7); in ehci_hub_status_data()
687 /* If a resume is in progress, make sure it can finish */ in ehci_hub_status_data()
688 if (ehci->resuming_ports) in ehci_hub_status_data()
689 mod_timer(&hcd->rh_timer, jiffies + msecs_to_jiffies(25)); in ehci_hub_status_data()
691 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_hub_status_data()
695 /*-------------------------------------------------------------------------*/
702 int ports = HCS_N_PORTS (ehci->hcs_params); in ehci_hub_descriptor()
705 desc->bDescriptorType = USB_DT_HUB; in ehci_hub_descriptor()
706 desc->bPwrOn2PwrGood = 10; /* ehci 1.0, 2.3.9 says 20ms max */ in ehci_hub_descriptor()
707 desc->bHubContrCurrent = 0; in ehci_hub_descriptor()
709 desc->bNbrPorts = ports; in ehci_hub_descriptor()
711 desc->bDescLength = 7 + 2 * temp; in ehci_hub_descriptor()
714 memset(&desc->u.hs.DeviceRemovable[0], 0, temp); in ehci_hub_descriptor()
715 memset(&desc->u.hs.DeviceRemovable[temp], 0xff, temp); in ehci_hub_descriptor()
717 temp = HUB_CHAR_INDV_PORT_OCPM; /* per-port overcurrent reporting */ in ehci_hub_descriptor()
718 if (HCS_PPC (ehci->hcs_params)) in ehci_hub_descriptor()
719 temp |= HUB_CHAR_INDV_PORT_LPSM; /* per-port power control */ in ehci_hub_descriptor()
723 // re-enable when we support USB_PORT_FEAT_INDICATOR below. in ehci_hub_descriptor()
724 if (HCS_INDICATOR (ehci->hcs_params)) in ehci_hub_descriptor()
725 temp |= HUB_CHAR_PORTIND; /* per-port indicators (LEDs) */ in ehci_hub_descriptor()
727 desc->wHubCharacteristics = cpu_to_le16(temp); in ehci_hub_descriptor()
730 /*-------------------------------------------------------------------------*/
741 int ports = HCS_N_PORTS (ehci->hcs_params); in ehci_hub_control()
749 * Avoid out-of-bounds values while calculating the port index in ehci_hub_control()
753 temp = (wIndex - 1) & 0xff; in ehci_hub_control()
756 status_reg = &ehci->regs->port_status[temp]; in ehci_hub_control()
757 hostpc_reg = &ehci->regs->hostpc[temp]; in ehci_hub_control()
766 spin_lock_irqsave (&ehci->lock, flags); in ehci_hub_control()
772 /* no hub-wide feature/status flags */ in ehci_hub_control()
781 wIndex--; in ehci_hub_control()
788 * the port-change status bits (especially in ehci_hub_control()
802 if (ehci->no_selective_suspend) in ehci_hub_control()
805 if ((hcd->self.otg_port == (wIndex + 1)) in ehci_hub_control()
806 && hcd->self.b_hnp_enable) { in ehci_hub_control()
807 otg_start_hnp(hcd->usb_phy->otg); in ehci_hub_control()
816 /* clear phy low-power mode before resume */ in ehci_hub_control()
817 if (ehci->has_tdi_phy_lpm) { in ehci_hub_control()
821 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
822 msleep(5);/* wait to leave low-power mode */ in ehci_hub_control()
823 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
828 ehci->reset_done[wIndex] = jiffies in ehci_hub_control()
830 set_bit(wIndex, &ehci->resuming_ports); in ehci_hub_control()
831 usb_hcd_start_port_resume(&hcd->self, wIndex); in ehci_hub_control()
834 clear_bit(wIndex, &ehci->port_c_suspend); in ehci_hub_control()
837 if (HCS_PPC(ehci->hcs_params)) { in ehci_hub_control()
838 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
840 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
855 ehci_readl(ehci, &ehci->regs->command); /* unblock posted write */ in ehci_hub_control()
862 /* no hub-wide feature/status flags */ in ehci_hub_control()
869 wIndex--; in ehci_hub_control()
886 if ((temp & PORT_OCC) && (!ignore_oc && !ehci->spurious_oc)){ in ehci_hub_control()
890 * Hubs should disable port power on over-current. in ehci_hub_control()
892 * automatically, even if they _do_ support per-port in ehci_hub_control()
896 if (((temp & PORT_OC) || (ehci->need_oc_pp_cycle)) in ehci_hub_control()
897 && HCS_PPC(ehci->hcs_params)) { in ehci_hub_control()
898 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
900 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
906 if (!ehci->reset_done[wIndex]) { in ehci_hub_control()
911 ehci->reset_done[wIndex] = jiffies in ehci_hub_control()
913 usb_hcd_start_port_resume(&hcd->self, wIndex); in ehci_hub_control()
914 set_bit(wIndex, &ehci->resuming_ports); in ehci_hub_control()
916 mod_timer(&ehci_to_hcd(ehci)->rh_timer, in ehci_hub_control()
917 ehci->reset_done[wIndex]); in ehci_hub_control()
921 } else if (!time_after_eq(jiffies, ehci->reset_done[wIndex])) { in ehci_hub_control()
925 } else if (test_bit(wIndex, &ehci->resuming_ports)) { in ehci_hub_control()
926 clear_bit(wIndex, &ehci->suspended_ports); in ehci_hub_control()
927 set_bit(wIndex, &ehci->port_c_suspend); in ehci_hub_control()
928 ehci->reset_done[wIndex] = 0; in ehci_hub_control()
929 usb_hcd_end_port_resume(&hcd->self, wIndex); in ehci_hub_control()
934 clear_bit(wIndex, &ehci->resuming_ports); in ehci_hub_control()
947 ehci->reset_done [wIndex] = 0; in ehci_hub_control()
970 test_bit(wIndex, &ehci->companion_ports)) { in ehci_hub_control()
974 ehci_dbg(ehci, "port %d --> companion\n", wIndex + 1); in ehci_hub_control()
987 if (ehci->has_hostpc) { in ehci_hub_control()
999 } else if (test_bit(wIndex, &ehci->suspended_ports)) { in ehci_hub_control()
1000 clear_bit(wIndex, &ehci->suspended_ports); in ehci_hub_control()
1001 clear_bit(wIndex, &ehci->resuming_ports); in ehci_hub_control()
1002 ehci->reset_done[wIndex] = 0; in ehci_hub_control()
1004 set_bit(wIndex, &ehci->port_c_suspend); in ehci_hub_control()
1005 usb_hcd_end_port_resume(&hcd->self, wIndex); in ehci_hub_control()
1014 if (test_bit(wIndex, &ehci->port_c_suspend)) in ehci_hub_control()
1025 /* no hub-wide feature/status flags */ in ehci_hub_control()
1034 if (unlikely(ehci->debug)) { in ehci_hub_control()
1037 if (wIndex == HCS_DEBUG_PORT(ehci->hcs_params) && in ehci_hub_control()
1038 (readl(&ehci->debug->control) & DBGP_ENABLED)) { in ehci_hub_control()
1039 retval = -ENODEV; in ehci_hub_control()
1045 wIndex--; in ehci_hub_control()
1053 if (ehci->no_selective_suspend) in ehci_hub_control()
1066 if (ehci->has_tdi_phy_lpm) { in ehci_hub_control()
1067 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
1068 msleep(5);/* 5ms for HCD enter low pwr mode */ in ehci_hub_control()
1069 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
1074 ehci_dbg(ehci, "Port%d phy low pwr mode %s\n", in ehci_hub_control()
1079 /* 10ms for HCD enter suspend */ in ehci_hub_control()
1080 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
1082 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
1084 set_bit(wIndex, &ehci->suspended_ports); in ehci_hub_control()
1087 if (HCS_PPC(ehci->hcs_params)) { in ehci_hub_control()
1088 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
1090 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
1098 * transaction translator built in. in ehci_hub_control()
1104 "port %d low speed --> companion\n", in ehci_hub_control()
1115 ehci->reset_done [wIndex] = jiffies in ehci_hub_control()
1119 * Force full-speed connect for FSL high-speed in ehci_hub_control()
1132 * about the EHCI-specific stuff. in ehci_hub_control()
1137 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
1140 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
1146 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
1148 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
1150 /* Put all enabled ports into suspend */ in ehci_hub_control()
1151 while (ports--) { in ehci_hub_control()
1153 &ehci->regs->port_status[ports]; in ehci_hub_control()
1161 spin_unlock_irqrestore(&ehci->lock, flags); in ehci_hub_control()
1163 spin_lock_irqsave(&ehci->lock, flags); in ehci_hub_control()
1173 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */ in ehci_hub_control()
1179 retval = -EPIPE; in ehci_hub_control()
1182 spin_unlock_irqrestore (&ehci->lock, flags); in ehci_hub_control()
1193 set_owner(ehci, --portnum, PORT_OWNER); in ehci_relinquish_port()
1203 reg = &ehci->regs->port_status[portnum - 1]; in ehci_port_handed_over()
1210 u32 __iomem *status_reg = &ehci->regs->port_status[portnum]; in ehci_port_power()
1218 if (hcd->driver->port_power) in ehci_port_power()
1219 hcd->driver->port_power(hcd, portnum, enable); in ehci_port_power()