Lines Matching full:hcd

10 #include <linux/usb/hcd.h>
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
161 * @id: pci hotplug id connecting controller to HCD framework
166 * then invokes the start() method for the HCD associated with it
169 * Store this function in the HCD's struct pci_driver as probe().
176 struct usb_hcd *hcd; in usb_hcd_pci_probe() local
194 * make sure irq setup is not touched for xhci in generic hcd code in usb_hcd_pci_probe()
208 hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev)); in usb_hcd_pci_probe()
209 if (!hcd) { in usb_hcd_pci_probe()
214 hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) && in usb_hcd_pci_probe()
219 hcd->rsrc_start = pci_resource_start(dev, 0); in usb_hcd_pci_probe()
220 hcd->rsrc_len = pci_resource_len(dev, 0); in usb_hcd_pci_probe()
221 if (!devm_request_mem_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
222 hcd->rsrc_len, driver->description)) { in usb_hcd_pci_probe()
227 hcd->regs = devm_ioremap(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
228 hcd->rsrc_len); in usb_hcd_pci_probe()
229 if (hcd->regs == NULL) { in usb_hcd_pci_probe()
244 hcd->rsrc_start = pci_resource_start(dev, region); in usb_hcd_pci_probe()
245 hcd->rsrc_len = pci_resource_len(dev, region); in usb_hcd_pci_probe()
246 if (devm_request_region(&dev->dev, hcd->rsrc_start, in usb_hcd_pci_probe()
247 hcd->rsrc_len, driver->description)) in usb_hcd_pci_probe()
262 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
263 for_each_companion(dev, hcd, ehci_pre_add); in usb_hcd_pci_probe()
264 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
267 for_each_companion(dev, hcd, ehci_post_add); in usb_hcd_pci_probe()
271 dev_set_drvdata(&dev->dev, hcd); in usb_hcd_pci_probe()
272 retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED); in usb_hcd_pci_probe()
276 for_each_companion(dev, hcd, non_ehci_add); in usb_hcd_pci_probe()
282 device_wakeup_enable(hcd->self.controller); in usb_hcd_pci_probe()
289 usb_put_hcd(hcd); in usb_hcd_pci_probe()
310 * the HCD's stop() method. It is always called from a thread
313 * Store this function in the HCD's struct pci_driver as remove().
317 struct usb_hcd *hcd; in usb_hcd_pci_remove() local
320 hcd = pci_get_drvdata(dev); in usb_hcd_pci_remove()
321 if (!hcd) in usb_hcd_pci_remove()
324 hcd_driver_flags = hcd->driver->flags; in usb_hcd_pci_remove()
334 usb_hcd_irq(0, hcd); in usb_hcd_pci_remove()
340 for_each_companion(dev, hcd, ehci_remove); in usb_hcd_pci_remove()
341 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
347 hcd->self.hs_companion = NULL; in usb_hcd_pci_remove()
348 usb_remove_hcd(hcd); in usb_hcd_pci_remove()
352 usb_put_hcd(hcd); in usb_hcd_pci_remove()
365 struct usb_hcd *hcd; in usb_hcd_pci_shutdown() local
367 hcd = pci_get_drvdata(dev); in usb_hcd_pci_shutdown()
368 if (!hcd) in usb_hcd_pci_shutdown()
371 if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && in usb_hcd_pci_shutdown()
372 hcd->driver->shutdown) { in usb_hcd_pci_shutdown()
373 hcd->driver->shutdown(hcd); in usb_hcd_pci_shutdown()
374 if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0) in usb_hcd_pci_shutdown()
375 free_irq(hcd->irq, hcd); in usb_hcd_pci_shutdown()
406 struct usb_hcd *hcd = dev_get_drvdata(dev); in check_root_hub_suspended() local
408 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
412 if (hcd->shared_hcd) { in check_root_hub_suspended()
413 hcd = hcd->shared_hcd; in check_root_hub_suspended()
414 if (HCD_RH_RUNNING(hcd)) { in check_root_hub_suspended()
425 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in suspend_common() local
437 if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) { in suspend_common()
439 * pending and it would cause the HCD to wake up anyway. in suspend_common()
441 if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) in suspend_common()
443 if (do_wakeup && hcd->shared_hcd && in suspend_common()
444 HCD_WAKEUP_PENDING(hcd->shared_hcd)) in suspend_common()
446 retval = hcd->driver->pci_suspend(hcd, do_wakeup); in suspend_common()
447 suspend_report_result(hcd->driver->pci_suspend, retval); in suspend_common()
450 if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) || in suspend_common()
451 (retval == 0 && do_wakeup && hcd->shared_hcd && in suspend_common()
452 HCD_WAKEUP_PENDING(hcd->shared_hcd))) { in suspend_common()
453 if (hcd->driver->pci_resume) in suspend_common()
454 hcd->driver->pci_resume(hcd, false); in suspend_common()
465 if (!hcd->msix_enabled) in suspend_common()
480 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in resume_common() local
483 if (HCD_RH_RUNNING(hcd) || in resume_common()
484 (hcd->shared_hcd && in resume_common()
485 HCD_RH_RUNNING(hcd->shared_hcd))) { in resume_common()
498 if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) { in resume_common()
506 for_each_companion(pci_dev, hcd, in resume_common()
509 retval = hcd->driver->pci_resume(hcd, in resume_common()
513 usb_hc_died(hcd); in resume_common()
529 struct usb_hcd *hcd = pci_get_drvdata(pci_dev); in hcd_pci_suspend_noirq() local
542 if (HCD_DEAD(hcd)) in hcd_pci_suspend_noirq()