1 /* SPDX-License-Identifier: GPL-2.0-only */
5 Name (_HID, EISAID ("PNP0C09"))
8 Name (_GPE, THINKPAD_EC_GPE)
11 /* EmbeddedControl should work as well, but memory mapped is faster. */
12 OperationRegion (ERAM, SystemMemory, (CONFIG_EC_BASE_ADDRESS + 0x100), 0x100)
13 Field (ERAM, ByteAcc, Lock, Preserve)
17 HKFA, 1, // FN lock (Hotkey / FN row toggle)
24 HLCL, 8, // LED control
35 /* Battery info page 0 */
36 Field (ERAM, ByteAcc, NoLock, Preserve)
39 SBRC, 16, /* Remaining capacity */
40 SBFC, 16, /* Full-charge capacity */
43 SBAC, 16, /* Present rate */
44 SBVO, 16, /* Present voltage */
49 /* Battery info page 1 */
50 Field (ERAM, ByteAcc, NoLock, Preserve)
54 SBCM, 1, /* Power unit (0 == mA/mAh, 1 == mW/mWh) */
59 /* Battery info page 2 */
60 Field (ERAM, ByteAcc, NoLock, Preserve)
63 SBDC, 16, /* Design Capacity */
64 SBDV, 16, /* Design Voltage */
68 SBSN, 16, /* Serial number */
71 /* Battery info page 4 */
72 Field (ERAM, ByteAcc, NoLock, Preserve)
75 SBCH, 32, /* Type (LiON) */
78 /* Battery info page 5 */
79 Field (ERAM, ByteAcc, NoLock, Preserve)
82 SBMN, 128, /* Manufacturer */
85 /* Battery info page 6 */
86 Field (ERAM, ByteAcc, NoLock, Preserve)
89 SBDN, 128, /* Model */
92 Method (_CRS, 0, Serialized)
94 Name (ECMD, ResourceTemplate()
96 IO (Decode16, 0x62, 0x62, 0, 1)
97 IO (Decode16, 0x66, 0x66, 0, 1)
98 IO (Decode16, 0x700, 0x700, 0, 8)
99 Memory32Fixed(ReadOnly, CONFIG_EC_BASE_ADDRESS, 0x1000, FF00)
104 /* Increase brightness hotkey */
105 Method (_Q14, 0, NotSerialized) {
110 /* Decrease brightness hotkey */
111 Method (_Q15, 0, NotSerialized) {
116 /* Video output switch hotkey */
117 Method (_Q16, 0, NotSerialized) {
118 Notify (\_SB.PCI0.GFX0, 0x82)
122 Method (_Q19, 0, NotSerialized)
127 /* Switched to AC power */
128 Method (_Q26, 0, NotSerialized)
137 /* Switched to battery power */
138 Method (_Q27, 0, NotSerialized)
148 Method (_Q2A, 0, NotSerialized)
156 Method (_Q2B, 0, NotSerialized)
163 /* Tablet swivel down */
164 Method (_Q35, 0, NotSerialized)
170 /* Tablet swivel up */
171 Method (_Q36, 0, NotSerialized)
177 /* Tablet rotate lock button */
178 Method (_Q37, 0, NotSerialized)
183 /* Numlock pressed */
184 Method (_Q3F, 0, NotSerialized)
189 /* RFKill status changed */
190 Method (_Q41, 0, NotSerialized) {
195 Method (_Q43, 0, NotSerialized) {
199 /* Settings hotkey */
200 Method (_Q5A, 0, NotSerialized)
206 Method (_Q5B, 0, NotSerialized)
212 Method (_Q5C, 0, NotSerialized)
218 Method (_Q5D, 0, NotSerialized)
224 Method (_Q64, 0, NotSerialized) {
228 /* Mic mute hotkey */
229 Method (_Q6A, 0, NotSerialized)
235 Method (_Q70, 0, NotSerialized) { }
237 /* FN+Esc pressed / FN row mode switch */
238 Method (_Q74, 0, NotSerialized) {
243 /* Implements enough of the Lenovo hotkey device for
244 * thinkpad-acpi to work, no real support for hotkey masking */
247 Name (_HID, EisaId ("LEN0068"))
251 Name (DHKN, 0xFC018070) // Hotkey mask
254 Method (_STA, 0, NotSerialized)
259 Method (MHKV, 0, NotSerialized)
261 Return (0x0100) // Interface version 1.0
264 Method (MHKA, 0, NotSerialized) // Hotkey all mask
269 Method (MHKM, 2, NotSerialized) // Set hotkey mask
271 Acquire (XDHK, 0xFFFF)
283 Method (MHKC, 1, NotSerialized) // Hotkey disable?
285 Acquire (XDHK, 0xFFFF)
292 Method (MHKP, 0, NotSerialized) // Hotkey poll
294 Acquire (XDHK, 0xFFFF)
308 Method (MHKQ, 1, NotSerialized) // Send hotkey event
310 Acquire (XDHK, 0xFFFF)
316 Notify (HKEY, 0x80) // Status Change
320 /* LED support for thinkpad-acpi */
321 Method (LED, 2, NotSerialized)
328 Name (_HID, "ACPI0003")
329 Name (_PCL, Package (1) { \_SB })
331 Method (_PSR, 0, NotSerialized)
335 Method (_STA, 0, NotSerialized)
341 /* Battery is H8 compatible, but requires an explicit delay */
342 #define BATTERY_PAGE_DELAY_MS 20
343 #include <ec/lenovo/h8/acpi/battery.asl>
345 /* LID is H8 compatible */
346 #include <ec/lenovo/h8/acpi/lid.asl>