From 45b8465602da800ce35c16dacf24c811f78ddcac Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Sat, 17 Nov 2018 12:18:20 -0700 Subject: ec/google/wilco: Fix extended event handling Extended events will be handled by the OS kernel driver, but that driver needs a method exposed by ACPI to read the event data from the EC and into a buffer. Tested by generating a hotkey event and reading the buffer from the Linux kernel driver with acpi_evaluate_object(). Change-Id: Ic8510e38d777a5dd31a5237867313efefeb2b48e Signed-off-by: Duncan Laurie Reviewed-on: https://review.coreboot.org/c/29674 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/ec/google/wilco/acpi/event.asl | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/ec/google/wilco/acpi/event.asl') diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl index b43086c6c3..4d796b5c85 100644 --- a/src/ec/google/wilco/acpi/event.asl +++ b/src/ec/google/wilco/acpi/event.asl @@ -76,6 +76,11 @@ Method (ECQ1, 1, Serialized) Method (ECQ2, 1, Serialized) { Printf ("EVT2: %o", Arg0) + + If (EBIT (E2QS, Arg0)) { + Printf ("QS EVENT") + Notify (^WLCO, 0x90) + } } /* Handle events in PmEv3 */ @@ -90,12 +95,6 @@ Method (ECQ4, 1, Serialized) Printf ("EVT4: %o", Arg0) } -/* Handle QuickSet events */ -Method (ECQS, 1, Serialized) -{ - Printf ("QS EVENT %o", Arg0) -} - /* Process all events */ Method (_Q66, 0, Serialized) { @@ -118,9 +117,20 @@ Method (_Q66, 0, Serialized) If (Local0) { ECQ4 (Local0) } +} +/* Get Event Buffer */ +Method (QSET, 0, Serialized) +{ + /* Get count of event bytes */ Local0 = R (QSEC) + Name (QBUF, Buffer (Local0) {}) + + /* Fill QS event buffer with Local0 bytes */ For (Local1 = 0, Local1 < Local0, Local1++) { - ECQS (R (QSEB)) + QBUF[Local1] = R (QSEB) } + + Printf ("QS = %o", QBUF) + Return (QBUF) } -- cgit v1.2.3