Lines Matching refs:hcd
56 typedef void (*companion_fn)(struct pci_dev *pdev, struct usb_hcd *hcd,
60 static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd, in for_each_companion() argument
89 fn(pdev, hcd, companion, companion_hcd); in for_each_companion()
99 static void ehci_pre_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_pre_add() argument
116 static void ehci_post_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_post_add() argument
125 companion_hcd->self.hs_companion = &hcd->self; in ehci_post_add()
137 static void non_ehci_add(struct pci_dev *pdev, struct usb_hcd *hcd, in non_ehci_add() argument
143 hcd->self.hs_companion = &companion_hcd->self; in non_ehci_add()
148 static void ehci_remove(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_remove() argument
158 static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_wait_for_companions() argument
189 struct usb_hcd *hcd; in usb_hcd_pci_probe() local
220 hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev)); in usb_hcd_pci_probe()
221 if (!hcd) { in usb_hcd_pci_probe()
226 hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) && in usb_hcd_pci_probe()
231 hcd->rsrc_start = pci_resource_start(dev, 0); in usb_hcd_pci_probe()
232 hcd->rsrc_len = pci_resource_len(dev, 0); in usb_hcd_pci_probe()
233 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, in usb_hcd_pci_probe()
239 hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_probe()
240 if (hcd->regs == NULL) { in usb_hcd_pci_probe()
255 hcd->rsrc_start = pci_resource_start(dev, region); in usb_hcd_pci_probe()
256 hcd->rsrc_len = pci_resource_len(dev, region); in usb_hcd_pci_probe()
257 if (request_region(hcd->rsrc_start, hcd->rsrc_len, in usb_hcd_pci_probe()
273 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
274 for_each_companion(dev, hcd, ehci_pre_add); in usb_hcd_pci_probe()
275 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
278 for_each_companion(dev, hcd, ehci_post_add); in usb_hcd_pci_probe()
282 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
283 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
287 for_each_companion(dev, hcd, non_ehci_add); in usb_hcd_pci_probe()
293 device_wakeup_enable(hcd->self.controller); in usb_hcd_pci_probe()
301 iounmap(hcd->regs); in usb_hcd_pci_probe()
303 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_probe()
305 release_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_probe()
307 usb_put_hcd(hcd); in usb_hcd_pci_probe()
332 struct usb_hcd *hcd; in usb_hcd_pci_remove() local
334 hcd = pci_get_drvdata(dev); in usb_hcd_pci_remove()
335 if (!hcd) in usb_hcd_pci_remove()
346 usb_hcd_irq(0, hcd); in usb_hcd_pci_remove()
352 for_each_companion(dev, hcd, ehci_remove); in usb_hcd_pci_remove()
353 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
359 hcd->self.hs_companion = NULL; in usb_hcd_pci_remove()
360 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
365 if (hcd->driver->flags & HCD_MEMORY) { in usb_hcd_pci_remove()
366 iounmap(hcd->regs); in usb_hcd_pci_remove()
367 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_remove()
369 release_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_remove()
372 usb_put_hcd(hcd); in usb_hcd_pci_remove()
383 struct usb_hcd *hcd; in usb_hcd_pci_shutdown() local
385 hcd = pci_get_drvdata(dev); in usb_hcd_pci_shutdown()
386 if (!hcd) in usb_hcd_pci_shutdown()
389 if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && in usb_hcd_pci_shutdown()
390 hcd->driver->shutdown) { in usb_hcd_pci_shutdown()
391 hcd->driver->shutdown(hcd); in usb_hcd_pci_shutdown()
392 if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0) in usb_hcd_pci_shutdown()
393 free_irq(hcd->irq, hcd); in usb_hcd_pci_shutdown()
425 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in check_root_hub_suspended() local
427 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
431 if (hcd->shared_hcd) { in check_root_hub_suspended()
432 hcd = hcd->shared_hcd; in check_root_hub_suspended()
433 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
444 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in suspend_common() local
456 if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) { in suspend_common()
460 if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) in suspend_common()
462 if (do_wakeup && hcd->shared_hcd && in suspend_common()
463 HCD_WAKEUP_PENDING(hcd->shared_hcd)) in suspend_common()
465 retval = hcd->driver->pci_suspend(hcd, do_wakeup); in suspend_common()
466 suspend_report_result(hcd->driver->pci_suspend, retval); in suspend_common()
469 if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) || in suspend_common()
470 (retval == 0 && do_wakeup && hcd->shared_hcd && in suspend_common()
471 HCD_WAKEUP_PENDING(hcd->shared_hcd))) { in suspend_common()
472 if (hcd->driver->pci_resume) in suspend_common()
473 hcd->driver->pci_resume(hcd, false); in suspend_common()
484 if (!hcd->msix_enabled) in suspend_common()
499 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in resume_common() local
502 if (HCD_RH_RUNNING(hcd) || in resume_common()
503 (hcd->shared_hcd && in resume_common()
504 HCD_RH_RUNNING(hcd->shared_hcd))) { in resume_common()
517 if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) { in resume_common()
525 for_each_companion(pci_dev, hcd, in resume_common()
528 retval = hcd->driver->pci_resume(hcd, in resume_common()
532 if (hcd->shared_hcd) in resume_common()
533 usb_hc_died(hcd->shared_hcd); in resume_common()
534 usb_hc_died(hcd); in resume_common()
550 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in hcd_pci_suspend_noirq() local
563 if (HCD_DEAD(hcd)) in hcd_pci_suspend_noirq()