History

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.

Rob Barnes committed 1 year ago

Commit fb1e4931 parent 6fcbc552 files · +6 −1Browse files

Unified · Split

2 files
  1. drivers/platform/chrome/cros_ec_lpc.c +1 −1
  2. include/linux/platform_data/cros_ec_proto.h +5 −0
drivers/platform/chrome/cros_ec_lpc.c+1−1
@@ -419,7 +419,7 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data) · 418 unmodified lines
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+5−0
@@ -41,6 +41,11 @@ · 40 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t