Lines Matching +full:pm +full:- +full:bus
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2013-2020, Intel Corporation. All rights reserved.
24 #include "hw-txe.h"
43 * mei_txe_probe - Device Initialization Routine
60 dev_err(&pdev->dev, "failed to enable pci device.\n"); in mei_txe_probe()
68 dev_err(&pdev->dev, "failed to get pci regions.\n"); in mei_txe_probe()
72 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(36)); in mei_txe_probe()
74 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); in mei_txe_probe()
76 dev_err(&pdev->dev, "No suitable DMA available.\n"); in mei_txe_probe()
84 err = -ENOMEM; in mei_txe_probe()
88 hw->mem_addr = pcim_iomap_table(pdev); in mei_txe_probe()
97 err = request_threaded_irq(pdev->irq, in mei_txe_probe()
102 err = request_threaded_irq(pdev->irq, in mei_txe_probe()
107 dev_err(&pdev->dev, "mei: request_threaded_irq failure. irq = %d\n", in mei_txe_probe()
108 pdev->irq); in mei_txe_probe()
113 dev_err(&pdev->dev, "init hw failure.\n"); in mei_txe_probe()
114 err = -ENODEV; in mei_txe_probe()
118 pm_runtime_set_autosuspend_delay(&pdev->dev, MEI_TXI_RPM_TIMEOUT); in mei_txe_probe()
119 pm_runtime_use_autosuspend(&pdev->dev); in mei_txe_probe()
121 err = mei_register(dev, &pdev->dev); in mei_txe_probe()
131 dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NO_DIRECT_COMPLETE); in mei_txe_probe()
138 * power gating. To get around PCI device native runtime pm, in mei_txe_probe()
139 * TXE uses runtime pm domain handlers which take precedence. in mei_txe_probe()
143 pm_runtime_put_noidle(&pdev->dev); in mei_txe_probe()
152 free_irq(pdev->irq, dev); in mei_txe_probe()
154 dev_err(&pdev->dev, "initialization failed.\n"); in mei_txe_probe()
159 * mei_txe_shutdown- Device Shutdown Routine
175 dev_dbg(&pdev->dev, "shutdown\n"); in mei_txe_shutdown()
181 free_irq(pdev->irq, dev); in mei_txe_shutdown()
185 * mei_txe_remove - Device Removal Routine
198 dev_err(&pdev->dev, "mei: dev == NULL\n"); in mei_txe_remove()
202 pm_runtime_get_noresume(&pdev->dev); in mei_txe_remove()
209 free_irq(pdev->irq, dev); in mei_txe_remove()
222 return -ENODEV; in mei_txe_pci_suspend()
224 dev_dbg(&pdev->dev, "suspend\n"); in mei_txe_pci_suspend()
230 free_irq(pdev->irq, dev); in mei_txe_pci_suspend()
244 return -ENODEV; in mei_txe_pci_resume()
252 err = request_threaded_irq(pdev->irq, in mei_txe_pci_resume()
257 err = request_threaded_irq(pdev->irq, in mei_txe_pci_resume()
262 dev_err(&pdev->dev, "request_threaded_irq failed: irq = %d.\n", in mei_txe_pci_resume()
263 pdev->irq); in mei_txe_pci_resume()
282 return -ENODEV; in mei_txe_pm_runtime_idle()
286 return -EBUSY; in mei_txe_pm_runtime_idle()
297 return -ENODEV; in mei_txe_pm_runtime_suspend()
299 mutex_lock(&dev->device_lock); in mei_txe_pm_runtime_suspend()
304 ret = -EAGAIN; in mei_txe_pm_runtime_suspend()
310 mutex_unlock(&dev->device_lock); in mei_txe_pm_runtime_suspend()
312 if (ret && ret != -EAGAIN) in mei_txe_pm_runtime_suspend()
313 schedule_work(&dev->reset_work); in mei_txe_pm_runtime_suspend()
327 return -ENODEV; in mei_txe_pm_runtime_resume()
329 mutex_lock(&dev->device_lock); in mei_txe_pm_runtime_resume()
335 mutex_unlock(&dev->device_lock); in mei_txe_pm_runtime_resume()
340 schedule_work(&dev->reset_work); in mei_txe_pm_runtime_resume()
346 * mei_txe_set_pm_domain - fill and set pm domain structure for device
352 struct pci_dev *pdev = to_pci_dev(dev->dev); in mei_txe_set_pm_domain()
354 if (pdev->dev.bus && pdev->dev.bus->pm) { in mei_txe_set_pm_domain()
355 dev->pg_domain.ops = *pdev->dev.bus->pm; in mei_txe_set_pm_domain()
357 dev->pg_domain.ops.runtime_suspend = mei_txe_pm_runtime_suspend; in mei_txe_set_pm_domain()
358 dev->pg_domain.ops.runtime_resume = mei_txe_pm_runtime_resume; in mei_txe_set_pm_domain()
359 dev->pg_domain.ops.runtime_idle = mei_txe_pm_runtime_idle; in mei_txe_set_pm_domain()
361 dev_pm_domain_set(&pdev->dev, &dev->pg_domain); in mei_txe_set_pm_domain()
366 * mei_txe_unset_pm_domain - clean pm domain structure for device
372 /* stop using pm callbacks if any */ in mei_txe_unset_pm_domain()
373 dev_pm_domain_set(dev->dev, NULL); in mei_txe_unset_pm_domain()
399 .driver.pm = MEI_TXE_PM_OPS,