Lines Matching refs:hcd
55 typedef void (*companion_fn)(struct pci_dev *pdev, struct usb_hcd *hcd,
59 static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd, in for_each_companion() argument
88 fn(pdev, hcd, companion, companion_hcd); in for_each_companion()
98 static void ehci_pre_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_pre_add() argument
115 static void ehci_post_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_post_add() argument
124 companion_hcd->self.hs_companion = &hcd->self; in ehci_post_add()
136 static void non_ehci_add(struct pci_dev *pdev, struct usb_hcd *hcd, in non_ehci_add() argument
142 hcd->self.hs_companion = &companion_hcd->self; in non_ehci_add()
147 static void ehci_remove(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_remove() argument
157 static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_wait_for_companions() argument
188 struct usb_hcd *hcd; in usb_hcd_pci_probe() local
219 hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev)); in usb_hcd_pci_probe()
220 if (!hcd) { in usb_hcd_pci_probe()
225 hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) && in usb_hcd_pci_probe()
230 hcd->rsrc_start = pci_resource_start(dev, 0); in usb_hcd_pci_probe()
231 hcd->rsrc_len = pci_resource_len(dev, 0); in usb_hcd_pci_probe()
232 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, in usb_hcd_pci_probe()
238 hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_probe()
239 if (hcd->regs == NULL) { in usb_hcd_pci_probe()
254 hcd->rsrc_start = pci_resource_start(dev, region); in usb_hcd_pci_probe()
255 hcd->rsrc_len = pci_resource_len(dev, region); in usb_hcd_pci_probe()
256 if (request_region(hcd->rsrc_start, hcd->rsrc_len, in usb_hcd_pci_probe()
272 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
273 for_each_companion(dev, hcd, ehci_pre_add); in usb_hcd_pci_probe()
274 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
277 for_each_companion(dev, hcd, ehci_post_add); in usb_hcd_pci_probe()
281 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
282 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
286 for_each_companion(dev, hcd, non_ehci_add); in usb_hcd_pci_probe()
292 device_wakeup_enable(hcd->self.controller); in usb_hcd_pci_probe()
300 iounmap(hcd->regs); in usb_hcd_pci_probe()
302 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_probe()
304 release_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_probe()
306 usb_put_hcd(hcd); in usb_hcd_pci_probe()
331 struct usb_hcd *hcd; in usb_hcd_pci_remove() local
333 hcd = pci_get_drvdata(dev); in usb_hcd_pci_remove()
334 if (!hcd) in usb_hcd_pci_remove()
345 usb_hcd_irq(0, hcd); in usb_hcd_pci_remove()
351 for_each_companion(dev, hcd, ehci_remove); in usb_hcd_pci_remove()
352 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
358 hcd->self.hs_companion = NULL; in usb_hcd_pci_remove()
359 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
364 if (hcd->driver->flags & HCD_MEMORY) { in usb_hcd_pci_remove()
365 iounmap(hcd->regs); in usb_hcd_pci_remove()
366 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_remove()
368 release_region(hcd->rsrc_start, hcd->rsrc_len); in usb_hcd_pci_remove()
371 usb_put_hcd(hcd); in usb_hcd_pci_remove()
382 struct usb_hcd *hcd; in usb_hcd_pci_shutdown() local
384 hcd = pci_get_drvdata(dev); in usb_hcd_pci_shutdown()
385 if (!hcd) in usb_hcd_pci_shutdown()
388 if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && in usb_hcd_pci_shutdown()
389 hcd->driver->shutdown) { in usb_hcd_pci_shutdown()
390 hcd->driver->shutdown(hcd); in usb_hcd_pci_shutdown()
391 if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0) in usb_hcd_pci_shutdown()
392 free_irq(hcd->irq, hcd); in usb_hcd_pci_shutdown()
424 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in check_root_hub_suspended() local
426 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
430 if (hcd->shared_hcd) { in check_root_hub_suspended()
431 hcd = hcd->shared_hcd; in check_root_hub_suspended()
432 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
443 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in suspend_common() local
455 if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) { in suspend_common()
459 if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) in suspend_common()
461 if (do_wakeup && hcd->shared_hcd && in suspend_common()
462 HCD_WAKEUP_PENDING(hcd->shared_hcd)) in suspend_common()
464 retval = hcd->driver->pci_suspend(hcd, do_wakeup); in suspend_common()
465 suspend_report_result(hcd->driver->pci_suspend, retval); in suspend_common()
468 if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) || in suspend_common()
469 (retval == 0 && do_wakeup && hcd->shared_hcd && in suspend_common()
470 HCD_WAKEUP_PENDING(hcd->shared_hcd))) { in suspend_common()
471 if (hcd->driver->pci_resume) in suspend_common()
472 hcd->driver->pci_resume(hcd, false); in suspend_common()
483 if (!hcd->msix_enabled) in suspend_common()
498 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in resume_common() local
501 if (HCD_RH_RUNNING(hcd) || in resume_common()
502 (hcd->shared_hcd && in resume_common()
503 HCD_RH_RUNNING(hcd->shared_hcd))) { in resume_common()
516 if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) { in resume_common()
524 for_each_companion(pci_dev, hcd, in resume_common()
527 retval = hcd->driver->pci_resume(hcd, in resume_common()
531 if (hcd->shared_hcd) in resume_common()
532 usb_hc_died(hcd->shared_hcd); in resume_common()
533 usb_hc_died(hcd); in resume_common()
549 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in hcd_pci_suspend_noirq() local
562 if (HCD_DEAD(hcd)) in hcd_pci_suspend_noirq()