Lines Matching +full:remote +full:- +full:wakeup +full:- +full:connected
1 // SPDX-License-Identifier: GPL-2.0
5 * Extracted from uhci-hcd.c:
9 * (C) Copyright 1999-2002 Johannes Erdfelt, johannes@erdfelt.com
16 * support from usb-ohci.c by Adam Richter, adam@yggdrasil.com).
17 * (C) Copyright 1999 Gregory P. Smith (from usb-ohci.c)
18 * (C) Copyright 2004-2007 Alan Stern, stern@rowland.harvard.edu
21 #include "pci-quirks.h"
29 uhci_reset_hc(to_pci_dev(uhci_dev(uhci)), uhci->io_addr); in uhci_pci_reset_hc()
41 uhci->io_addr); in uhci_pci_check_and_reset_hc()
46 * This function is called at the end of configure_hc in uhci-hcd.c.
55 /* Disable platform-specific non-PME# wakeup */ in uhci_pci_configure_hc()
56 if (pdev->vendor == PCI_VENDOR_ID_INTEL) in uhci_pci_configure_hc()
64 switch (to_pci_dev(uhci_dev(uhci))->vendor) { in uhci_pci_resume_detect_interrupts_are_broken()
70 * resume-detect interrupts. in uhci_pci_resume_detect_interrupts_are_broken()
76 * resume-detect interrupts if any port has an over-current in uhci_pci_resume_detect_interrupts_are_broken()
78 * hardwire unused USB ports' over-current inputs active! in uhci_pci_resume_detect_interrupts_are_broken()
79 * To prevent problems, we will not enable resume-detect in uhci_pci_resume_detect_interrupts_are_broken()
82 for (port = 0; port < uhci->rh_numports; ++port) { in uhci_pci_resume_detect_interrupts_are_broken()
83 if (inw(uhci->io_addr + USBPORTSC1 + port * 2) & in uhci_pci_resume_detect_interrupts_are_broken()
99 * wake up immediately from suspend-to-RAM if any of the ports in uhci_pci_global_suspend_mode_is_broken()
100 * are connected. In such cases we will not set EGSM. in uhci_pci_global_suspend_mode_is_broken()
104 for (port = 0; port < uhci->rh_numports; ++port) { in uhci_pci_global_suspend_mode_is_broken()
105 if (inw(uhci->io_addr + USBPORTSC1 + port * 2) & in uhci_pci_global_suspend_mode_is_broken()
118 uhci->io_addr = (unsigned long) hcd->rsrc_start; in uhci_pci_init()
120 uhci->rh_numports = uhci_count_ports(hcd); in uhci_pci_init()
126 if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA) in uhci_pci_init()
127 uhci->oc_low = 1; in uhci_pci_init()
130 if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_HP) in uhci_pci_init()
131 uhci->wait_for_hp = 1; in uhci_pci_init()
133 /* Intel controllers use non-PME wakeup signalling */ in uhci_pci_init()
134 if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_INTEL) in uhci_pci_init()
137 /* Set up pointers to PCI-specific functions */ in uhci_pci_init()
138 uhci->reset_hc = uhci_pci_reset_hc; in uhci_pci_init()
139 uhci->check_and_reset_hc = uhci_pci_check_and_reset_hc; in uhci_pci_init()
140 uhci->configure_hc = uhci_pci_configure_hc; in uhci_pci_init()
141 uhci->resume_detect_interrupts_are_broken = in uhci_pci_init()
143 uhci->global_suspend_mode_is_broken = in uhci_pci_init()
180 spin_lock_irq(&uhci->lock); in uhci_pci_suspend()
181 if (!HCD_HW_ACCESSIBLE(hcd) || uhci->dead) in uhci_pci_suspend()
188 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); in uhci_pci_suspend()
190 /* Enable platform-specific non-PME# wakeup */ in uhci_pci_suspend()
192 if (pdev->vendor == PCI_VENDOR_ID_INTEL) in uhci_pci_suspend()
198 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in uhci_pci_suspend()
199 spin_unlock_irq(&uhci->lock); in uhci_pci_suspend()
201 synchronize_irq(hcd->irq); in uhci_pci_suspend()
203 /* Check for race with a wakeup request */ in uhci_pci_suspend()
206 rc = -EBUSY; in uhci_pci_suspend()
220 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in uhci_pci_resume()
222 spin_lock_irq(&uhci->lock); in uhci_pci_resume()
224 /* Make sure resume from hibernation re-enumerates everything */ in uhci_pci_resume()
226 uhci->reset_hc(uhci); in uhci_pci_resume()
231 * a system wakeup. Check it and reconfigure to avoid problems. in uhci_pci_resume()
239 if (uhci->rh_state == UHCI_RH_RESET) in uhci_pci_resume()
240 usb_root_hub_lost_power(hcd->self.root_hub); in uhci_pci_resume()
242 spin_unlock_irq(&uhci->lock); in uhci_pci_resume()
244 /* If interrupts don't work and remote wakeup is enabled then in uhci_pci_resume()
247 if (!uhci->RD_enable && hcd->self.root_hub->do_remote_wakeup) in uhci_pci_resume()
248 set_bit(HCD_FLAG_POLL_RH, &hcd->flags); in uhci_pci_resume()
250 /* Does the root hub have a port wakeup pending? */ in uhci_pci_resume()