]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ACPI: EC: Return bool from acpi_ec_dispatch_gpe()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 15 Jul 2019 11:03:39 +0000 (13:03 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 23 Jul 2019 07:46:20 +0000 (09:46 +0200)
On some systems, if suspend-to-idle is used, the EC may signal system
wakeup events (power button events, for example) as well as events
that should not cause the system to resume and acpi_ec_dispatch_gpe()
needs to be called to determine whether or not the system should
resume then.  In particular, if acpi_ec_dispatch_gpe() doesn't detect
any EC events at all, the system should remain suspended, so it is
useful to know when that is the case.

For this reason, make acpi_ec_dispatch_gpe() return a bool value
indicating whether or not any EC events have been detected by it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
drivers/acpi/ec.c
drivers/acpi/internal.h

index c33756ed33049cd9e9eced123177c556f76874ee..58c7ad402d8dce8b93464ea6d79169a96320d26b 100644 (file)
@@ -1060,10 +1060,15 @@ void acpi_ec_set_gpe_wake_mask(u8 action)
                acpi_set_gpe_wake_mask(NULL, first_ec->gpe, action);
 }
 
-void acpi_ec_dispatch_gpe(void)
+bool acpi_ec_dispatch_gpe(void)
 {
-       if (first_ec)
-               acpi_dispatch_gpe(NULL, first_ec->gpe);
+       u32 ret;
+
+       if (!first_ec)
+               return false;
+
+       ret = acpi_dispatch_gpe(NULL, first_ec->gpe);
+       return ret == ACPI_INTERRUPT_HANDLED;
 }
 
 /* --------------------------------------------------------------------------
index f4c2fe6be4f2d8a9bfe48fb880755771bbe823cd..1b5f9ac06ea8d2f6267a89cb942fe8788a327967 100644 (file)
@@ -196,7 +196,7 @@ void acpi_ec_block_transactions(void);
 void acpi_ec_unblock_transactions(void);
 void acpi_ec_mark_gpe_for_wake(void);
 void acpi_ec_set_gpe_wake_mask(u8 action);
-void acpi_ec_dispatch_gpe(void);
+bool acpi_ec_dispatch_gpe(void);
 int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
                              acpi_handle handle, acpi_ec_query_func func,
                              void *data);