hcd-pci.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  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. * @driver: USB HC driver handle
  136. * Context: !in_interrupt()
  137. *
  138. * Allocates basic PCI resources for this USB host controller, and
  139. * then invokes the start() method for the HCD associated with it
  140. * through the hotplug entry's driver_data.
  141. *
  142. * Store this function in the HCD's struct pci_driver as probe().
  143. *
  144. * Return: 0 if successful.
  145. */
  146. int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id,
  147. const struct hc_driver *driver)
  148. {
  149. struct usb_hcd *hcd;
  150. int retval;
  151. int hcd_irq = 0;
  152. if (usb_disabled())
  153. return -ENODEV;
  154. if (!id)
  155. return -EINVAL;
  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. retval = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_LEGACY | PCI_IRQ_MSI);
  166. if (retval < 0) {
  167. dev_err(&dev->dev,
  168. "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
  169. pci_name(dev));
  170. retval = -ENODEV;
  171. goto disable_pci;
  172. }
  173. hcd_irq = pci_irq_vector(dev, 0);
  174. }
  175. hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev));
  176. if (!hcd) {
  177. retval = -ENOMEM;
  178. goto free_irq_vectors;
  179. }
  180. hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) &&
  181. driver->flags & (HCD_USB11 | HCD_USB3)) ? 1 : 0;
  182. if (driver->flags & HCD_MEMORY) {
  183. /* EHCI, OHCI */
  184. hcd->rsrc_start = pci_resource_start(dev, 0);
  185. hcd->rsrc_len = pci_resource_len(dev, 0);
  186. if (!devm_request_mem_region(&dev->dev, hcd->rsrc_start,
  187. hcd->rsrc_len, driver->description)) {
  188. dev_dbg(&dev->dev, "controller already in use\n");
  189. retval = -EBUSY;
  190. goto put_hcd;
  191. }
  192. hcd->regs = devm_ioremap(&dev->dev, hcd->rsrc_start,
  193. hcd->rsrc_len);
  194. if (hcd->regs == NULL) {
  195. dev_dbg(&dev->dev, "error mapping memory\n");
  196. retval = -EFAULT;
  197. goto put_hcd;
  198. }
  199. } else {
  200. /* UHCI */
  201. int region;
  202. for (region = 0; region < PCI_STD_NUM_BARS; region++) {
  203. if (!(pci_resource_flags(dev, region) &
  204. IORESOURCE_IO))
  205. continue;
  206. hcd->rsrc_start = pci_resource_start(dev, region);
  207. hcd->rsrc_len = pci_resource_len(dev, region);
  208. if (devm_request_region(&dev->dev, hcd->rsrc_start,
  209. hcd->rsrc_len, driver->description))
  210. break;
  211. }
  212. if (region == PCI_ROM_RESOURCE) {
  213. dev_dbg(&dev->dev, "no i/o regions available\n");
  214. retval = -EBUSY;
  215. goto put_hcd;
  216. }
  217. }
  218. pci_set_master(dev);
  219. /* Note: dev_set_drvdata must be called while holding the rwsem */
  220. if (dev->class == CL_EHCI) {
  221. down_write(&companions_rwsem);
  222. dev_set_drvdata(&dev->dev, hcd);
  223. for_each_companion(dev, hcd, ehci_pre_add);
  224. retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
  225. if (retval != 0)
  226. dev_set_drvdata(&dev->dev, NULL);
  227. for_each_companion(dev, hcd, ehci_post_add);
  228. up_write(&companions_rwsem);
  229. } else {
  230. down_read(&companions_rwsem);
  231. dev_set_drvdata(&dev->dev, hcd);
  232. retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
  233. if (retval != 0)
  234. dev_set_drvdata(&dev->dev, NULL);
  235. else
  236. for_each_companion(dev, hcd, non_ehci_add);
  237. up_read(&companions_rwsem);
  238. }
  239. if (retval != 0)
  240. goto put_hcd;
  241. device_wakeup_enable(hcd->self.controller);
  242. if (pci_dev_run_wake(dev))
  243. pm_runtime_put_noidle(&dev->dev);
  244. return retval;
  245. put_hcd:
  246. usb_put_hcd(hcd);
  247. free_irq_vectors:
  248. if ((driver->flags & HCD_MASK) < HCD_USB3)
  249. pci_free_irq_vectors(dev);
  250. disable_pci:
  251. pci_disable_device(dev);
  252. dev_err(&dev->dev, "init %s fail, %d\n", pci_name(dev), retval);
  253. return retval;
  254. }
  255. EXPORT_SYMBOL_GPL(usb_hcd_pci_probe);
  256. /* may be called without controller electrically present */
  257. /* may be called with controller, bus, and devices active */
  258. /**
  259. * usb_hcd_pci_remove - shutdown processing for PCI-based HCDs
  260. * @dev: USB Host Controller being removed
  261. * Context: !in_interrupt()
  262. *
  263. * Reverses the effect of usb_hcd_pci_probe(), first invoking
  264. * the HCD's stop() method. It is always called from a thread
  265. * context, normally "rmmod", "apmd", or something similar.
  266. *
  267. * Store this function in the HCD's struct pci_driver as remove().
  268. */
  269. void usb_hcd_pci_remove(struct pci_dev *dev)
  270. {
  271. struct usb_hcd *hcd;
  272. int hcd_driver_flags;
  273. hcd = pci_get_drvdata(dev);
  274. if (!hcd)
  275. return;
  276. hcd_driver_flags = hcd->driver->flags;
  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. usb_put_hcd(hcd);
  302. if ((hcd_driver_flags & HCD_MASK) < HCD_USB3)
  303. pci_free_irq_vectors(dev);
  304. pci_disable_device(dev);
  305. }
  306. EXPORT_SYMBOL_GPL(usb_hcd_pci_remove);
  307. /**
  308. * usb_hcd_pci_shutdown - shutdown host controller
  309. * @dev: USB Host Controller being shutdown
  310. */
  311. void usb_hcd_pci_shutdown(struct pci_dev *dev)
  312. {
  313. struct usb_hcd *hcd;
  314. hcd = pci_get_drvdata(dev);
  315. if (!hcd)
  316. return;
  317. if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) &&
  318. hcd->driver->shutdown) {
  319. hcd->driver->shutdown(hcd);
  320. if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0)
  321. free_irq(hcd->irq, hcd);
  322. pci_disable_device(dev);
  323. }
  324. }
  325. EXPORT_SYMBOL_GPL(usb_hcd_pci_shutdown);
  326. #ifdef CONFIG_PM
  327. #ifdef CONFIG_PPC_PMAC
  328. static void powermac_set_asic(struct pci_dev *pci_dev, int enable)
  329. {
  330. /* Enanble or disable ASIC clocks for USB */
  331. if (machine_is(powermac)) {
  332. struct device_node *of_node;
  333. of_node = pci_device_to_OF_node(pci_dev);
  334. if (of_node)
  335. pmac_call_feature(PMAC_FTR_USB_ENABLE,
  336. of_node, 0, enable);
  337. }
  338. }
  339. #else
  340. static inline void powermac_set_asic(struct pci_dev *pci_dev, int enable)
  341. {}
  342. #endif /* CONFIG_PPC_PMAC */
  343. static int check_root_hub_suspended(struct device *dev)
  344. {
  345. struct usb_hcd *hcd = dev_get_drvdata(dev);
  346. if (HCD_RH_RUNNING(hcd)) {
  347. dev_warn(dev, "Root hub is not suspended\n");
  348. return -EBUSY;
  349. }
  350. if (hcd->shared_hcd) {
  351. hcd = hcd->shared_hcd;
  352. if (HCD_RH_RUNNING(hcd)) {
  353. dev_warn(dev, "Secondary root hub is not suspended\n");
  354. return -EBUSY;
  355. }
  356. }
  357. return 0;
  358. }
  359. static int suspend_common(struct device *dev, bool do_wakeup)
  360. {
  361. struct pci_dev *pci_dev = to_pci_dev(dev);
  362. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  363. int retval;
  364. /* Root hub suspend should have stopped all downstream traffic,
  365. * and all bus master traffic. And done so for both the interface
  366. * and the stub usb_device (which we check here). But maybe it
  367. * didn't; writing sysfs power/state files ignores such rules...
  368. */
  369. retval = check_root_hub_suspended(dev);
  370. if (retval)
  371. return retval;
  372. if (hcd->driver->pci_suspend && !HCD_DEAD(hcd)) {
  373. /* Optimization: Don't suspend if a root-hub wakeup is
  374. * pending and it would cause the HCD to wake up anyway.
  375. */
  376. if (do_wakeup && HCD_WAKEUP_PENDING(hcd))
  377. return -EBUSY;
  378. if (do_wakeup && hcd->shared_hcd &&
  379. HCD_WAKEUP_PENDING(hcd->shared_hcd))
  380. return -EBUSY;
  381. retval = hcd->driver->pci_suspend(hcd, do_wakeup);
  382. suspend_report_result(hcd->driver->pci_suspend, retval);
  383. /* Check again in case wakeup raced with pci_suspend */
  384. if ((retval == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) ||
  385. (retval == 0 && do_wakeup && hcd->shared_hcd &&
  386. HCD_WAKEUP_PENDING(hcd->shared_hcd))) {
  387. if (hcd->driver->pci_resume)
  388. hcd->driver->pci_resume(hcd, false);
  389. retval = -EBUSY;
  390. }
  391. if (retval)
  392. return retval;
  393. }
  394. /* If MSI-X is enabled, the driver will have synchronized all vectors
  395. * in pci_suspend(). If MSI or legacy PCI is enabled, that will be
  396. * synchronized here.
  397. */
  398. if (!hcd->msix_enabled)
  399. synchronize_irq(pci_irq_vector(pci_dev, 0));
  400. /* Downstream ports from this root hub should already be quiesced, so
  401. * there will be no DMA activity. Now we can shut down the upstream
  402. * link (except maybe for PME# resume signaling). We'll enter a
  403. * low power state during suspend_noirq, if the hardware allows.
  404. */
  405. pci_disable_device(pci_dev);
  406. return retval;
  407. }
  408. static int resume_common(struct device *dev, int event)
  409. {
  410. struct pci_dev *pci_dev = to_pci_dev(dev);
  411. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  412. int retval;
  413. if (HCD_RH_RUNNING(hcd) ||
  414. (hcd->shared_hcd &&
  415. HCD_RH_RUNNING(hcd->shared_hcd))) {
  416. dev_dbg(dev, "can't resume, not suspended!\n");
  417. return 0;
  418. }
  419. retval = pci_enable_device(pci_dev);
  420. if (retval < 0) {
  421. dev_err(dev, "can't re-enable after resume, %d!\n", retval);
  422. return retval;
  423. }
  424. pci_set_master(pci_dev);
  425. if (hcd->driver->pci_resume && !HCD_DEAD(hcd)) {
  426. /*
  427. * Only EHCI controllers have to wait for their companions.
  428. * No locking is needed because PCI controller drivers do not
  429. * get unbound during system resume.
  430. */
  431. if (pci_dev->class == CL_EHCI && event != PM_EVENT_AUTO_RESUME)
  432. for_each_companion(pci_dev, hcd,
  433. ehci_wait_for_companions);
  434. retval = hcd->driver->pci_resume(hcd,
  435. event == PM_EVENT_RESTORE);
  436. if (retval) {
  437. dev_err(dev, "PCI post-resume error %d!\n", retval);
  438. usb_hc_died(hcd);
  439. }
  440. }
  441. return retval;
  442. }
  443. #ifdef CONFIG_PM_SLEEP
  444. static int hcd_pci_suspend(struct device *dev)
  445. {
  446. return suspend_common(dev, device_may_wakeup(dev));
  447. }
  448. static int hcd_pci_suspend_noirq(struct device *dev)
  449. {
  450. struct pci_dev *pci_dev = to_pci_dev(dev);
  451. struct usb_hcd *hcd = pci_get_drvdata(pci_dev);
  452. int retval;
  453. retval = check_root_hub_suspended(dev);
  454. if (retval)
  455. return retval;
  456. pci_save_state(pci_dev);
  457. /* If the root hub is dead rather than suspended, disallow remote
  458. * wakeup. usb_hc_died() should ensure that both hosts are marked as
  459. * dying, so we only need to check the primary roothub.
  460. */
  461. if (HCD_DEAD(hcd))
  462. device_set_wakeup_enable(dev, 0);
  463. dev_dbg(dev, "wakeup: %d\n", device_may_wakeup(dev));
  464. /* Possibly enable remote wakeup,
  465. * choose the appropriate low-power state, and go to that state.
  466. */
  467. retval = pci_prepare_to_sleep(pci_dev);
  468. if (retval == -EIO) { /* Low-power not supported */
  469. dev_dbg(dev, "--> PCI D0 legacy\n");
  470. retval = 0;
  471. } else if (retval == 0) {
  472. dev_dbg(dev, "--> PCI %s\n",
  473. pci_power_name(pci_dev->current_state));
  474. } else {
  475. suspend_report_result(pci_prepare_to_sleep, retval);
  476. return retval;
  477. }
  478. powermac_set_asic(pci_dev, 0);
  479. return retval;
  480. }
  481. static int hcd_pci_resume_noirq(struct device *dev)
  482. {
  483. powermac_set_asic(to_pci_dev(dev), 1);
  484. return 0;
  485. }
  486. static int hcd_pci_resume(struct device *dev)
  487. {
  488. return resume_common(dev, PM_EVENT_RESUME);
  489. }
  490. static int hcd_pci_restore(struct device *dev)
  491. {
  492. return resume_common(dev, PM_EVENT_RESTORE);
  493. }
  494. #else
  495. #define hcd_pci_suspend NULL
  496. #define hcd_pci_suspend_noirq NULL
  497. #define hcd_pci_resume_noirq NULL
  498. #define hcd_pci_resume NULL
  499. #define hcd_pci_restore NULL
  500. #endif /* CONFIG_PM_SLEEP */
  501. static int hcd_pci_runtime_suspend(struct device *dev)
  502. {
  503. int retval;
  504. retval = suspend_common(dev, true);
  505. if (retval == 0)
  506. powermac_set_asic(to_pci_dev(dev), 0);
  507. dev_dbg(dev, "hcd_pci_runtime_suspend: %d\n", retval);
  508. return retval;
  509. }
  510. static int hcd_pci_runtime_resume(struct device *dev)
  511. {
  512. int retval;
  513. powermac_set_asic(to_pci_dev(dev), 1);
  514. retval = resume_common(dev, PM_EVENT_AUTO_RESUME);
  515. dev_dbg(dev, "hcd_pci_runtime_resume: %d\n", retval);
  516. return retval;
  517. }
  518. const struct dev_pm_ops usb_hcd_pci_pm_ops = {
  519. .suspend = hcd_pci_suspend,
  520. .suspend_noirq = hcd_pci_suspend_noirq,
  521. .resume_noirq = hcd_pci_resume_noirq,
  522. .resume = hcd_pci_resume,
  523. .freeze = check_root_hub_suspended,
  524. .freeze_noirq = check_root_hub_suspended,
  525. .thaw_noirq = NULL,
  526. .thaw = NULL,
  527. .poweroff = hcd_pci_suspend,
  528. .poweroff_noirq = hcd_pci_suspend_noirq,
  529. .restore_noirq = hcd_pci_resume_noirq,
  530. .restore = hcd_pci_restore,
  531. .runtime_suspend = hcd_pci_runtime_suspend,
  532. .runtime_resume = hcd_pci_runtime_resume,
  533. };
  534. EXPORT_SYMBOL_GPL(usb_hcd_pci_pm_ops);
  535. #endif /* CONFIG_PM */