Lines Matching refs:hcd
42 typedef void (*companion_fn)(struct pci_dev *pdev, struct usb_hcd *hcd,
46 static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd, in for_each_companion() argument
75 fn(pdev, hcd, companion, companion_hcd); in for_each_companion()
85 static void ehci_pre_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_pre_add() argument
102 static void ehci_post_add(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_post_add() argument
111 companion_hcd->self.hs_companion = &hcd->self; in ehci_post_add()
123 static void non_ehci_add(struct pci_dev *pdev, struct usb_hcd *hcd, in non_ehci_add() argument
129 hcd->self.hs_companion = &companion_hcd->self; in non_ehci_add()
134 static void ehci_remove(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_remove() argument
144 static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd, in ehci_wait_for_companions() argument
177 struct usb_hcd *hcd; in usb_hcd_pci_probe() local
209 hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev)); in usb_hcd_pci_probe()
210 if (!hcd) { in usb_hcd_pci_probe()
215 hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) && in usb_hcd_pci_probe()
220 hcd->rsrc_start = pci_resource_start(dev, 0); in usb_hcd_pci_probe()
221 hcd->rsrc_len = pci_resource_len(dev, 0); in usb_hcd_pci_probe()
222 if (!devm_request_mem_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
223 hcd->rsrc_len, driver->description)) { in usb_hcd_pci_probe()
228 hcd->regs = devm_ioremap(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
229 hcd->rsrc_len); in usb_hcd_pci_probe()
230 if (hcd->regs == NULL) { in usb_hcd_pci_probe()
245 hcd->rsrc_start = pci_resource_start(dev, region); in usb_hcd_pci_probe()
246 hcd->rsrc_len = pci_resource_len(dev, region); in usb_hcd_pci_probe()
247 if (devm_request_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
248 hcd->rsrc_len, driver->description)) in usb_hcd_pci_probe()
263 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
264 for_each_companion(dev, hcd, ehci_pre_add); in usb_hcd_pci_probe()
265 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
268 for_each_companion(dev, hcd, ehci_post_add); in usb_hcd_pci_probe()
272 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
273 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
277 for_each_companion(dev, hcd, non_ehci_add); in usb_hcd_pci_probe()
283 device_wakeup_enable(hcd->self.controller); in usb_hcd_pci_probe()
290 usb_put_hcd(hcd); in usb_hcd_pci_probe()
319 struct usb_hcd *hcd; in usb_hcd_pci_remove() local
322 hcd = pci_get_drvdata(dev); in usb_hcd_pci_remove()
323 if (!hcd) in usb_hcd_pci_remove()
326 hcd_driver_flags = hcd->driver->flags; in usb_hcd_pci_remove()
336 usb_hcd_irq(0, hcd); in usb_hcd_pci_remove()
342 for_each_companion(dev, hcd, ehci_remove); in usb_hcd_pci_remove()
343 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
349 hcd->self.hs_companion = NULL; in usb_hcd_pci_remove()
350 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
354 usb_put_hcd(hcd); in usb_hcd_pci_remove()
367 struct usb_hcd *hcd; in usb_hcd_pci_shutdown() local
369 hcd = pci_get_drvdata(dev); in usb_hcd_pci_shutdown()
370 if (!hcd) in usb_hcd_pci_shutdown()
373 if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && in usb_hcd_pci_shutdown()
374 hcd->driver->shutdown) { in usb_hcd_pci_shutdown()
375 hcd->driver->shutdown(hcd); in usb_hcd_pci_shutdown()
376 if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0) in usb_hcd_pci_shutdown()
377 free_irq(hcd->irq, hcd); in usb_hcd_pci_shutdown()
408 struct usb_hcd *hcd = dev_get_drvdata(dev); in check_root_hub_suspended() local
410 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
414 if (hcd->shared_hcd) { in check_root_hub_suspended()
415 hcd = hcd->shared_hcd; in check_root_hub_suspended()
416 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
427 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in suspend_common() local
439 if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) { in suspend_common()
443 if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) in suspend_common()
445 if (do_wakeup && hcd->shared_hcd && in suspend_common()
446 HCD_WAKEUP_PENDING(hcd->shared_hcd)) in suspend_common()
448 retval = hcd->driver->pci_suspend(hcd, do_wakeup); in suspend_common()
449 suspend_report_result(hcd->driver->pci_suspend, retval); in suspend_common()
452 if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) || in suspend_common()
453 (retval == 0 && do_wakeup && hcd->shared_hcd && in suspend_common()
454 HCD_WAKEUP_PENDING(hcd->shared_hcd))) { in suspend_common()
455 if (hcd->driver->pci_resume) in suspend_common()
456 hcd->driver->pci_resume(hcd, false); in suspend_common()
467 if (!hcd->msix_enabled) in suspend_common()
482 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in resume_common() local
485 if (HCD_RH_RUNNING(hcd) || in resume_common()
486 (hcd->shared_hcd && in resume_common()
487 HCD_RH_RUNNING(hcd->shared_hcd))) { in resume_common()
500 if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) { in resume_common()
508 for_each_companion(pci_dev, hcd, in resume_common()
511 retval = hcd->driver->pci_resume(hcd, in resume_common()
515 usb_hc_died(hcd); in resume_common()
531 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in hcd_pci_suspend_noirq() local
544 if (HCD_DEAD(hcd)) in hcd_pci_suspend_noirq()