Lines Matching full:hcd
10 #include <linux/usb/hcd.h>
41 typedef void (*companion_fn)(struct pci_dev *pdev, struct usb_hcd *hcd,
45 static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd, in for_each_companion() argument
74 fn(pdev, hcd, companion, companion_hcd); in for_each_companion()
84 static void ehci_pre_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_pre_add() argument
101 static void ehci_post_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_post_add() argument
110 companion_hcd->self.hs_companion = &hcd->self; in ehci_post_add()
122 static void non_ehci_add(struct pci_dev *pdev, struct usb_hcd *hcd, in non_ehci_add() argument
128 hcd->self.hs_companion = &companion_hcd->self; in non_ehci_add()
133 static void ehci_remove(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_remove() argument
143 static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_wait_for_companions() argument
165 * then invokes the start() method for the HCD associated with it
168 * Store this function in the HCD's struct pci_driver as probe().
174 struct usb_hcd *hcd; in usb_hcd_pci_probe() local
189 * make sure irq setup is not touched for xhci in generic hcd code in usb_hcd_pci_probe()
203 hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev)); in usb_hcd_pci_probe()
204 if (!hcd) { in usb_hcd_pci_probe()
209 hcd->amd_resume_bug = usb_hcd_amd_resume_bug(dev, driver); in usb_hcd_pci_probe()
213 hcd->rsrc_start = pci_resource_start(dev, 0); in usb_hcd_pci_probe()
214 hcd->rsrc_len = pci_resource_len(dev, 0); in usb_hcd_pci_probe()
215 if (!devm_request_mem_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
216 hcd->rsrc_len, driver->description)) { in usb_hcd_pci_probe()
221 hcd->regs = devm_ioremap(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
222 hcd->rsrc_len); in usb_hcd_pci_probe()
223 if (hcd->regs == NULL) { in usb_hcd_pci_probe()
238 hcd->rsrc_start = pci_resource_start(dev, region); in usb_hcd_pci_probe()
239 hcd->rsrc_len = pci_resource_len(dev, region); in usb_hcd_pci_probe()
240 if (devm_request_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
241 hcd->rsrc_len, driver->description)) in usb_hcd_pci_probe()
256 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
257 for_each_companion(dev, hcd, ehci_pre_add); in usb_hcd_pci_probe()
258 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
261 for_each_companion(dev, hcd, ehci_post_add); in usb_hcd_pci_probe()
265 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
266 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
270 for_each_companion(dev, hcd, non_ehci_add); in usb_hcd_pci_probe()
276 device_wakeup_enable(hcd->self.controller); in usb_hcd_pci_probe()
283 usb_put_hcd(hcd); in usb_hcd_pci_probe()
305 * the HCD's stop() method. It is always called from a thread
308 * Store this function in the HCD's struct pci_driver as remove().
312 struct usb_hcd *hcd; in usb_hcd_pci_remove() local
315 hcd = pci_get_drvdata(dev); in usb_hcd_pci_remove()
316 if (!hcd) in usb_hcd_pci_remove()
319 hcd_driver_flags = hcd->driver->flags; in usb_hcd_pci_remove()
329 usb_hcd_irq(0, hcd); in usb_hcd_pci_remove()
335 for_each_companion(dev, hcd, ehci_remove); in usb_hcd_pci_remove()
336 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
342 hcd->self.hs_companion = NULL; in usb_hcd_pci_remove()
343 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
347 usb_put_hcd(hcd); in usb_hcd_pci_remove()
360 struct usb_hcd *hcd; in usb_hcd_pci_shutdown() local
362 hcd = pci_get_drvdata(dev); in usb_hcd_pci_shutdown()
363 if (!hcd) in usb_hcd_pci_shutdown()
366 if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && in usb_hcd_pci_shutdown()
367 hcd->driver->shutdown) { in usb_hcd_pci_shutdown()
368 hcd->driver->shutdown(hcd); in usb_hcd_pci_shutdown()
369 if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0) in usb_hcd_pci_shutdown()
370 free_irq(hcd->irq, hcd); in usb_hcd_pci_shutdown()
401 struct usb_hcd *hcd = dev_get_drvdata(dev); in check_root_hub_suspended() local
403 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
407 if (hcd->shared_hcd) { in check_root_hub_suspended()
408 hcd = hcd->shared_hcd; in check_root_hub_suspended()
409 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
420 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in suspend_common() local
435 if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) { in suspend_common()
437 * pending and it would cause the HCD to wake up anyway. in suspend_common()
439 if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) in suspend_common()
441 if (do_wakeup && hcd->shared_hcd && in suspend_common()
442 HCD_WAKEUP_PENDING(hcd->shared_hcd)) in suspend_common()
444 retval = hcd->driver->pci_suspend(hcd, do_wakeup); in suspend_common()
445 suspend_report_result(dev, hcd->driver->pci_suspend, retval); in suspend_common()
448 if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) || in suspend_common()
449 (retval == 0 && do_wakeup && hcd->shared_hcd && in suspend_common()
450 HCD_WAKEUP_PENDING(hcd->shared_hcd))) { in suspend_common()
451 if (hcd->driver->pci_resume) in suspend_common()
452 hcd->driver->pci_resume(hcd, msg); in suspend_common()
463 if (!hcd->msix_enabled) in suspend_common()
478 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in resume_common() local
481 if (HCD_RH_RUNNING(hcd) || in resume_common()
482 (hcd->shared_hcd && in resume_common()
483 HCD_RH_RUNNING(hcd->shared_hcd))) { in resume_common()
496 if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) { in resume_common()
504 for_each_companion(pci_dev, hcd, in resume_common()
507 retval = hcd->driver->pci_resume(hcd, msg); in resume_common()
510 usb_hc_died(hcd); in resume_common()
526 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in hcd_pci_suspend_noirq() local
539 if (HCD_DEAD(hcd)) in hcd_pci_suspend_noirq()
565 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in hcd_pci_poweroff_late() local
567 if (hcd->driver->pci_poweroff_late && !HCD_DEAD(hcd)) in hcd_pci_poweroff_late()
568 return hcd->driver->pci_poweroff_late(hcd, device_may_wakeup(dev)); in hcd_pci_poweroff_late()