2 * This file is part of the coreboot project.
4 * Copyright 2018 Google LLC
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 /* ACPI_POWER_RECORD */
20 Method (ECQP, 0, Serialized)
23 Local1 = Local0 ^ ECPR
26 If (EBIT (APAC, Local1)) {
27 Printf ("AC Power Status Changed")
31 If (EBIT (APB1, Local1)) {
32 If (EBIT (APB1, Local0)) {
33 Printf ("BAT0 Inserted")
36 Printf ("BAT0 Removed")
42 If (EBIT (APC1, Local1)) {
43 Printf ("BAT0 Status Change")
48 /* Handle events in PmEv1 */
49 Method (ECQ1, 1, Serialized)
51 /* Power button pressed */
52 If (EBIT (E1PB, Arg0)) {
53 Printf ("Power Button Event")
54 /* Do not notify \_SB.PWRB here to prevent double event */
57 /* LID state changed */
58 If (EBIT (E1LD, Arg0)) {
59 Printf ("Lid State Changed")
64 If (EBIT (E1PW, Arg0)) {
65 Printf ("Power Event")
70 If (EBIT (E1SB, Arg0)) {
71 Printf ("Sleep Button")
75 /* Handle events in PmEv2 */
76 Method (ECQ2, 1, Serialized)
78 Printf ("EVT2: %o", Arg0)
80 If (EBIT (E2QS, Arg0)) {
86 /* Handle events in PmEv3 */
87 Method (ECQ3, 1, Serialized)
89 Printf ("EVT3: %o", Arg0)
92 If (EBIT (E3TH, Arg0)) {
97 /* Handle events in PmEv4 */
98 Method (ECQ4, 1, Serialized)
100 Printf ("EVT4: %o", Arg0)
103 /* Process all events */
104 Method (_Q66, 0, Serialized)
127 /* Get Event Buffer */
128 Method (QSET, 0, Serialized)
130 /* Get count of event bytes */
132 Name (QBUF, Buffer (Local0) {})
134 /* Fill QS event buffer with Local0 bytes */
135 For (Local1 = 0, Local1 < Local0, Local1++) {
136 QBUF[Local1] = R (QSEB)
139 Printf ("QS = %o", QBUF)