Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/29674 )
Change subject: ec/google/wilco: Fix extended event handling ......................................................................
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 dlaurie@google.com Reviewed-on: https://review.coreboot.org/c/29674 Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/ec/google/wilco/acpi/ec_ram.asl M src/ec/google/wilco/acpi/event.asl 2 files changed, 20 insertions(+), 10 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/ec/google/wilco/acpi/ec_ram.asl b/src/ec/google/wilco/acpi/ec_ram.asl index ffa0c9f..e2b6a93 100644 --- a/src/ec/google/wilco/acpi/ec_ram.asl +++ b/src/ec/google/wilco/acpi/ec_ram.asl @@ -67,7 +67,7 @@ Name (EVT2, Package () { 0x08, 0xff, RD }) /* Event 2 */ Name (E2BS, Package () { 0x08, 0x02, RD }) /* BSS */ Name (E2OR, Package () { 0x08, 0x04, RD }) /* Orientation */ -Name (E2QS, Package () { 0x08, 0x08, RD }) /* Quickset */ +Name (E2QS, Package () { 0x08, 0x08, RD }) /* QS Event */ Name (E2PN, Package () { 0x08, 0x20, RD }) /* Panel */ Name (E2DP, Package () { 0x08, 0x40, RD }) /* Display Port */ Name (E2VT, Package () { 0x08, 0x80, RD }) /* Video Throttle */ @@ -100,8 +100,8 @@ Name (BSDC, Package () { 0x29, 0xff, RD }) /* BSTATIC: Device Chemistry */ Name (BSBS, Package () { 0x2a, 0xff, RD }) /* BSTATIC: Battery String */
-Name (QSEC, Package () { 0x2b, 0xff, RD }) /* QuickSet Event Count */ -Name (QSEB, Package () { 0x2c, 0xff, RD }) /* QuickSet Event Byte */ +Name (QSEC, Package () { 0x2b, 0xff, RD }) /* QS Event Count */ +Name (QSEB, Package () { 0x2c, 0xff, RD }) /* QS Event Byte */
Name (ORST, Package () { 0x39, 0xff, RD }) /* Orientation State */ Name (OREV, Package () { 0x3a, 0xff, RD }) /* Orientation Events */ diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl index b43086c..4d796b5 100644 --- a/src/ec/google/wilco/acpi/event.asl +++ b/src/ec/google/wilco/acpi/event.asl @@ -76,6 +76,11 @@ 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 @@ 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 @@ 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) }