Lines Matching refs:wakeup

544 	if (adev->wakeup.flags.notifier_present) {  in acpi_pm_notify_handler()
545 pm_wakeup_ws_event(adev->wakeup.ws, 0, acpi_s2idle_wakeup()); in acpi_pm_notify_handler()
546 if (adev->wakeup.context.func) { in acpi_pm_notify_handler()
548 adev->wakeup.context.func, in acpi_pm_notify_handler()
549 dev_name(adev->wakeup.context.dev)); in acpi_pm_notify_handler()
550 adev->wakeup.context.func(&adev->wakeup.context); in acpi_pm_notify_handler()
580 if (adev->wakeup.flags.notifier_present) in acpi_add_pm_notifier()
589 adev->wakeup.ws = wakeup_source_register(&adev->dev, in acpi_add_pm_notifier()
591 adev->wakeup.context.dev = dev; in acpi_add_pm_notifier()
592 adev->wakeup.context.func = func; in acpi_add_pm_notifier()
593 adev->wakeup.flags.notifier_present = true; in acpi_add_pm_notifier()
611 if (!adev->wakeup.flags.notifier_present) in acpi_remove_pm_notifier()
621 adev->wakeup.context.func = NULL; in acpi_remove_pm_notifier()
622 adev->wakeup.context.dev = NULL; in acpi_remove_pm_notifier()
623 wakeup_source_unregister(adev->wakeup.ws); in acpi_remove_pm_notifier()
624 adev->wakeup.flags.notifier_present = false; in acpi_remove_pm_notifier()
636 return device && device->wakeup.flags.valid; in acpi_bus_can_wakeup()
675 bool wakeup = false; in acpi_dev_pm_get_state() local
720 wakeup = device_may_wakeup(dev) && adev->wakeup.flags.valid in acpi_dev_pm_get_state()
721 && adev->wakeup.sleep_state >= target_state; in acpi_dev_pm_get_state()
735 wakeup = true; in acpi_dev_pm_get_state()
738 wakeup = adev->wakeup.flags.valid; in acpi_dev_pm_get_state()
748 if (wakeup) { in acpi_dev_pm_get_state()
852 struct acpi_device_wakeup *wakeup = &adev->wakeup; in __acpi_device_wakeup_enable() local
864 if (wakeup->enable_count > 0) in __acpi_device_wakeup_enable()
869 if (wakeup->enable_count > 0) { in __acpi_device_wakeup_enable()
870 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number); in __acpi_device_wakeup_enable()
871 wakeup->enable_count = 0; in __acpi_device_wakeup_enable()
876 if (wakeup->enable_count > 0) in __acpi_device_wakeup_enable()
879 status = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number); in __acpi_device_wakeup_enable()
887 (unsigned int)wakeup->gpe_number); in __acpi_device_wakeup_enable()
890 if (wakeup->enable_count < INT_MAX) in __acpi_device_wakeup_enable()
891 wakeup->enable_count++; in __acpi_device_wakeup_enable()
928 struct acpi_device_wakeup *wakeup = &adev->wakeup; in acpi_device_wakeup_disable() local
932 if (!wakeup->enable_count) in acpi_device_wakeup_disable()
935 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number); in acpi_device_wakeup_disable()
938 wakeup->enable_count--; in acpi_device_wakeup_disable()
1015 int acpi_dev_suspend(struct device *dev, bool wakeup) in acpi_dev_suspend() argument
1024 if (wakeup && acpi_device_can_wakeup(adev)) { in acpi_dev_suspend()
1029 wakeup = false; in acpi_dev_suspend()
1033 if (error && wakeup) in acpi_dev_suspend()
1097 if (!pm_runtime_suspended(dev) || !adev || (adev->wakeup.flags.valid && in acpi_dev_needs_resume()
1098 device_may_wakeup(dev) != !!adev->wakeup.prepare_count)) in acpi_dev_needs_resume()