Lines Matching refs:dev

92 static inline void mei_me_set_pm_domain(struct mei_device *dev);
93 static inline void mei_me_unset_pm_domain(struct mei_device *dev);
95 static inline void mei_me_set_pm_domain(struct mei_device *dev) {} in mei_me_set_pm_domain() argument
96 static inline void mei_me_unset_pm_domain(struct mei_device *dev) {} in mei_me_unset_pm_domain() argument
111 dev_info(&pdev->dev, "Device doesn't have valid ME Interface\n"); in mei_me_quirk_probe()
129 struct mei_device *dev; in mei_me_probe() local
140 dev_err(&pdev->dev, "failed to enable pci device.\n"); in mei_me_probe()
148 dev_err(&pdev->dev, "failed to get pci regions.\n"); in mei_me_probe()
152 if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) || in mei_me_probe()
153 dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { in mei_me_probe()
155 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); in mei_me_probe()
157 err = dma_set_coherent_mask(&pdev->dev, in mei_me_probe()
161 dev_err(&pdev->dev, "No usable DMA configuration, aborting\n"); in mei_me_probe()
167 dev = mei_me_dev_init(pdev, cfg); in mei_me_probe()
168 if (!dev) { in mei_me_probe()
172 hw = to_me_hw(dev); in mei_me_probe()
176 dev_err(&pdev->dev, "mapping I/O device memory failure.\n"); in mei_me_probe()
187 IRQF_ONESHOT, KBUILD_MODNAME, dev); in mei_me_probe()
192 IRQF_SHARED, KBUILD_MODNAME, dev); in mei_me_probe()
195 dev_err(&pdev->dev, "request_threaded_irq failure. irq = %d\n", in mei_me_probe()
200 if (mei_start(dev)) { in mei_me_probe()
201 dev_err(&pdev->dev, "init hw failure.\n"); in mei_me_probe()
206 pm_runtime_set_autosuspend_delay(&pdev->dev, MEI_ME_RPM_TIMEOUT); in mei_me_probe()
207 pm_runtime_use_autosuspend(&pdev->dev); in mei_me_probe()
209 err = mei_register(dev, &pdev->dev); in mei_me_probe()
213 pci_set_drvdata(pdev, dev); in mei_me_probe()
215 schedule_delayed_work(&dev->timer_work, HZ); in mei_me_probe()
223 mei_me_set_pm_domain(dev); in mei_me_probe()
225 if (mei_pg_is_enabled(dev)) in mei_me_probe()
226 pm_runtime_put_noidle(&pdev->dev); in mei_me_probe()
228 dev_dbg(&pdev->dev, "initialization successful.\n"); in mei_me_probe()
233 mei_cancel_work(dev); in mei_me_probe()
234 mei_disable_interrupts(dev); in mei_me_probe()
235 free_irq(pdev->irq, dev); in mei_me_probe()
240 kfree(dev); in mei_me_probe()
246 dev_err(&pdev->dev, "initialization failed.\n"); in mei_me_probe()
260 struct mei_device *dev; in mei_me_remove() local
263 dev = pci_get_drvdata(pdev); in mei_me_remove()
264 if (!dev) in mei_me_remove()
267 if (mei_pg_is_enabled(dev)) in mei_me_remove()
268 pm_runtime_get_noresume(&pdev->dev); in mei_me_remove()
270 hw = to_me_hw(dev); in mei_me_remove()
273 dev_dbg(&pdev->dev, "stop\n"); in mei_me_remove()
274 mei_stop(dev); in mei_me_remove()
277 mei_me_unset_pm_domain(dev); in mei_me_remove()
280 mei_disable_interrupts(dev); in mei_me_remove()
282 free_irq(pdev->irq, dev); in mei_me_remove()
288 mei_deregister(dev); in mei_me_remove()
290 kfree(dev); in mei_me_remove()
301 struct mei_device *dev = pci_get_drvdata(pdev); in mei_me_pci_suspend() local
303 if (!dev) in mei_me_pci_suspend()
306 dev_dbg(&pdev->dev, "suspend\n"); in mei_me_pci_suspend()
308 mei_stop(dev); in mei_me_pci_suspend()
310 mei_disable_interrupts(dev); in mei_me_pci_suspend()
312 free_irq(pdev->irq, dev); in mei_me_pci_suspend()
321 struct mei_device *dev; in mei_me_pci_resume() local
324 dev = pci_get_drvdata(pdev); in mei_me_pci_resume()
325 if (!dev) in mei_me_pci_resume()
335 IRQF_ONESHOT, KBUILD_MODNAME, dev); in mei_me_pci_resume()
340 IRQF_SHARED, KBUILD_MODNAME, dev); in mei_me_pci_resume()
343 dev_err(&pdev->dev, "request_threaded_irq failed: irq = %d.\n", in mei_me_pci_resume()
348 err = mei_restart(dev); in mei_me_pci_resume()
353 schedule_delayed_work(&dev->timer_work, HZ); in mei_me_pci_resume()
363 struct mei_device *dev; in mei_me_pm_runtime_idle() local
365 dev_dbg(&pdev->dev, "rpm: me: runtime_idle\n"); in mei_me_pm_runtime_idle()
367 dev = pci_get_drvdata(pdev); in mei_me_pm_runtime_idle()
368 if (!dev) in mei_me_pm_runtime_idle()
370 if (mei_write_is_idle(dev)) in mei_me_pm_runtime_idle()
379 struct mei_device *dev; in mei_me_pm_runtime_suspend() local
382 dev_dbg(&pdev->dev, "rpm: me: runtime suspend\n"); in mei_me_pm_runtime_suspend()
384 dev = pci_get_drvdata(pdev); in mei_me_pm_runtime_suspend()
385 if (!dev) in mei_me_pm_runtime_suspend()
388 mutex_lock(&dev->device_lock); in mei_me_pm_runtime_suspend()
390 if (mei_write_is_idle(dev)) in mei_me_pm_runtime_suspend()
391 ret = mei_me_pg_enter_sync(dev); in mei_me_pm_runtime_suspend()
395 mutex_unlock(&dev->device_lock); in mei_me_pm_runtime_suspend()
397 dev_dbg(&pdev->dev, "rpm: me: runtime suspend ret=%d\n", ret); in mei_me_pm_runtime_suspend()
405 struct mei_device *dev; in mei_me_pm_runtime_resume() local
408 dev_dbg(&pdev->dev, "rpm: me: runtime resume\n"); in mei_me_pm_runtime_resume()
410 dev = pci_get_drvdata(pdev); in mei_me_pm_runtime_resume()
411 if (!dev) in mei_me_pm_runtime_resume()
414 mutex_lock(&dev->device_lock); in mei_me_pm_runtime_resume()
416 ret = mei_me_pg_exit_sync(dev); in mei_me_pm_runtime_resume()
418 mutex_unlock(&dev->device_lock); in mei_me_pm_runtime_resume()
420 dev_dbg(&pdev->dev, "rpm: me: runtime resume ret = %d\n", ret); in mei_me_pm_runtime_resume()
430 static inline void mei_me_set_pm_domain(struct mei_device *dev) in mei_me_set_pm_domain() argument
432 struct pci_dev *pdev = to_pci_dev(dev->dev); in mei_me_set_pm_domain()
434 if (pdev->dev.bus && pdev->dev.bus->pm) { in mei_me_set_pm_domain()
435 dev->pg_domain.ops = *pdev->dev.bus->pm; in mei_me_set_pm_domain()
437 dev->pg_domain.ops.runtime_suspend = mei_me_pm_runtime_suspend; in mei_me_set_pm_domain()
438 dev->pg_domain.ops.runtime_resume = mei_me_pm_runtime_resume; in mei_me_set_pm_domain()
439 dev->pg_domain.ops.runtime_idle = mei_me_pm_runtime_idle; in mei_me_set_pm_domain()
441 pdev->dev.pm_domain = &dev->pg_domain; in mei_me_set_pm_domain()
450 static inline void mei_me_unset_pm_domain(struct mei_device *dev) in mei_me_unset_pm_domain() argument
453 dev->dev->pm_domain = NULL; in mei_me_unset_pm_domain()