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
175 struct usb_hcd *hcd; in usb_hcd_pci_probe() local
206 hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev)); in usb_hcd_pci_probe()
207 if (!hcd) { in usb_hcd_pci_probe()
212 hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) && in usb_hcd_pci_probe()
217 hcd->rsrc_start = pci_resource_start(dev, 0); in usb_hcd_pci_probe()
218 hcd->rsrc_len = pci_resource_len(dev, 0); in usb_hcd_pci_probe()
219 if (!devm_request_mem_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
220 hcd->rsrc_len, driver->description)) { in usb_hcd_pci_probe()
225 hcd->regs = devm_ioremap_nocache(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
226 hcd->rsrc_len); in usb_hcd_pci_probe()
227 if (hcd->regs == NULL) { in usb_hcd_pci_probe()
242 hcd->rsrc_start = pci_resource_start(dev, region); in usb_hcd_pci_probe()
243 hcd->rsrc_len = pci_resource_len(dev, region); in usb_hcd_pci_probe()
244 if (devm_request_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
245 hcd->rsrc_len, driver->description)) in usb_hcd_pci_probe()
260 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
261 for_each_companion(dev, hcd, ehci_pre_add); in usb_hcd_pci_probe()
262 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
265 for_each_companion(dev, hcd, ehci_post_add); in usb_hcd_pci_probe()
269 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
270 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
274 for_each_companion(dev, hcd, non_ehci_add); in usb_hcd_pci_probe()
280 device_wakeup_enable(hcd->self.controller); in usb_hcd_pci_probe()
287 usb_put_hcd(hcd); in usb_hcd_pci_probe()
312 struct usb_hcd *hcd; in usb_hcd_pci_remove() local
314 hcd = pci_get_drvdata(dev); in usb_hcd_pci_remove()
315 if (!hcd) in usb_hcd_pci_remove()
326 usb_hcd_irq(0, hcd); in usb_hcd_pci_remove()
332 for_each_companion(dev, hcd, ehci_remove); in usb_hcd_pci_remove()
333 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
339 hcd->self.hs_companion = NULL; in usb_hcd_pci_remove()
340 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
344 usb_put_hcd(hcd); in usb_hcd_pci_remove()
355 struct usb_hcd *hcd; in usb_hcd_pci_shutdown() local
357 hcd = pci_get_drvdata(dev); in usb_hcd_pci_shutdown()
358 if (!hcd) in usb_hcd_pci_shutdown()
361 if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && in usb_hcd_pci_shutdown()
362 hcd->driver->shutdown) { in usb_hcd_pci_shutdown()
363 hcd->driver->shutdown(hcd); in usb_hcd_pci_shutdown()
364 if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0) in usb_hcd_pci_shutdown()
365 free_irq(hcd->irq, hcd); in usb_hcd_pci_shutdown()
396 struct usb_hcd *hcd = dev_get_drvdata(dev); in check_root_hub_suspended() local
398 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
402 if (hcd->shared_hcd) { in check_root_hub_suspended()
403 hcd = hcd->shared_hcd; in check_root_hub_suspended()
404 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
415 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in suspend_common() local
427 if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) { in suspend_common()
431 if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) in suspend_common()
433 if (do_wakeup && hcd->shared_hcd && in suspend_common()
434 HCD_WAKEUP_PENDING(hcd->shared_hcd)) in suspend_common()
436 retval = hcd->driver->pci_suspend(hcd, do_wakeup); in suspend_common()
437 suspend_report_result(hcd->driver->pci_suspend, retval); in suspend_common()
440 if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) || in suspend_common()
441 (retval == 0 && do_wakeup && hcd->shared_hcd && in suspend_common()
442 HCD_WAKEUP_PENDING(hcd->shared_hcd))) { in suspend_common()
443 if (hcd->driver->pci_resume) in suspend_common()
444 hcd->driver->pci_resume(hcd, false); in suspend_common()
455 if (!hcd->msix_enabled) in suspend_common()
470 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in resume_common() local
473 if (HCD_RH_RUNNING(hcd) || in resume_common()
474 (hcd->shared_hcd && in resume_common()
475 HCD_RH_RUNNING(hcd->shared_hcd))) { in resume_common()
488 if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) { in resume_common()
496 for_each_companion(pci_dev, hcd, in resume_common()
499 retval = hcd->driver->pci_resume(hcd, in resume_common()
503 usb_hc_died(hcd); in resume_common()
519 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in hcd_pci_suspend_noirq() local
532 if (HCD_DEAD(hcd)) in hcd_pci_suspend_noirq()