Lines Matching refs:idev
272 struct intel_device *idev = dev_id; in intel_irq() local
274 dev_info(&idev->pdev->dev, "hci_intel irq\n"); in intel_irq()
276 mutex_lock(&idev->hu_lock); in intel_irq()
277 if (idev->hu) in intel_irq()
278 intel_lpm_host_wake(idev->hu); in intel_irq()
279 mutex_unlock(&idev->hu_lock); in intel_irq()
282 pm_runtime_get(&idev->pdev->dev); in intel_irq()
283 pm_runtime_mark_last_busy(&idev->pdev->dev); in intel_irq()
284 pm_runtime_put_autosuspend(&idev->pdev->dev); in intel_irq()
291 struct intel_device *idev; in intel_set_power() local
299 list_for_each_entry(idev, &intel_device_list, list) { in intel_set_power()
303 if (hu->tty->dev->parent != idev->pdev->dev.parent) in intel_set_power()
306 if (!idev->reset) { in intel_set_power()
312 hu, dev_name(&idev->pdev->dev), powered); in intel_set_power()
314 gpiod_set_value(idev->reset, powered); in intel_set_power()
321 mutex_lock(&idev->hu_lock); in intel_set_power()
322 idev->hu = powered ? hu : NULL; in intel_set_power()
323 mutex_unlock(&idev->hu_lock); in intel_set_power()
325 if (idev->irq < 0) in intel_set_power()
328 if (powered && device_can_wakeup(&idev->pdev->dev)) { in intel_set_power()
329 err = devm_request_threaded_irq(&idev->pdev->dev, in intel_set_power()
330 idev->irq, NULL, in intel_set_power()
333 "bt-host-wake", idev); in intel_set_power()
336 hu, idev->irq); in intel_set_power()
340 device_wakeup_enable(&idev->pdev->dev); in intel_set_power()
342 pm_runtime_set_active(&idev->pdev->dev); in intel_set_power()
343 pm_runtime_use_autosuspend(&idev->pdev->dev); in intel_set_power()
344 pm_runtime_set_autosuspend_delay(&idev->pdev->dev, in intel_set_power()
346 pm_runtime_enable(&idev->pdev->dev); in intel_set_power()
347 } else if (!powered && device_may_wakeup(&idev->pdev->dev)) { in intel_set_power()
348 devm_free_irq(&idev->pdev->dev, idev->irq, idev); in intel_set_power()
349 device_wakeup_disable(&idev->pdev->dev); in intel_set_power()
351 pm_runtime_disable(&idev->pdev->dev); in intel_set_power()
364 struct intel_device *idev; in intel_busy_work() local
371 list_for_each_entry(idev, &intel_device_list, list) { in intel_busy_work()
372 if (intel->hu->tty->dev->parent == idev->pdev->dev.parent) { in intel_busy_work()
373 pm_runtime_get(&idev->pdev->dev); in intel_busy_work()
374 pm_runtime_mark_last_busy(&idev->pdev->dev); in intel_busy_work()
375 pm_runtime_put_autosuspend(&idev->pdev->dev); in intel_busy_work()
530 struct intel_device *idev; in intel_setup() local
833 list_for_each_entry(idev, &intel_device_list, list) { in intel_setup()
836 if (hu->tty->dev->parent == idev->pdev->dev.parent) { in intel_setup()
837 if (device_may_wakeup(&idev->pdev->dev)) { in intel_setup()
991 struct intel_device *idev; in intel_enqueue() local
1002 list_for_each_entry(idev, &intel_device_list, list) { in intel_enqueue()
1003 if (hu->tty->dev->parent == idev->pdev->dev.parent) { in intel_enqueue()
1004 pm_runtime_get_sync(&idev->pdev->dev); in intel_enqueue()
1005 pm_runtime_mark_last_busy(&idev->pdev->dev); in intel_enqueue()
1006 pm_runtime_put_autosuspend(&idev->pdev->dev); in intel_enqueue()
1074 struct intel_device *idev = dev_get_drvdata(dev); in intel_suspend_device() local
1076 mutex_lock(&idev->hu_lock); in intel_suspend_device()
1077 if (idev->hu) in intel_suspend_device()
1078 intel_lpm_suspend(idev->hu); in intel_suspend_device()
1079 mutex_unlock(&idev->hu_lock); in intel_suspend_device()
1086 struct intel_device *idev = dev_get_drvdata(dev); in intel_resume_device() local
1088 mutex_lock(&idev->hu_lock); in intel_resume_device()
1089 if (idev->hu) in intel_resume_device()
1090 intel_lpm_resume(idev->hu); in intel_resume_device()
1091 mutex_unlock(&idev->hu_lock); in intel_resume_device()
1100 struct intel_device *idev = dev_get_drvdata(dev); in intel_suspend() local
1103 enable_irq_wake(idev->irq); in intel_suspend()
1110 struct intel_device *idev = dev_get_drvdata(dev); in intel_resume() local
1113 disable_irq_wake(idev->irq); in intel_resume()
1135 struct intel_device *idev; in intel_probe() local
1138 idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL); in intel_probe()
1139 if (!idev) in intel_probe()
1142 mutex_init(&idev->hu_lock); in intel_probe()
1144 idev->pdev = pdev; in intel_probe()
1150 idev->reset = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW); in intel_probe()
1151 if (IS_ERR(idev->reset)) { in intel_probe()
1153 return PTR_ERR(idev->reset); in intel_probe()
1156 idev->irq = platform_get_irq(pdev, 0); in intel_probe()
1157 if (idev->irq < 0) { in intel_probe()
1168 idev->irq = gpiod_to_irq(host_wake); in intel_probe()
1169 if (idev->irq < 0) { in intel_probe()
1180 platform_set_drvdata(pdev, idev); in intel_probe()
1184 list_add_tail(&idev->list, &intel_device_list); in intel_probe()
1188 desc_to_gpio(idev->reset), idev->irq); in intel_probe()
1195 struct intel_device *idev = platform_get_drvdata(pdev); in intel_remove() local
1200 list_del(&idev->list); in intel_remove()