hcd-pci.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright David Brownell 2000-2002
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/module.h>
  7. #include <linux/pci.h>
  8. #include <linux/usb.h>
  9. #include <linux/usb/hcd.h>
  10. #include <asm/io.h>
  11. #include <asm/irq.h>
  12. #ifdef CONFIG_PPC_PMAC
  13. #include <asm/machdep.h>
  14. #include <asm/pmac_feature.h>
  15. #include <asm/prom.h>
  16. #endif
  17. #include "usb.h"
  18. /* PCI-based HCs are common, but plenty of non-PCI HCs are used too */
  19. /*
  20. * Coordinate handoffs between EHCI and companion controllers
  21. * during EHCI probing and system resume.
  22. */
  23. static DECLARE_RWSEM(companions_rwsem);
  24. #define CL_UHCI PCI_CLASS_SERIAL_USB_UHCI
  25. #define CL_OHCI PCI_CLASS_SERIAL_USB_OHCI
  26. #define CL_EHCI PCI_CLASS_SERIAL_USB_EHCI
  27. static inline int is_ohci_or_uhci(struct pci_dev *pdev)
  28. {
  29. return pdev->class == CL_OHCI || pdev->class == CL_UHCI;
  30. }
  31. typedef void (*companion_fn)(struct pci_dev *pdev, struct usb_hcd *hcd,
  32. struct pci_dev *companion, struct usb_hcd *companion_hcd);
  33. /* Iterate over PCI devices in the same slot as pdev and call fn for each */
  34. static void for_each_companion(struct pci_dev *pdev, struct usb_hcd *hcd,
  35. companion_fn fn)
  36. {
  37. struct pci_dev *companion;
  38. struct usb_hcd *companion_hcd;
  39. unsigned int slot = PCI_SLOT(pdev->devfn);
  40. /*
  41. * Iterate through other PCI functions in the same slot.
  42. * If the function's drvdata isn't set then it isn't bound to
  43. * a USB host controller driver, so skip it.
  44. */
  45. companion = NULL;
  46. for_each_pci_dev(companion) {
  47. if (companion->bus != pdev->bus ||
  48. PCI_SLOT(companion->devfn) != slot)
  49. continue;
  50. /*
  51. * Companion device should be either UHCI,OHCI or EHCI host
  52. * controller, otherwise skip.
  53. */
  54. if (companion->class != CL_UHCI && companion->class != CL_OHCI &&
  55. companion->class != CL_EHCI)
  56. continue;
  57. companion_hcd = pci_get_drvdata(companion);
  58. if (!companion_hcd || !companion_hcd->self.root_hub)
  59. continue;
  60. fn(pdev, hcd, companion, companion_hcd);
  61. }
  62. }
  63. /*
  64. * We're about to add an EHCI controller, which will unceremoniously grab
  65. * all the port connections away from its companions. To prevent annoying
  66. * error messages, lock the companion's root hub and gracefully unconfigure
  67. * it beforehand. Leave it locked until the EHCI controller is all set.
  68. */
  69. static void ehci_pre_add(struct pci_dev *pdev, struct usb_hcd *hcd,
  70. struct pci_dev *companion, struct usb_hcd *companion_hcd)
  71. {
  72. struct usb_device *udev;
  73. if (is_ohci_or_uhci(companion)) {
  74. udev = companion_hcd->self.root_hub;
  75. usb_lock_device(udev);
  76. usb_set_configuration(udev, 0);
  77. }
  78. }
  79. /*
  80. * Adding the EHCI controller has either succeeded or failed. Set the
  81. * companion pointer accordingly, and in either case, reconfigure and
  82. * unlock the root hub.
  83. */
  84. static void ehci_post_add(struct pci_dev *pdev, struct usb_hcd *hcd,
  85. struct pci_dev *companion, struct usb_hcd *companion_hcd)
  86. {
  87. struct usb_device *udev;
  88. if (is_ohci_or_uhci(companion)) {
  89. if (dev_get_drvdata(&pdev->dev)) { /* Succeeded */
  90. dev_dbg(&pdev->dev, "HS companion for %s\n",
  91. dev_name(&companion->dev));
  92. companion_hcd->self.hs_companion = &hcd->self;
  93. }
  94. udev = companion_hcd->self.root_hub;
  95. usb_set_configuration(udev, 1);
  96. usb_unlock_device(udev);
  97. }
  98. }
  99. /*
  100. * We just added a non-EHCI controller. Find the EHCI controller to
  101. * which it is a companion, and store a pointer to the bus structure.
  102. */
  103. static void non_ehci_add(struct pci_dev *pdev, struct usb_hcd *hcd,
  104. struct pci_dev *companion, struct usb_hcd *companion_hcd)
  105. {
  106. if (is_ohci_or_uhci(pdev) && companion->class == CL_EHCI) {
  107. dev_dbg(&pdev->dev, "FS/LS companion for %s\n",
  108. dev_name(&companion->dev));
  109. hcd->self.hs_companion = &companion_hcd->self;
  110. }
  111. }
  112. /* We are removing an EHCI controller. Clear the companions' pointers. */
  113. static void ehci_remove(struct pci_dev *pdev, struct usb_hcd *hcd,
  114. struct pci_dev *companion, struct usb_hcd *companion_hcd)
  115. {
  116. if (is_ohci_or_uhci(companion))
  117. companion_hcd->self.hs_companion = NULL;
  118. }
  119. #ifdef CONFIG_PM
  120. /* An EHCI controller must wait for its companions before resuming. */
  121. static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd,
  122. struct pci_dev *companion, struct usb_hcd *companion_hcd)
  123. {
  124. if (is_ohci_or_uhci(companion))
  125. device_pm_wait_for_dev(&pdev->dev, &companion->dev);
  126. }
  127. #endif /* CONFIG_PM */
  128. /*-------------------------------------------------------------------------*/
  129. /* configure so an HC device and id are always provided */
  130. /* always called with process context; sleeping is OK */
  131. /**
  132. * usb_hcd_pci_probe - initialize PCI-based HCDs
  133. * @dev: USB Host Controller being probed
  134. * @id: pci hotplug id connecting controller to HCD framework
  135. * Context: !in_interrupt()
  136. *
  137. * Allocates basic PCI resources for this USB host controller, and
  138. * then invokes the start() method for the HCD associated with it
  139. * through the hotplug entry's driver_data.
  140. *
  141. * Store this function in the HCD's struct pci_driver as probe().
  142. *
  143. * Return: 0 if successful.
  144. */
  145. int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
  146. {
  147. struct hc_driver *driver;
  148. struct usb_hcd *hcd;
  149. int retval;
  150. int hcd_irq = 0;
  151. if (usb_disabled())
  152. return -ENODEV;
  153. if (!id)
  154. return -EINVAL;
  155. driver = (struct hc_driver *)id->driver_data;
  156. if (!driver)
  157. return -EINVAL;
  158. if (pci_enable_device(dev) < 0)
  159. return -ENODEV;
  160. /*
  161. * The xHCI driver has its own irq management
  162. * make sure irq setup is not touched for xhci in generic hcd code
  163. */
  164. if ((driver->flags & HCD_MASK) < HCD_USB3) {
  165. if (!dev->irq) {
  166. dev_err(&dev->dev,
  167. "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
  168. pci_name(dev));
  169. retval = -ENODEV;
  170. goto disable_pci;
  171. }
  172. hcd_irq = dev->irq;
  173. }
  174. hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev));
  175. if (!hcd) {
  176. retval = -ENOMEM;
  177. goto disable_pci;
  178. }
  179. hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) &&
  180. driver->flags & (HCD_USB11 | HCD_USB3)) ? 1 : 0;
  181. if (driver->flags & HCD_MEMORY) {
  182. /* EHCI, OHCI */
  183. hcd->rsrc_start = pci_resource_start(dev, 0);
  184. hcd->rsrc_len = pci_resource_len(dev, 0);
  185. if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
  186. driver->description)) {
  187. dev_dbg(&dev->dev, "controller already in use\n");
  188. retval = -EBUSY;
  189. goto put_hcd;
  190. }
  191. hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
  192. if (hcd->regs == NULL) {
  193. dev_dbg(&dev->dev, "error mapping memory\n");
  194. retval = -EFAULT;
  195. goto release_mem_region;
  196. }
  197. } else {
  198. /* UHCI */
  199. int region;
  200. for (region = 0; region < PCI_ROM_RESOURCE; region++) {
  201. if (!(pci_resource_flags(dev, region) &
  202. IORESOURCE_IO))
  203. continue;
  204. hcd->rsrc_start = pci_resource_start(dev, region);
  205. hcd->rsrc_len = pci_resource_len(dev, region);
  206. if (request_region(hcd->rsrc_start, hcd->rsrc_len,
  207. driver->description))
  208. break;
  209. }
  210. if (region == PCI_ROM_RESOURCE) {
  211. dev_dbg(&dev->dev, "no i/o regions available\n");
  212. retval = -EBUSY;
  213. goto put_hcd;
  214. }
  215. }
  216. pci_set_master(dev);
  217. /* Note: dev_set_drvdata must be called while holding the rwsem */
  218. if (dev->class == CL_EHCI) {
  219. down_write(&companions_rwsem);
  220. dev_set_drvdata(&dev->dev, hcd);
  221. for_each_companion(dev, hcd, ehci_pre_add);
  222. retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
  223. if (retval != 0)
  224. dev_set_drvdata(&dev->dev, NULL);
  225. for_each_companion(dev, hcd, ehci_post_add);
  226. up_write(&companions_rwsem);
  227. } else {
  228. down_read(&companions_rwsem);
  229. dev_set_drvdata(&dev->dev, hcd);
  230. retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
  231. if (retval != 0)
  232. dev_set_drvdata(&dev->dev, NULL);
  233. else
  234. for_each_companion(dev, hcd, non_ehci_add);
  235. up_read(&companions_rwsem);
  236. }
  237. if (retval != 0)
  238. goto unmap_registers;
  239. device_wakeup_enable(hcd->self.controller);
  240. if (pci_dev_run_wake(dev))
  241. pm_runtime_put_noidle(&dev->dev);
  242. return retval;
  243. unmap_registers:
  244. if (driver->flags & HCD_MEMORY) {
  245. iounmap(hcd->regs);
  246. release_mem_region:
  247. release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
  248. } else
  249. release_region(hcd->rsrc_start, hcd->rsrc_len);
  250. put_hcd:
  251. usb_put_hcd(hcd);
  252. disable_pci:
  253. pci_disable_device(dev);
  254. dev_err(&dev->dev, "init %s fail, %d\n", pci_name(dev), retval);
  255. return retval;
  256. }
  257. EXPORT_SYMBOL_GPL(usb_hcd_pci_probe);
  258. /* may be called without controller electrically present */
  259. /* may be called with controller, bus, and devices active */
  260. /**
  261. * usb_hcd_pci_remove - shutdown processing for PCI-based HCDs
  262. * @dev: USB Host Controller being removed
  263. * Context: !in_interrupt()
  264. *
  265. * Reverses the effect of usb_hcd_pci_probe(), first invoking
  266. * the HCD's stop() method. It is always called from a thread
  267. * context, normally "rmmod", "apmd", or something similar.
  268. *
  269. * Store this function in the HCD's struct pci_driver as remove().
  270. */
  271. void usb_hcd_pci_remove(struct pci_dev *dev)
  272. {
  273. struct usb_hcd *hcd;
  274. hcd = pci_get_drvdata(dev);
  275. if (!hcd)
  276. return;
  277. if (pci_dev_run_wake(dev))
  278. pm_runtime_get_noresume(&dev->dev);
  279. /* Fake an interrupt request in order to give the driver a chance
  280. * to test whether the controller hardware has been removed (e.g.,
  281. * cardbus physical eject).
  282. */
  283. local_irq_disable();
  284. usb_hcd_irq(0, hcd);
  285. local_irq_enable();
  286. /* Note: dev_set_drvdata must be called while holding the rwsem */
  287. if (dev->class == CL_EHCI) {
  288. down_write(&companions_rwsem);
  289. for_each_companion(dev, hcd, ehci_remove);
  290. usb_remove_hcd(hcd);
  291. dev_set_drvdata(&dev->dev, NULL);
  292. up_write(&companions_rwsem);
  293. } else {
  294. /* Not EHCI; just clear the companion pointer */
  295. down_read(&companions_rwsem);
  296. hcd->self.hs_companion = NULL;
  297. usb_remove_hcd(hcd);
  298. dev_set_drvdata(&dev->dev, NULL);
  299. up_read(&companions_rwsem);
  300. }
  301. if (hcd->driver->flags & HCD_MEMORY) {
  302. iounmap(hcd->regs);
  303. release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
  304. } else {
  305. release_region(hcd->rsrc_start, hcd->rsrc_len);
  306. }
  307. usb_put_hcd(hcd);
  308. pci_disable_device(dev);
  309. }
  310. EXPORT_SYMBOL_GPL(usb_hcd_pci_remove);
  311. /**
  312. * usb_hcd_pci_shutdown - shutdown host controller
  313. * @dev: USB Host Controller being shutdown
  314. */
  315. void usb_hcd_pci_shutdown(struct pci_dev *dev)
  316. {
  317. struct usb_hcd *hcd;
  318. hcd = pci_get_drvdata(dev);
  319. if (!hcd)
  320. return;
  321. if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) &&
  322. hcd->driver->shutdown) {
  323. hcd->driver->shutdown(hcd);
  324. if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0)
  325. free_irq(hcd->irq, hcd);
  326. pci_disable_device(dev);
  327. }
  328. }
  329. EXPORT_SYMBOL_GPL(usb_hcd_pci_shutdown);
  330. #ifdef CONFIG_PM
  331. #ifdef CONFIG_PPC_PMAC
  332. static void powermac_set_asic(struct pci_dev *pci_dev, int enable)
  333. {
  334. /* Enanble or disable ASIC clocks for USB */
  335. if (machine_is(powermac)) {
  336. struct device_node *of_node;
  337. of_node = pci_device_to_OF_node(pci_dev);
  338. if (of_node)
  339. pmac_call_feature(PMAC_FTR_USB_ENABLE,
  340. of_node, 0, enable);
  341. }
  342. }
  343. #else
  344. static inline void powermac_set_asic(struct pci_dev *pci_dev, int enable)
  345. {}
  346. #endif /* CONFIG_PPC_PMAC */
  347. static int check_root_hub_suspended(struct device *dev)
  348. {
  349. struct pci_dev *pci_dev = to_pci_dev(dev);
  350. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  351. if (HCD_RH_RUNNING(hcd)) {
  352. dev_warn(dev, "Root hub is not suspended\n");
  353. return -EBUSY;
  354. }
  355. if (hcd->shared_hcd) {
  356. hcd = hcd->shared_hcd;
  357. if (HCD_RH_RUNNING(hcd)) {
  358. dev_warn(dev, "Secondary root hub is not suspended\n");
  359. return -EBUSY;
  360. }
  361. }
  362. return 0;
  363. }
  364. static int suspend_common(struct device *dev, bool do_wakeup)
  365. {
  366. struct pci_dev *pci_dev = to_pci_dev(dev);
  367. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  368. int retval;
  369. /* Root hub suspend should have stopped all downstream traffic,
  370. * and all bus master traffic. And done so for both the interface
  371. * and the stub usb_device (which we check here). But maybe it
  372. * didn't; writing sysfs power/state files ignores such rules...
  373. */
  374. retval = check_root_hub_suspended(dev);
  375. if (retval)
  376. return retval;
  377. if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) {
  378. /* Optimization: Don't suspend if a root-hub wakeup is
  379. * pending and it would cause the HCD to wake up anyway.
  380. */
  381. if (do_wakeup && HCD_WAKEUP_PENDING(hcd))
  382. return -EBUSY;
  383. if (do_wakeup && hcd->shared_hcd &&
  384. HCD_WAKEUP_PENDING(hcd->shared_hcd))
  385. return -EBUSY;
  386. retval = hcd->driver->pci_suspend(hcd, do_wakeup);
  387. suspend_report_result(hcd->driver->pci_suspend, retval);
  388. /* Check again in case wakeup raced with pci_suspend */
  389. if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) ||
  390. (retval == 0 && do_wakeup && hcd->shared_hcd &&
  391. HCD_WAKEUP_PENDING(hcd->shared_hcd))) {
  392. if (hcd->driver->pci_resume)
  393. hcd->driver->pci_resume(hcd, false);
  394. retval = -EBUSY;
  395. }
  396. if (retval)
  397. return retval;
  398. }
  399. /* If MSI-X is enabled, the driver will have synchronized all vectors
  400. * in pci_suspend(). If MSI or legacy PCI is enabled, that will be
  401. * synchronized here.
  402. */
  403. if (!hcd->msix_enabled)
  404. synchronize_irq(pci_dev->irq);
  405. /* Downstream ports from this root hub should already be quiesced, so
  406. * there will be no DMA activity. Now we can shut down the upstream
  407. * link (except maybe for PME# resume signaling). We'll enter a
  408. * low power state during suspend_noirq, if the hardware allows.
  409. */
  410. pci_disable_device(pci_dev);
  411. return retval;
  412. }
  413. static int resume_common(struct device *dev, int event)
  414. {
  415. struct pci_dev *pci_dev = to_pci_dev(dev);
  416. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  417. int retval;
  418. if (HCD_RH_RUNNING(hcd) ||
  419. (hcd->shared_hcd &&
  420. HCD_RH_RUNNING(hcd->shared_hcd))) {
  421. dev_dbg(dev, "can't resume, not suspended!\n");
  422. return 0;
  423. }
  424. retval = pci_enable_device(pci_dev);
  425. if (retval < 0) {
  426. dev_err(dev, "can't re-enable after resume, %d!\n", retval);
  427. return retval;
  428. }
  429. pci_set_master(pci_dev);
  430. if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) {
  431. /*
  432. * Only EHCI controllers have to wait for their companions.
  433. * No locking is needed because PCI controller drivers do not
  434. * get unbound during system resume.
  435. */
  436. if (pci_dev->class == CL_EHCI && event != PM_EVENT_AUTO_RESUME)
  437. for_each_companion(pci_dev, hcd,
  438. ehci_wait_for_companions);
  439. retval = hcd->driver->pci_resume(hcd,
  440. event == PM_EVENT_RESTORE);
  441. if (retval) {
  442. dev_err(dev, "PCI post-resume error %d!\n", retval);
  443. usb_hc_died(hcd);
  444. }
  445. }
  446. return retval;
  447. }
  448. #ifdef CONFIG_PM_SLEEP
  449. static int hcd_pci_suspend(struct device *dev)
  450. {
  451. return suspend_common(dev, device_may_wakeup(dev));
  452. }
  453. static int hcd_pci_suspend_noirq(struct device *dev)
  454. {
  455. struct pci_dev *pci_dev = to_pci_dev(dev);
  456. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  457. int retval;
  458. retval = check_root_hub_suspended(dev);
  459. if (retval)
  460. return retval;
  461. pci_save_state(pci_dev);
  462. /* If the root hub is dead rather than suspended, disallow remote
  463. * wakeup. usb_hc_died() should ensure that both hosts are marked as
  464. * dying, so we only need to check the primary roothub.
  465. */
  466. if (HCD_DEAD(hcd))
  467. device_set_wakeup_enable(dev, 0);
  468. dev_dbg(dev, "wakeup: %d\n", device_may_wakeup(dev));
  469. /* Possibly enable remote wakeup,
  470. * choose the appropriate low-power state, and go to that state.
  471. */
  472. retval = pci_prepare_to_sleep(pci_dev);
  473. if (retval == -EIO) { /* Low-power not supported */
  474. dev_dbg(dev, "--> PCI D0 legacy\n");
  475. retval = 0;
  476. } else if (retval == 0) {
  477. dev_dbg(dev, "--> PCI %s\n",
  478. pci_power_name(pci_dev->current_state));
  479. } else {
  480. suspend_report_result(pci_prepare_to_sleep, retval);
  481. return retval;
  482. }
  483. powermac_set_asic(pci_dev, 0);
  484. return retval;
  485. }
  486. static int hcd_pci_resume_noirq(struct device *dev)
  487. {
  488. powermac_set_asic(to_pci_dev(dev), 1);
  489. return 0;
  490. }
  491. static int hcd_pci_resume(struct device *dev)
  492. {
  493. return resume_common(dev, PM_EVENT_RESUME);
  494. }
  495. static int hcd_pci_restore(struct device *dev)
  496. {
  497. return resume_common(dev, PM_EVENT_RESTORE);
  498. }
  499. #else
  500. #define hcd_pci_suspend NULL
  501. #define hcd_pci_suspend_noirq NULL
  502. #define hcd_pci_resume_noirq NULL
  503. #define hcd_pci_resume NULL
  504. #define hcd_pci_restore NULL
  505. #endif /* CONFIG_PM_SLEEP */
  506. static int hcd_pci_runtime_suspend(struct device *dev)
  507. {
  508. int retval;
  509. retval = suspend_common(dev, true);
  510. if (retval == 0)
  511. powermac_set_asic(to_pci_dev(dev), 0);
  512. dev_dbg(dev, "hcd_pci_runtime_suspend: %d\n", retval);
  513. return retval;
  514. }
  515. static int hcd_pci_runtime_resume(struct device *dev)
  516. {
  517. int retval;
  518. powermac_set_asic(to_pci_dev(dev), 1);
  519. retval = resume_common(dev, PM_EVENT_AUTO_RESUME);
  520. dev_dbg(dev, "hcd_pci_runtime_resume: %d\n", retval);
  521. return retval;
  522. }
  523. const struct dev_pm_ops usb_hcd_pci_pm_ops = {
  524. .suspend = hcd_pci_suspend,
  525. .suspend_noirq = hcd_pci_suspend_noirq,
  526. .resume_noirq = hcd_pci_resume_noirq,
  527. .resume = hcd_pci_resume,
  528. .freeze = check_root_hub_suspended,
  529. .freeze_noirq = check_root_hub_suspended,
  530. .thaw_noirq = NULL,
  531. .thaw = NULL,
  532. .poweroff = hcd_pci_suspend,
  533. .poweroff_noirq = hcd_pci_suspend_noirq,
  534. .restore_noirq = hcd_pci_resume_noirq,
  535. .restore = hcd_pci_restore,
  536. .runtime_suspend = hcd_pci_runtime_suspend,
  537. .runtime_resume = hcd_pci_runtime_resume,
  538. };
  539. EXPORT_SYMBOL_GPL(usb_hcd_pci_pm_ops);
  540. #endif /* CONFIG_PM */