Lines Matching refs:dev

35 static inline void mei_txe_set_pm_domain(struct mei_device *dev);
36 static inline void mei_txe_unset_pm_domain(struct mei_device *dev);
38 static inline void mei_txe_set_pm_domain(struct mei_device *dev) {}
39 static inline void mei_txe_unset_pm_domain(struct mei_device *dev) {}
52 struct mei_device *dev;
57 /* enable pci dev */
60 dev_err(&pdev->dev, "failed to enable pci device.\n");
68 dev_err(&pdev->dev, "failed to get pci regions.\n");
72 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(36));
74 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
76 dev_err(&pdev->dev, "No suitable DMA available.\n");
81 /* allocates and initializes the mei dev structure */
82 dev = mei_txe_dev_init(pdev);
83 if (!dev) {
87 hw = to_txe_hw(dev);
93 mei_clear_interrupts(dev);
100 IRQF_ONESHOT, KBUILD_MODNAME, dev);
105 IRQF_SHARED, KBUILD_MODNAME, dev);
107 dev_err(&pdev->dev, "mei: request_threaded_irq failure. irq = %d\n",
112 if (mei_start(dev)) {
113 dev_err(&pdev->dev, "init hw failure.\n");
118 pm_runtime_set_autosuspend_delay(&pdev->dev, MEI_TXI_RPM_TIMEOUT);
119 pm_runtime_use_autosuspend(&pdev->dev);
121 err = mei_register(dev, &pdev->dev);
125 pci_set_drvdata(pdev, dev);
131 dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NO_DIRECT_COMPLETE);
141 mei_txe_set_pm_domain(dev);
143 pm_runtime_put_noidle(&pdev->dev);
148 mei_stop(dev);
150 mei_cancel_work(dev);
151 mei_disable_interrupts(dev);
152 free_irq(pdev->irq, dev);
154 dev_err(&pdev->dev, "initialization failed.\n");
169 struct mei_device *dev;
171 dev = pci_get_drvdata(pdev);
172 if (!dev)
175 dev_dbg(&pdev->dev, "shutdown\n");
176 mei_stop(dev);
178 mei_txe_unset_pm_domain(dev);
180 mei_disable_interrupts(dev);
181 free_irq(pdev->irq, dev);
194 struct mei_device *dev;
196 dev = pci_get_drvdata(pdev);
197 if (!dev) {
198 dev_err(&pdev->dev, "mei: dev == NULL\n");
202 pm_runtime_get_noresume(&pdev->dev);
204 mei_stop(dev);
206 mei_txe_unset_pm_domain(dev);
208 mei_disable_interrupts(dev);
209 free_irq(pdev->irq, dev);
211 mei_deregister(dev);
219 struct mei_device *dev = pci_get_drvdata(pdev);
221 if (!dev)
224 dev_dbg(&pdev->dev, "suspend\n");
226 mei_stop(dev);
228 mei_disable_interrupts(dev);
230 free_irq(pdev->irq, dev);
239 struct mei_device *dev;
242 dev = pci_get_drvdata(pdev);
243 if (!dev)
248 mei_clear_interrupts(dev);
255 IRQF_ONESHOT, KBUILD_MODNAME, dev);
260 IRQF_SHARED, KBUILD_MODNAME, dev);
262 dev_err(&pdev->dev, "request_threaded_irq failed: irq = %d.\n",
267 err = mei_restart(dev);
276 struct mei_device *dev;
280 dev = dev_get_drvdata(device);
281 if (!dev)
283 if (mei_write_is_idle(dev))
290 struct mei_device *dev;
295 dev = dev_get_drvdata(device);
296 if (!dev)
299 mutex_lock(&dev->device_lock);
301 if (mei_write_is_idle(dev))
302 ret = mei_txe_aliveness_set_sync(dev, 0);
310 mutex_unlock(&dev->device_lock);
313 schedule_work(&dev->reset_work);
320 struct mei_device *dev;
325 dev = dev_get_drvdata(device);
326 if (!dev)
329 mutex_lock(&dev->device_lock);
331 mei_enable_interrupts(dev);
333 ret = mei_txe_aliveness_set_sync(dev, 1);
335 mutex_unlock(&dev->device_lock);
340 schedule_work(&dev->reset_work);
348 * @dev: mei_device
350 static inline void mei_txe_set_pm_domain(struct mei_device *dev)
352 struct pci_dev *pdev = to_pci_dev(dev->dev);
354 if (pdev->dev.bus && pdev->dev.bus->pm) {
355 dev->pg_domain.ops = *pdev->dev.bus->pm;
357 dev->pg_domain.ops.runtime_suspend = mei_txe_pm_runtime_suspend;
358 dev->pg_domain.ops.runtime_resume = mei_txe_pm_runtime_resume;
359 dev->pg_domain.ops.runtime_idle = mei_txe_pm_runtime_idle;
361 dev_pm_domain_set(&pdev->dev, &dev->pg_domain);
368 * @dev: mei_device
370 static inline void mei_txe_unset_pm_domain(struct mei_device *dev)
373 dev_pm_domain_set(dev->dev, NULL);