Angel Pons | 210a008 | 2020-04-02 23:48:24 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Duncan Laurie | a802be2 | 2018-10-15 15:01:15 -0700 | [diff] [blame] | 2 | |
| 3 | Device (WLCO) |
| 4 | { |
| 5 | Name (_HID, "GOOG000C") |
| 6 | Name (_UID, 1) |
| 7 | Name (_DDN, "Wilco EC Command Device") |
Duncan Laurie | db48f7e | 2018-10-29 16:49:02 -0700 | [diff] [blame] | 8 | #ifdef EC_WAKE_PIN |
| 9 | Name (_PRW, Package () { EC_WAKE_PIN, 0x5 }) |
| 10 | #endif |
Duncan Laurie | a802be2 | 2018-10-15 15:01:15 -0700 | [diff] [blame] | 11 | |
| 12 | Method (_STA) |
| 13 | { |
Matt DeVillier | 1b30293 | 2022-05-23 17:10:04 -0500 | [diff] [blame] | 14 | Return (0xb) |
Duncan Laurie | a802be2 | 2018-10-15 15:01:15 -0700 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | Name (_CRS, ResourceTemplate () |
| 18 | { |
| 19 | IO (Decode16, |
| 20 | CONFIG_EC_BASE_HOST_DATA, |
| 21 | CONFIG_EC_BASE_HOST_DATA, |
| 22 | 4, 4) |
| 23 | IO (Decode16, |
| 24 | CONFIG_EC_BASE_HOST_COMMAND, |
| 25 | CONFIG_EC_BASE_HOST_COMMAND, |
| 26 | 4, 4) |
| 27 | IO (Decode16, |
| 28 | CONFIG_EC_BASE_PACKET, |
| 29 | CONFIG_EC_BASE_PACKET, |
| 30 | 16, 16) |
| 31 | }) |
Duncan Laurie | a802be2 | 2018-10-15 15:01:15 -0700 | [diff] [blame] | 32 | } |
Duncan Laurie | aaac678 | 2019-02-01 09:37:34 -0800 | [diff] [blame] | 33 | |
| 34 | Device (WEVT) |
| 35 | { |
| 36 | Name (_HID, "GOOG000D") |
| 37 | Name (_UID, 1) |
| 38 | Name (_DDN, "Wilco EC Event Interface") |
| 39 | |
| 40 | Method (_STA) |
| 41 | { |
| 42 | Return (0xB) |
| 43 | } |
| 44 | |
| 45 | /* Get Event Buffer */ |
| 46 | Method (QSET, 0, Serialized) |
| 47 | { |
| 48 | /* Get count of event bytes */ |
| 49 | Local0 = R (QSEC) |
| 50 | Name (QBUF, Buffer (Local0) {}) |
| 51 | |
| 52 | /* Fill QS event buffer with Local0 bytes */ |
| 53 | For (Local1 = 0, Local1 < Local0, Local1++) { |
| 54 | QBUF[Local1] = R (QSEB) |
| 55 | } |
| 56 | |
| 57 | Printf ("QS = %o", QBUF) |
| 58 | Return (QBUF) |
| 59 | } |
| 60 | } |