Lines Matching refs:bdev
310 struct bcm_device *bdev = data; in bcm_host_wake() local
312 bt_dev_dbg(bdev, "Host wake IRQ"); in bcm_host_wake()
314 pm_runtime_get(bdev->dev); in bcm_host_wake()
315 pm_runtime_mark_last_busy(bdev->dev); in bcm_host_wake()
316 pm_runtime_put_autosuspend(bdev->dev); in bcm_host_wake()
323 struct bcm_device *bdev = bcm->dev; in bcm_request_irq() local
327 if (!bcm_device_exists(bdev)) { in bcm_request_irq()
332 if (bdev->irq <= 0) { in bcm_request_irq()
337 err = devm_request_irq(bdev->dev, bdev->irq, bcm_host_wake, in bcm_request_irq()
338 bdev->irq_active_low ? IRQF_TRIGGER_FALLING : in bcm_request_irq()
340 "host_wake", bdev); in bcm_request_irq()
342 bdev->irq = err; in bcm_request_irq()
346 bdev->irq_acquired = true; in bcm_request_irq()
348 device_init_wakeup(bdev->dev, true); in bcm_request_irq()
350 pm_runtime_set_autosuspend_delay(bdev->dev, in bcm_request_irq()
352 pm_runtime_use_autosuspend(bdev->dev); in bcm_request_irq()
353 pm_runtime_set_active(bdev->dev); in bcm_request_irq()
354 pm_runtime_enable(bdev->dev); in bcm_request_irq()
511 struct bcm_device *bdev = NULL; in bcm_close() local
520 bdev = serdev_device_get_drvdata(hu->serdev); in bcm_close()
522 bdev = bcm->dev; in bcm_close()
524 bdev->hu = NULL; in bcm_close()
528 if (bdev) { in bcm_close()
529 if (IS_ENABLED(CONFIG_PM) && bdev->irq_acquired) { in bcm_close()
530 devm_free_irq(bdev->dev, bdev->irq, bdev); in bcm_close()
531 device_init_wakeup(bdev->dev, false); in bcm_close()
532 pm_runtime_disable(bdev->dev); in bcm_close()
535 err = bcm_gpio_set_power(bdev, false); in bcm_close()
539 pm_runtime_set_suspended(bdev->dev); in bcm_close()
718 struct bcm_device *bdev = NULL; in bcm_dequeue() local
723 bdev = bcm->dev; in bcm_dequeue()
724 pm_runtime_get_sync(bdev->dev); in bcm_dequeue()
730 if (bdev) { in bcm_dequeue()
731 pm_runtime_mark_last_busy(bdev->dev); in bcm_dequeue()
732 pm_runtime_put_autosuspend(bdev->dev); in bcm_dequeue()
743 struct bcm_device *bdev = dev_get_drvdata(dev); in bcm_suspend_device() local
746 bt_dev_dbg(bdev, ""); in bcm_suspend_device()
748 if (!bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
749 hci_uart_set_flow_control(bdev->hu, true); in bcm_suspend_device()
752 bdev->is_suspended = true; in bcm_suspend_device()
756 err = bdev->set_device_wakeup(bdev, false); in bcm_suspend_device()
758 if (bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
759 bdev->is_suspended = false; in bcm_suspend_device()
760 hci_uart_set_flow_control(bdev->hu, false); in bcm_suspend_device()
765 bt_dev_dbg(bdev, "suspend, delaying 15 ms"); in bcm_suspend_device()
773 struct bcm_device *bdev = dev_get_drvdata(dev); in bcm_resume_device() local
776 bt_dev_dbg(bdev, ""); in bcm_resume_device()
778 err = bdev->set_device_wakeup(bdev, true); in bcm_resume_device()
784 bt_dev_dbg(bdev, "resume, delaying 15 ms"); in bcm_resume_device()
788 if (bdev->is_suspended && bdev->hu) { in bcm_resume_device()
789 bdev->is_suspended = false; in bcm_resume_device()
791 hci_uart_set_flow_control(bdev->hu, false); in bcm_resume_device()
802 struct bcm_device *bdev = dev_get_drvdata(dev); in bcm_suspend() local
805 bt_dev_dbg(bdev, "suspend: is_suspended %d", bdev->is_suspended); in bcm_suspend()
815 if (!bdev->hu) in bcm_suspend()
821 if (device_may_wakeup(dev) && bdev->irq > 0) { in bcm_suspend()
822 error = enable_irq_wake(bdev->irq); in bcm_suspend()
824 bt_dev_dbg(bdev, "BCM irq: enabled"); in bcm_suspend()
836 struct bcm_device *bdev = dev_get_drvdata(dev); in bcm_resume() local
839 bt_dev_dbg(bdev, "resume: is_suspended %d", bdev->is_suspended); in bcm_resume()
849 if (!bdev->hu) in bcm_resume()
852 if (device_may_wakeup(dev) && bdev->irq > 0) { in bcm_resume()
853 disable_irq_wake(bdev->irq); in bcm_resume()
854 bt_dev_dbg(bdev, "BCM irq: disabled"); in bcm_resume()
1170 static int bcm_of_probe(struct bcm_device *bdev) in bcm_of_probe() argument
1172 device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed); in bcm_of_probe()
1173 device_property_read_u8_array(bdev->dev, "brcm,bt-pcm-int-params", in bcm_of_probe()
1174 bdev->pcm_int_params, 5); in bcm_of_probe()
1175 bdev->irq = of_irq_get_byname(bdev->dev->of_node, "host-wakeup"); in bcm_of_probe()
1176 bdev->irq_active_low = irq_get_trigger_type(bdev->irq) in bcm_of_probe()