Lines Matching refs:dev
48 static inline void mei_txe_set_pm_domain(struct mei_device *dev);
49 static inline void mei_txe_unset_pm_domain(struct mei_device *dev);
51 static inline void mei_txe_set_pm_domain(struct mei_device *dev) {} in mei_txe_set_pm_domain() argument
52 static inline void mei_txe_unset_pm_domain(struct mei_device *dev) {} in mei_txe_unset_pm_domain() argument
65 struct mei_device *dev; in mei_txe_probe() local
73 dev_err(&pdev->dev, "failed to enable pci device.\n"); in mei_txe_probe()
81 dev_err(&pdev->dev, "failed to get pci regions.\n"); in mei_txe_probe()
89 dev_err(&pdev->dev, "No suitable DMA available.\n"); in mei_txe_probe()
95 dev = mei_txe_dev_init(pdev); in mei_txe_probe()
96 if (!dev) { in mei_txe_probe()
100 hw = to_txe_hw(dev); in mei_txe_probe()
106 mei_clear_interrupts(dev); in mei_txe_probe()
113 IRQF_ONESHOT, KBUILD_MODNAME, dev); in mei_txe_probe()
118 IRQF_SHARED, KBUILD_MODNAME, dev); in mei_txe_probe()
120 dev_err(&pdev->dev, "mei: request_threaded_irq failure. irq = %d\n", in mei_txe_probe()
125 if (mei_start(dev)) { in mei_txe_probe()
126 dev_err(&pdev->dev, "init hw failure.\n"); in mei_txe_probe()
131 pm_runtime_set_autosuspend_delay(&pdev->dev, MEI_TXI_RPM_TIMEOUT); in mei_txe_probe()
132 pm_runtime_use_autosuspend(&pdev->dev); in mei_txe_probe()
134 err = mei_register(dev, &pdev->dev); in mei_txe_probe()
138 pci_set_drvdata(pdev, dev); in mei_txe_probe()
144 dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NEVER_SKIP); in mei_txe_probe()
154 mei_txe_set_pm_domain(dev); in mei_txe_probe()
156 pm_runtime_put_noidle(&pdev->dev); in mei_txe_probe()
161 mei_stop(dev); in mei_txe_probe()
163 mei_cancel_work(dev); in mei_txe_probe()
164 mei_disable_interrupts(dev); in mei_txe_probe()
165 free_irq(pdev->irq, dev); in mei_txe_probe()
167 dev_err(&pdev->dev, "initialization failed.\n"); in mei_txe_probe()
182 struct mei_device *dev; in mei_txe_shutdown() local
184 dev = pci_get_drvdata(pdev); in mei_txe_shutdown()
185 if (!dev) in mei_txe_shutdown()
188 dev_dbg(&pdev->dev, "shutdown\n"); in mei_txe_shutdown()
189 mei_stop(dev); in mei_txe_shutdown()
191 mei_txe_unset_pm_domain(dev); in mei_txe_shutdown()
193 mei_disable_interrupts(dev); in mei_txe_shutdown()
194 free_irq(pdev->irq, dev); in mei_txe_shutdown()
207 struct mei_device *dev; in mei_txe_remove() local
209 dev = pci_get_drvdata(pdev); in mei_txe_remove()
210 if (!dev) { in mei_txe_remove()
211 dev_err(&pdev->dev, "mei: dev == NULL\n"); in mei_txe_remove()
215 pm_runtime_get_noresume(&pdev->dev); in mei_txe_remove()
217 mei_stop(dev); in mei_txe_remove()
219 mei_txe_unset_pm_domain(dev); in mei_txe_remove()
221 mei_disable_interrupts(dev); in mei_txe_remove()
222 free_irq(pdev->irq, dev); in mei_txe_remove()
224 mei_deregister(dev); in mei_txe_remove()
232 struct mei_device *dev = pci_get_drvdata(pdev); in mei_txe_pci_suspend() local
234 if (!dev) in mei_txe_pci_suspend()
237 dev_dbg(&pdev->dev, "suspend\n"); in mei_txe_pci_suspend()
239 mei_stop(dev); in mei_txe_pci_suspend()
241 mei_disable_interrupts(dev); in mei_txe_pci_suspend()
243 free_irq(pdev->irq, dev); in mei_txe_pci_suspend()
252 struct mei_device *dev; in mei_txe_pci_resume() local
255 dev = pci_get_drvdata(pdev); in mei_txe_pci_resume()
256 if (!dev) in mei_txe_pci_resume()
261 mei_clear_interrupts(dev); in mei_txe_pci_resume()
268 IRQF_ONESHOT, KBUILD_MODNAME, dev); in mei_txe_pci_resume()
273 IRQF_SHARED, KBUILD_MODNAME, dev); in mei_txe_pci_resume()
275 dev_err(&pdev->dev, "request_threaded_irq failed: irq = %d.\n", in mei_txe_pci_resume()
280 err = mei_restart(dev); in mei_txe_pci_resume()
290 struct mei_device *dev; in mei_txe_pm_runtime_idle() local
292 dev_dbg(&pdev->dev, "rpm: txe: runtime_idle\n"); in mei_txe_pm_runtime_idle()
294 dev = pci_get_drvdata(pdev); in mei_txe_pm_runtime_idle()
295 if (!dev) in mei_txe_pm_runtime_idle()
297 if (mei_write_is_idle(dev)) in mei_txe_pm_runtime_idle()
305 struct mei_device *dev; in mei_txe_pm_runtime_suspend() local
308 dev_dbg(&pdev->dev, "rpm: txe: runtime suspend\n"); in mei_txe_pm_runtime_suspend()
310 dev = pci_get_drvdata(pdev); in mei_txe_pm_runtime_suspend()
311 if (!dev) in mei_txe_pm_runtime_suspend()
314 mutex_lock(&dev->device_lock); in mei_txe_pm_runtime_suspend()
316 if (mei_write_is_idle(dev)) in mei_txe_pm_runtime_suspend()
317 ret = mei_txe_aliveness_set_sync(dev, 0); in mei_txe_pm_runtime_suspend()
323 dev_dbg(&pdev->dev, "rpm: txe: runtime suspend ret=%d\n", ret); in mei_txe_pm_runtime_suspend()
325 mutex_unlock(&dev->device_lock); in mei_txe_pm_runtime_suspend()
328 schedule_work(&dev->reset_work); in mei_txe_pm_runtime_suspend()
336 struct mei_device *dev; in mei_txe_pm_runtime_resume() local
339 dev_dbg(&pdev->dev, "rpm: txe: runtime resume\n"); in mei_txe_pm_runtime_resume()
341 dev = pci_get_drvdata(pdev); in mei_txe_pm_runtime_resume()
342 if (!dev) in mei_txe_pm_runtime_resume()
345 mutex_lock(&dev->device_lock); in mei_txe_pm_runtime_resume()
347 mei_enable_interrupts(dev); in mei_txe_pm_runtime_resume()
349 ret = mei_txe_aliveness_set_sync(dev, 1); in mei_txe_pm_runtime_resume()
351 mutex_unlock(&dev->device_lock); in mei_txe_pm_runtime_resume()
353 dev_dbg(&pdev->dev, "rpm: txe: runtime resume ret = %d\n", ret); in mei_txe_pm_runtime_resume()
356 schedule_work(&dev->reset_work); in mei_txe_pm_runtime_resume()
366 static inline void mei_txe_set_pm_domain(struct mei_device *dev) in mei_txe_set_pm_domain() argument
368 struct pci_dev *pdev = to_pci_dev(dev->dev); in mei_txe_set_pm_domain()
370 if (pdev->dev.bus && pdev->dev.bus->pm) { in mei_txe_set_pm_domain()
371 dev->pg_domain.ops = *pdev->dev.bus->pm; in mei_txe_set_pm_domain()
373 dev->pg_domain.ops.runtime_suspend = mei_txe_pm_runtime_suspend; in mei_txe_set_pm_domain()
374 dev->pg_domain.ops.runtime_resume = mei_txe_pm_runtime_resume; in mei_txe_set_pm_domain()
375 dev->pg_domain.ops.runtime_idle = mei_txe_pm_runtime_idle; in mei_txe_set_pm_domain()
377 dev_pm_domain_set(&pdev->dev, &dev->pg_domain); in mei_txe_set_pm_domain()
386 static inline void mei_txe_unset_pm_domain(struct mei_device *dev) in mei_txe_unset_pm_domain() argument
389 dev_pm_domain_set(dev->dev, NULL); in mei_txe_unset_pm_domain()