Lines Matching refs:wakeup

501  * acpi_dev_power_state_for_wake - Deepest power state for wakeup signaling
544 if (adev->wakeup.flags.notifier_present) {
545 pm_wakeup_ws_event(adev->wakeup.ws, 0, acpi_s2idle_wakeup());
546 if (adev->wakeup.context.func) {
548 adev->wakeup.context.func,
549 dev_name(adev->wakeup.context.dev));
550 adev->wakeup.context.func(&adev->wakeup.context);
562 * @dev: Device to generate a wakeup event for while handling the notification.
565 * NOTE: @adev need not be a run-wake or wakeup device to be a valid source of
566 * PM wakeup events. For example, wakeup events may be generated for bridges
567 * if one of the devices below the bridge is signaling wakeup, even if the
568 * bridge itself doesn't have a wakeup GPE associated with it.
580 if (adev->wakeup.flags.notifier_present)
589 adev->wakeup.ws = wakeup_source_register(&adev->dev,
591 adev->wakeup.context.dev = dev;
592 adev->wakeup.context.func = func;
593 adev->wakeup.flags.notifier_present = true;
611 if (!adev->wakeup.flags.notifier_present)
621 adev->wakeup.context.func = NULL;
622 adev->wakeup.context.dev = NULL;
623 wakeup_source_unregister(adev->wakeup.ws);
624 adev->wakeup.flags.notifier_present = false;
636 return device && device->wakeup.flags.valid;
675 bool wakeup = false;
682 * wakeup, in which case the return value of _S0W has to be used as the
720 wakeup = device_may_wakeup(dev) && adev->wakeup.flags.valid
721 && adev->wakeup.sleep_state >= target_state;
735 wakeup = true;
738 wakeup = adev->wakeup.flags.valid;
744 * wakeup-aware driver if wake is set). Still, if _SxW exists
748 if (wakeup) {
834 * acpi_pm_notify_work_func - ACPI devices wakeup notification work function.
835 * @context: Device wakeup context.
852 struct acpi_device_wakeup *wakeup = &adev->wakeup;
859 * If the device wakeup power is already enabled, disable it and enable
864 if (wakeup->enable_count > 0)
869 if (wakeup->enable_count > 0) {
870 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
871 wakeup->enable_count = 0;
876 if (wakeup->enable_count > 0)
879 status = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number);
886 acpi_handle_debug(adev->handle, "GPE%2X enabled for wakeup\n",
887 (unsigned int)wakeup->gpe_number);
890 if (wakeup->enable_count < INT_MAX)
891 wakeup->enable_count++;
901 * acpi_device_wakeup_enable - Enable wakeup functionality for device.
902 * @adev: ACPI device to enable wakeup functionality for.
905 * Enable the GPE associated with @adev so that it can generate wakeup signals
906 * for the device in response to external (remote) events and enable wakeup
918 * acpi_device_wakeup_disable - Disable wakeup functionality for device.
919 * @adev: ACPI device to disable wakeup functionality for.
921 * Disable the GPE associated with @adev and disable wakeup power for it.
928 struct acpi_device_wakeup *wakeup = &adev->wakeup;
932 if (!wakeup->enable_count)
935 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
938 wakeup->enable_count--;
945 * acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device.
946 * @dev: Device to enable/disable to generate wakeup events.
947 * @enable: Whether to enable or disable the wakeup functionality.
1008 * @wakeup: Whether or not to enable wakeup for the device.
1011 * mechanism. Set up remote wakeup if desired, choose the state to put the
1012 * device into (this checks if remote wakeup is expected to work too), and set
1015 int acpi_dev_suspend(struct device *dev, bool wakeup)
1024 if (wakeup && acpi_device_can_wakeup(adev)) {
1029 wakeup = false;
1033 if (error && wakeup)
1045 * mechanism. Set the power state of the device to ACPI D0 and disable wakeup.
1097 if (!pm_runtime_suspended(dev) || !adev || (adev->wakeup.flags.valid &&
1098 device_may_wakeup(dev) != !!adev->wakeup.prepare_count))
1208 * to check whether or not the device's wakeup settings are good for
1392 * Remove the device from the general ACPI PM domain and remove its wakeup
1427 * attached to it, install a wakeup notification handler for the device and