Skip to content

Commit fb1e493

Browse files
rbbrnsTzung-Bi Shih
authored andcommitted
platform/chrome: cros_ec_lpc: Only check for events on MKBP notifies
Only check EC for MKBP events when the ACPI notify value indicates the notify is due to an MKBP host event. This reduces unnecessary queries to the EC. Notify value 0x80 is reserved for devices specific notifies. It is used by many devices to indicate various events. It's only used by cros_ec for MKBP events. Signed-off-by: Rob Barnes <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 6fcbc55 commit fb1e493

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/platform/chrome/cros_ec_lpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
419419
return;
420420
}
421421

422-
if (ec_dev->mkbp_event_supported)
422+
if (value == ACPI_NOTIFY_CROS_EC_MKBP && ec_dev->mkbp_event_supported)
423423
do {
424424
ret = cros_ec_get_next_event(ec_dev, NULL,
425425
&ec_has_more_events);

include/linux/platform_data/cros_ec_proto.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
#define EC_MAX_REQUEST_OVERHEAD 1
4242
#define EC_MAX_RESPONSE_OVERHEAD 32
4343

44+
/*
45+
* ACPI notify value for MKBP host event.
46+
*/
47+
#define ACPI_NOTIFY_CROS_EC_MKBP 0x80
48+
4449
/*
4550
* EC panic is not covered by the standard (0-F) ACPI notify values.
4651
* Arbitrarily choosing B0 to notify ec panic, which is in the 84-BF

0 commit comments

Comments
 (0)