1 /* SPDX-License-Identifier: GPL-2.0-only */
9 Name (_HID, EisaId ("PNP0C09"))
11 Name (_GPE, CONFIG_EC_GPE_SCI)
40 Name (BFFR, ResourceTemplate()
42 IO(Decode16, 0x0062, 0x0062, 0x00, 0x01)
43 IO(Decode16, 0x0066, 0x0066, 0x00, 0x01)
46 Method (_CRS, 0, Serialized)
51 Method (_STA, 0, NotSerialized)
57 OperationRegion (SIPR, SystemIO, 0xB2, 0x1)
58 Field (SIPR, ByteAcc, Lock, Preserve) {
64 // ECRD (Embedded Controller Read Method)
66 // Handle all commands sent to EC by BIOS
69 // Arg0 = Object to Read
74 Method (ECRD, 1, Serialized, 0, IntObj, FieldUnitObj)
77 // Check for ECDT support, set ECAV to 1 if ECDT is supported by OS
78 // Only check once at beginning since ECAV might be clear later in certain conditions
84 ECTK = 0x00 // Clear flag for checking once only
87 Local0 = Acquire (ECMT, 1000) // Save Acquired Result
88 If (Local0 == 0x00) // Check for Mutex Acquisition
91 Local1 = DerefOf (Arg0) // Execute Read from EC
98 Return (0) // Return in case Arg0 doesn't exist
101 // ECWR (Embedded Controller Write Method)
103 // Handle all commands sent to EC by BIOS
106 // Arg0 = Value to Write
107 // Arg1 = Object to Write to
112 Method (ECWR, 2, Serialized,,,{IntObj, FieldUnitObj})
114 Local0 = Acquire (ECMT, 1000) // Save Acquired Result
115 If (Local0 == 0x00) // Check for Mutex Acquisition
118 Arg1 = Arg0 // Execute Write to EC
121 If (Arg0 == DerefOf (Arg1)) {
127 If (Local1 == 0x03) {
137 #if CONFIG(SYSTEM_TYPE_LAPTOP) || CONFIG(SYSTEM_TYPE_DETACHABLE)
138 #include "battery.asl"
140 #if !CONFIG(EC_STARLABS_MERLIN)
141 #include "events.asl"
146 Method (_REG, 2, NotSerialized)
148 If ((Arg0 == 0x03) && (Arg1 == 0x01))
153 // Initialise the Lid State
154 \LIDS = ECRD(RefOf(LSTE))
156 // Initialise the OS State
157 ECWR(0x01, RefOf(OSFG))
159 // Initialise the Power State
160 PWRS = (ECRD (RefOf(ECPS)) & 0x01)
162 // Inform the platform code