Lines Matching refs:wakeup
460 if (adev->wakeup.flags.notifier_present) {
461 pm_wakeup_ws_event(adev->wakeup.ws, 0, acpi_s2idle_wakeup());
462 if (adev->wakeup.context.func) {
464 adev->wakeup.context.func,
465 dev_name(adev->wakeup.context.dev));
466 adev->wakeup.context.func(&adev->wakeup.context);
478 * @dev: Device to generate a wakeup event for while handling the notification.
481 * NOTE: @adev need not be a run-wake or wakeup device to be a valid source of
482 * PM wakeup events. For example, wakeup events may be generated for bridges
483 * if one of the devices below the bridge is signaling wakeup, even if the
484 * bridge itself doesn't have a wakeup GPE associated with it.
496 if (adev->wakeup.flags.notifier_present)
505 adev->wakeup.ws = wakeup_source_register(&adev->dev,
507 adev->wakeup.context.dev = dev;
508 adev->wakeup.context.func = func;
509 adev->wakeup.flags.notifier_present = true;
527 if (!adev->wakeup.flags.notifier_present)
537 adev->wakeup.context.func = NULL;
538 adev->wakeup.context.dev = NULL;
539 wakeup_source_unregister(adev->wakeup.ws);
540 adev->wakeup.flags.notifier_present = false;
554 return result ? false : device->wakeup.flags.valid;
593 bool wakeup = false;
600 * wakeup, in which case the return value of _S0W has to be used as the
638 wakeup = device_may_wakeup(dev) && adev->wakeup.flags.valid
639 && adev->wakeup.sleep_state >= target_state;
641 wakeup = adev->wakeup.flags.valid;
647 * wakeup-aware driver if wake is set). Still, if _SxW exists
651 if (wakeup) {
737 * acpi_pm_notify_work_func - ACPI devices wakeup notification work function.
738 * @context: Device wakeup context.
755 struct acpi_device_wakeup *wakeup = &adev->wakeup;
761 if (wakeup->enable_count >= INT_MAX) {
765 if (wakeup->enable_count > 0)
772 status = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number);
779 acpi_handle_debug(adev->handle, "GPE%2X enabled for wakeup\n",
780 (unsigned int)wakeup->gpe_number);
783 wakeup->enable_count++;
791 * acpi_device_wakeup_enable - Enable wakeup functionality for device.
792 * @adev: ACPI device to enable wakeup functionality for.
795 * Enable the GPE associated with @adev so that it can generate wakeup signals
796 * for the device in response to external (remote) events and enable wakeup
808 * acpi_device_wakeup_disable - Disable wakeup functionality for device.
809 * @adev: ACPI device to disable wakeup functionality for.
811 * Disable the GPE associated with @adev and disable wakeup power for it.
818 struct acpi_device_wakeup *wakeup = &adev->wakeup;
822 if (!wakeup->enable_count)
825 acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
828 wakeup->enable_count--;
835 * acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device.
836 * @dev: Device to enable/disable to generate wakeup events.
837 * @enable: Whether to enable or disable the wakeup functionality.
898 * @wakeup: Whether or not to enable wakeup for the device.
901 * mechanism. Set up remote wakeup if desired, choose the state to put the
902 * device into (this checks if remote wakeup is expected to work too), and set
905 int acpi_dev_suspend(struct device *dev, bool wakeup)
914 if (wakeup && acpi_device_can_wakeup(adev)) {
919 wakeup = false;
923 if (error && wakeup)
935 * mechanism. Set the power state of the device to ACPI D0 and disable wakeup.
985 if (!pm_runtime_suspended(dev) || !adev || (adev->wakeup.flags.valid &&
986 device_may_wakeup(dev) != !!adev->wakeup.prepare_count))
1096 * to check whether or not the device's wakeup settings are good for
1249 * Remove the device from the general ACPI PM domain and remove its wakeup
1284 * attached to it, install a wakeup notification handler for the device and