If you are unsure what to do, do not enable this option.
+config ACPI_RESUME_POWER_BUTTON_EVENT
+ bool "Power Button Event on Resume"
+ depends on ACPI_BUTTON
+ depends on ACPI_SLEEP
+ default n
+ help
+ This enable power button notification after system resume because
+ of user action through a power/sleep button. Some user mode system
+ has hard dependency on this event for system suspend and resume.
+
source "drivers/acpi/apei/Kconfig"
config ACPI_EXTLOG
#include <linux/slab.h>
#include <linux/acpi.h>
#include <acpi/button.h>
-
-#define PREFIX "ACPI: "
-
-#define ACPI_BUTTON_CLASS "button"
-#define ACPI_BUTTON_FILE_INFO "info"
-#define ACPI_BUTTON_FILE_STATE "state"
-#define ACPI_BUTTON_TYPE_UNKNOWN 0x00
-#define ACPI_BUTTON_NOTIFY_STATUS 0x80
-
-#define ACPI_BUTTON_SUBCLASS_POWER "power"
-#define ACPI_BUTTON_HID_POWER "PNP0C0C"
-#define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button"
-#define ACPI_BUTTON_TYPE_POWER 0x01
-
-#define ACPI_BUTTON_SUBCLASS_SLEEP "sleep"
-#define ACPI_BUTTON_HID_SLEEP "PNP0C0E"
-#define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button"
-#define ACPI_BUTTON_TYPE_SLEEP 0x03
-
-#define ACPI_BUTTON_SUBCLASS_LID "lid"
-#define ACPI_BUTTON_HID_LID "PNP0C0D"
-#define ACPI_BUTTON_DEVICE_NAME_LID "Lid Switch"
-#define ACPI_BUTTON_TYPE_LID 0x05
+#include "internal.h"
#define _COMPONENT ACPI_BUTTON_COMPONENT
ACPI_MODULE_NAME("button");
bool acpi_device_is_battery(struct acpi_device *adev);
/* --------------------------------------------------------------------------
+ Button
+ -------------------------------------------------------------------------- */
+#define ACPI_BUTTON_CLASS "button"
+#define ACPI_BUTTON_FILE_INFO "info"
+#define ACPI_BUTTON_FILE_STATE "state"
+#define ACPI_BUTTON_TYPE_UNKNOWN 0x00
+#define ACPI_BUTTON_NOTIFY_STATUS 0x80
+
+#define ACPI_BUTTON_SUBCLASS_POWER "power"
+#define ACPI_BUTTON_HID_POWER "PNP0C0C"
+#define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button"
+#define ACPI_BUTTON_TYPE_POWER 0x01
+
+#define ACPI_BUTTON_SUBCLASS_SLEEP "sleep"
+#define ACPI_BUTTON_HID_SLEEP "PNP0C0E"
+#define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button"
+#define ACPI_BUTTON_TYPE_SLEEP 0x03
+
+#define ACPI_BUTTON_SUBCLASS_LID "lid"
+#define ACPI_BUTTON_HID_LID "PNP0C0D"
+#define ACPI_BUTTON_DEVICE_NAME_LID "Lid Switch"
+#define ACPI_BUTTON_TYPE_LID 0x05
+
+/* --------------------------------------------------------------------------
Power Resource
-------------------------------------------------------------------------- */
int acpi_power_init(void);
pwr_btn_dev = bus_find_device(&acpi_bus_type, NULL, NULL,
find_powerf_dev);
if (pwr_btn_dev) {
+#ifdef CONFIG_ACPI_RESUME_POWER_BUTTON_EVENT
+ struct acpi_device *device = to_acpi_device(pwr_btn_dev);
+ if (device->driver && device->driver->ops.notify) {
+ device->driver->ops.notify(device,
+ ACPI_BUTTON_NOTIFY_STATUS);
+ }
+#endif
pm_wakeup_event(pwr_btn_dev, 0);
put_device(pwr_btn_dev);
}