mb/google/brya: Create rull variant
[coreboot2.git] / src / ec / quanta / it8518 / acpi / ec.asl
blob6433523620d9bc0c28c2034a3602fc5a74840bf0
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /*
4  * The mainboard must define a PNOT method to handle power
5  * state notifications and Notify CPU device objects to
6  * re-evaluate their _PPC and _CST tables.
7  */
9 Device (EC0)
11         Name (_HID, EISAID ("PNP0C09"))
12         Name (_UID, 1)
13         Name (_GPE, EC_SCI_GPI + 16) // GPE for Runtime SCI
15         // EC RAM fields
16         OperationRegion(ERAM, EmbeddedControl, 0, 0xFF)
17         Field (ERAM, ByteAcc, NoLock, Preserve)
18         {
19                                 //   [Configuration Space 0]
20                     , 1,        //   Reserved bit[0]
21                 ENGA, 1,        //   Enable Global attention
22                 ENHY, 1,        //   Enable Hotkey function
23                 HFNE, 1,        //   Enable Sticky Fn Key
24                 DSEM, 1,        //   Disable embedded NumPad Emulation
25                 EN3R, 1,        //   Enable 3rd Host interface and TWR registers
26                     , 1,        //   Reserved bit[6]
27                 ENTM, 1,        //   Enable Thermal monitoring
29                 Offset(0x01),   // [Configuration Space 1]
30                 ENBK, 1,        //   Enable Panel backlight on/ off synchronized with LID state
31                     , 3,        //   Reserved bits[1:3]
32                 WPSW, 1,        //   Warning if the power switch is depressed
33                     , 2,        //   Reserved bits[5:6]
34                 NTKY, 1,        //   do not ignore any key while Fn key is held down
36                 Offset(0x02),   // [Configuration Space 2]
37                     , 5,        //   Reserved bits[0:4]
38                 SNLC, 1,        //   Smart NumLock Enable. 1:Enable 0:Disable
39                     , 1,        //   Reserved bit[6]
40                 TNKB, 1,        //   ThinkVantage button function bit
41                                 //         0: Scan code (Enter key)
42                                 //         1: SMI/SCI attention
44                 Offset(0x03),   // [Configuration Space 3]
45                 DSHP, 1,        //   Disable to synchronize headphone state with the speaker mute
46                 IGPK, 1,        //   Ignore phantom keys
47                     , 2,        //   Reserved bits[2:3]
48                 CBAT, 1,        //   Change discharge/charge preference to discharge primary battery first and charge secondary battery first if possible
49                 ADO0, 1,        //   Audio button behavior mode 0
50                 ADO1, 1,        //   Audio button behavior mode 1
51                     , 1,        //   Enable to use PMH fan functions to get the fan speed
53                 Offset(0x04),   // [Sound Mask 0]
54                     , 1,        //   reserved
55                 CLBA, 1,        //   critical low battery alarm
56                 LWBA, 1,        //   low battery alarm (YELLOW -> RED)
57                 SUBE, 1,        //   suspend beep
58                 PUBE, 1,        //   vm_suspend beep
59                 RSBE, 1,        //   resume beep
60                 DCBE, 1,        //   DC in/out beep
61                 PFBE, 1,        //   power off beep
63                 Offset(0x05),   // [Sound Mask 1]
64                 HSPA, 1,        //   power off alarm
65                 NHDD, 1,        //   no HDD alarm
66                 DEAD, 1,        //   dead
67                 B440, 1,        //   440 hz beep
68                 B315, 1,        //   315 hz beep
69                 T315, 1,        //   two 315 hz beep
70                 R315, 1,        //   three 315 hz beep
71                 BYAM, 1,        //   inhibit swap
73                 Offset(0x06),   // [Sound ID (Write only)]
74                 HSUN, 8,        //   Sound ID (Write Only)
76                 Offset(0x07),   // [Sound Repeat Interval (unit time 125ms)]
77                 HSRP, 8,        //   Sound Repeat Interval (Unit time : 125ms )
79                 Offset(0x08),   // [Sound Mask 2]
80                 Offset(0x09),   // [KBD ID]
81                 Offset(0x0A),   // [KMC command control]
82                                 // Offset 0xOB : reserved
84                 Offset(0x0C),   // [LED On/Off/ Blinking Control (Write only)]
85                 HLCL, 4,        //   0: power LED
86                                 //   1: battery status 0
87                                 //   2: battery status 1
88                                 //   3: additional Bay LED (Venice) / reserved (Toronto-4) / Slicer LED (Tokyo)
89                                 //   4-6: reserved
90                                 //   7: suspend LED
91                                 //   8: dock LED 1
92                                 //   9: dock LED 2
93                                 //   10-13: reserved
94                                 //   14: microphone mute
95                                 //   15: reserved
96                     , 1,        //   Reserved bit[4]
97                     , 1,        //   Blink gradually
98                 BLIK, 1,        //   Blinking
99                 TONF, 1,        //   Turn on/off
101                 Offset(0x0D),   // [Peripheral control 3]
102                 UONE, 1,        //   Bit0   - Enable to supply power through USB in S3, S4 and S5 state.
103                     , 1,        //   Reserved bit[1]
104                     , 1,        //   set USB_AO_SEL0 signal in S3, S4, and S5 state
105                     , 1,        //   set USB_AO_SEL1 signal in S3, S4, and S5 state
106                     , 4,        //   Reserved bits[4:7]
108                 Offset(0x0E),   // [Peripheral Status 4]
109                 HFNS, 2,        //   Bit[1, 0] : Fn Key Status
110                                 //      [0, 0] ... Unlock
111                                 //      [0, 1] ... Sticky
112                                 //      [1, 0] ... Lock
113                                 //      [1, 1] ... Reserved
114                 GSER, 1,        //   G-Sensor Diag Error. 1:Error / 0: No error
115                 PSCS, 1,        //   Inhibit charging
116                     , 1,        //   External power saving mode
117                 GSUD, 1,        //   G-Sensor under Diag. 1: Diag is running/0: Diag comp(not running)
118                 GSID, 2,        //   Bit[7,6] G-Sensor type ID
119                                 //      [0,0] ... None
120                                 //      [0,1] ... STMicro
121                                 //      [1,0] ... Memsic
122                                 //      [1,1] ... ADI
124                 Offset(0x0F),   // [Peripheral status 5 (read only)]
125                     , 4,        //   Reserved bits[0:3]
126                 HDSU, 1,        //   HDD was detached in suspend (this bit is cleared when the system enters into suspend)
127                 BYSU, 1,        //   Bay HDD was detached in suspend (this bit is cleared when the system enters into suspend)
128                     , 1,        //   NumLock state of the embedded keyboard
129                 TMOD, 1,        //   Tablet mode switch
131                 Offset(0x10),   // [Attention Mask (00-127)]
132                 HAM0, 8,        // 10 : Attention Mask (00-07)
133                 HAM1, 8,        // 11 : Attention Mask (08-0F)
134                 HAM2, 8,        // 12 : Attention Mask (10-17)
135                 HAM3, 8,        // 13 : Attention Mask (18-1F)
136                 HAM4, 8,        // 14 : Attention Mask (20-27)
137                 HAM5, 8,        // 15 : Attention Mask (28-2F)
138                 HAM6, 8,        // 16 : Attention Mask (30-37)
139                 HAM7, 8,        // 17 : Attention Mask (38-3F)
140                 HAM8, 8,        // 18 : Attention Mask (40-47)
141                 HAM9, 8,        // 19 : Attention Mask (48-4F)
142                 HAMA, 8,        // 1A : Attention Mask (50-57)
143                 HAMB, 8,        // 1B : Attention Mask (58-5F)
144                 HAMC, 8,        // 1C : Attention Mask (60-67)
145                 HAMD, 8,        // 1D : Attention Mask (68-6F)
146                 HAME, 8,        // 1E : Attention Mask (70-77)
147                 HAMF, 8,        // 1F : Attention Mask (78-7F)
149                                 // Offset 0x20 : reserved
150                 Offset(0x21),   // [Inhibit Charge timer byte High (00h)] (timer is kicked when high byte is written)
152                 Offset(0x23),   // [Misc. control]
153                                 //   01h Reset charge inhibit
154                                 //   02h Inhibit to charge
155                                 //   03h Reset external power saving mode
156                                 //   04h Set to external power saving mode
157                                 //   09h Emulate pressing an eject button of optical device in the bay
158                                 //   0Ah Reset thermal state to control the fan
159                                 //   10h Start gravity sensor diagnostic program
161                                 // Offset 24-26 : reserved
162                 Offset(0x27),   // [Passward Scan Code]
163                                 // Offset 28-29 : reserved
165                 Offset(0x2A),   // [Attention Request]
166                 HATR, 8,        // 2A : Attention request
168                 Offset(0x2B),   // [Trip point of battery capacity]
169                 HT0H, 8,        // 2B : MSB of Trip Point Capacity for Battery 0
170                 HT0L, 8,        // 2C : LSB of Trip Point Capacity for Battery 0
171                 HT1H, 8,        // 2D : MSB of Trip Point Capacity for Battery 1
172                 HT1L, 8,        // 2E : LSB of Trip Point Capacity for Battery 1
174                 Offset(0x2F),   // [Fan Speed Control]
175                 HFSP, 8,        //  bit 2-0: speed (0: stop, 7:highest speed)
176                                 //  bit 5-3: reserved (should be 0)
177                                 //  bit 6: max. speed
178                                 //  bit 7: Automatic mode (fan speed controlled by thermal level)
180                 Offset(0x30),   // [Audio mute control]
181                     , 7,        //  Reserved bits[0:6]
182                 SMUT, 1,        //  Mute
184                 Offset(0x31),   // [Peripheral Control 2]
185                 FANS, 2,        //   bit 0,1 Fan selector
186                                 //         00: Fan 1, 01: Fan 2
187                 HUWB, 1,        //   UWB on
188                 ENS4, 1,        //   Reserved bit[3]
189                 DSEX, 1,        //   Disable Express Card
190                 AYID, 1,        //   Always-on Card identified
191                     , 1,        //   Select USB to Always On card
192                     , 1,        //   Assert the express card slot power control standby signal
194                 Offset(0x32),   // [EC Event Mask 0]
195                 HWPM, 1,        //   PME : Not used. PME# is connected to GPE directly.
196                 HWLB, 1,        //   Critical Low Bat
197                 HWLO, 1,        //   Lid Open
198                     , 1,        //   Eject button
199                 HWFN, 1,        //   FN key
200                     , 1,        //   Portfino wake up
201                 HWRI, 1,        //   Ring Indicator (UART)
202                 HWBU, 1,        //   Bay Unlock
204                 Offset(0x33),   // [EC Event Mask 1]
206                 Offset(0x34),   // [Peripheral status 2 (read only)]
207                     , 1,        //   Reserved bit[0]
208                     , 1,        //   Beep is being sounded now
209                     , 1,        //   SMBus is busy
210                     , 1,        //   Reserved bit[3]
211                     , 1,        //   Fan exists
212                     , 1,        //   Gravity sensors exist
213                     , 1,        //   Reserved bit[6]
214                 HPLO, 1,        //   Power consumption warning
216                 Offset(0x35),   // [Peripheral status 3 (Read only)]
217                     , 1,        //   Input devices (keyboard and mouse) are locked by password
218                     , 1,        //   Input devices are frozen (input from devices are inhibited)
219                     , 1,        //   Fan power on Reset is done
220                     , 1,        //   Attention is disabled temporarily
221                     , 1,        //   Fan error
222                     , 2,        //   Reserved bit[5:6]
223                     , 1,        //   Thermal sensor error
225                 Offset(0x36),   // [Copy register of EC Event Status (0x32)]
226                 Offset(0x37),   // [Copy register of EC Event Status (0x33)]
228                 Offset(0x38),   // [Battery 0 status (read only)]
229                 HB0S, 7,        //   bit 3-0 level
230                                 //     F: Unknown
231                                 //     2-n: battery level
232                                 //     1: low level
233                                 //     0: (critical low battery, suspend/ hibernate)
234                                 //   bit 4 error
235                                 //   bit 5 charge
236                                 //   bit 6 discharge
237                 MBTS, 1,        //   bit 7 battery attached
239                 Offset(0x39),   // [Battery 1 status (read only)]
240                                 //    bit definition is the same as offset(0x38)
242                 Offset(0x3A),   // [Peripheral control 0]
243                 MUTE, 1,        //   Mute
244                 I2CS, 1,        //   I2C select ( 0:Dock EEPROM etc, 1:Thermal sensor etc )(Tokyo-2)
245                 PWRF, 1,        //   Power off
246                 WANO, 1,        //   H/W Override bit
247                                 //      (enable to control wireless devices even if the global WAN disable switch is ON)
248                 DCBD, 1,        //   Bluetooth On
249                 DCWL, 1,        //   Wireless Lan On
250                 DCWW, 1,        //   Wireless Wan On
251                     , 1,        //   2nd Battery Inhibit (Tokyo)
253                 Offset(0x3B),   // [Peripheral control 1]
254                 SPKM, 1,        //   Speaker Mute
255                 KBLH, 1,        //   Keyboard Light
256                     , 1,        //   Reserved bit[2]
257                 BTDH, 1,        //   Bluetooth detach
258                 USBN, 1,        //   USB On
259                     , 1,        //   Inhibit communication with battery 0
260                     , 1,        //   Inhibit communication with battery 1
261                 S3FG, 1,        //   Reserved bit[7]
263                 Offset(0x3C),   // [Resume reason (Read only)]
264                 Offset(0x3D),   // [Password Control byte]
265                 Offset(0x3E),   // [Password data (8 byte)~ offset:45h]
267                 Offset(0x46),   // [sense status 0]
268                 FNKY, 1,        //   Fn key
269                     , 1,        //   Reserved bit[1]
270                 HPLD, 1,        //   LID open
271                 PROF, 1,        //   Power off
272                 ACPW, 1,        //   External power (AC status)
273                     , 2,        //   Reserved bits[5:6]
274                 CALR, 1,        //   LP mode (power consumption alert)
276                 Offset(0x47),   // [sense status 1]
277                 HPBU, 1,        //   Bay Unlock
278                 DKEV, 1,        //   Dock event
279                 BYNO, 1,        //   Bay is not Attached
280                 HDIB, 1,        //   HDD in the bay
281                     , 4,        //   Reserved bits[4:7]
283                 Offset(0x48),   // [sense status 2]
284                 HPHI, 1,        //   Head Phone In
285                 GSTS, 1,        //   Global Wan Enable Switch
286                     , 2,        //   Reserved bits[2:3]
287                 EXGC, 1,        //   External Graphic Chip
288                 DOKI, 1,        //   Dock attached
289                 HDDT, 1,        //   HDD detect
290                     , 1,        //   Reserved bit[7]
292                 Offset(0x49),   // [sense status 3]
293                                 // Offset 0x4A : reserved
295                 Offset(0x4C),   // [MSB of Event Timer]
296                 ETHB, 8,        //   bit[14:0]=timer counter, bit[15], 0:ms, 1:sec
298                 Offset(0x4D),   // [LSB of Event Timer]
299                 ETLB, 8,        //
301                 Offset(0x4E),   // [EC Event Status 0]
302                 Offset(0x4F),   // [EC Event Status 1]
304                 Offset(0x50),   // [SMB_PRTCL (protocol register)]
305                 SMPR, 8,        //      00: Controller Not In use
306                                 //      01: reserved
307                                 //      02: Write Quick command
308                                 //      03: Read Quick command
309                                 //      04: Send Quick command
310                                 //      05: Receive Byte
311                                 //      06: Write Byte
312                                 //      07: Read Byte
313                                 //      08: Write Word
314                                 //      09: Read Word
315                                 //      0A: Write block
317                 Offset(0x51),   // [SMB_STS (status register)]
318                 SMST, 8,        //    bits[0:4] Status
319                                 //    bit[5] Reserved
320                                 //    bit[6] Alarm Received
321                                 //    bit[7] Done
323                 Offset(0x52),   // [SMB_ADDR (address register)]
324                 SMAD, 8,        //
326                 Offset(0x53),   // [SMB_CMD (Command register)]
327                 SMCM, 8,        //
329                 Offset(0x54),   // [SMB_DATA (Data Register (32 bytes))~ offset:73h]
330                 SMD0, 100,      //
332                 Offset(0x74),   // [SMB_BCNT (Block count register)]
333                 BCNT, 8,        //
335                 Offset(0x75),   // [SMB_ALRM_ADDR (Alarm address register)]
336                 SMAA, 8,        //
338                 Offset(0x76),   // [SMB_ALRM_DATA (Alarm data register (2 bytes))]
339                 BATD, 16,       //
341                 Offset(0x78),   // [Temperature of thermal sensor 0 (centigrade)]
342                 TMP0, 8,        // 78 : Temperature of thermal sensor 0
343                 TMP1, 8,        // 79 : Temperature of thermal sensor 1
344                 TMP2, 8,        // 7A : Temperature of thermal sensor 2
345                 TMP3, 8,        // 7B : Temperature of thermal sensor 3
346                 TMP4, 8,        // 7C : Temperature of thermal sensor 4
347                 TMP5, 8,        // 7D : Temperature of thermal sensor 5
348                 TMP6, 8,        // 7E : Temperature of thermal sensor 6
349                 TMP7, 8,        // 7F : Temperature of thermal sensor 7
351                                 // Offset 79-7F : reserved
352                 Offset(0x80),   // [Attention control byte]
354                 Offset(0x81),   // [Battery information ID for 0xA0-0xAF]
355                 HIID, 8,        //   (this byte is depend on the interface, 62&66 and 1600&1604)
357                 Offset(0x82),   // [Fn Dual function - make time out time (100ms unit)]
359                 Offset(0x83),   // [Fn Dual function ID]
360                 HFNI, 8,        //      0: none
361                                 //      1-3: Reserved
362                                 //      4: ACPI Power
363                                 //      5: ACPI Sleep
364                                 //      6: ACPI Wake
365                                 //  7: Left Ctrl key
367                 Offset(0x84),   // [Fan Speed]
368                     , 16,       //
369                                 //      (I/F Offset 3Bh bit5 => 0:Main Fan , 1:Second Fan)
371                 Offset(0x86),   // [password 0 - 7 status]
372                 Offset(0x87),   // [password 8 - 15 status]
373                 Offset(0x88),   // [Thermal Status of Level 0 (low)]
374                 Offset(0x89),   // [Thermal Status of Level 1 (middle)]
375                 Offset(0x8A),   // [Thermal Status of Level 2 (middle high)]
376                 Offset(0x8B),   // [Thermal Status of Level 3 (high)]
377                                 // Offset 0x8C : reserved
379                 Offset(0x8D),   // [Interval of polling Always-on cards in half minute]
380                 HDAA, 3,        //   Warning Delay Period
381                 HDAB, 3,        //   Stolen Delay Period
382                 HDAC, 2,        //   Sensitivity
384                 Offset(0x8E),   // [Key-number assigned to the ThinkVantage button]
385                 Offset(0x8F),   // [EC Internal Use for Fan Duty Table Creation]
386                 Offset(0x90),   // [EC internal use]
387                 Offset(0xA0),   // [Battery Information Area]~ offset:0AFh
388                 Offset(0xB0),   // [Battery 0 charge start capacity]
389                 Offset(0xB1),   // [Battery 0 charge stop capacity]
390                 Offset(0xB2),   // [Battery 1 charge start capacity]
391                 Offset(0xB3),   // [Battery 1 charge stop capacity]
393                 Offset(0xB4),   // [Battery 0 control]
394                                 //    01h Stop refreshing the battery
395                                 //    02h Refresh the battery
396                                 //    07h Set long life span mode
397                                 //    08h Set long run time mode
399                 Offset(0xB5),   // [Battery 1 control]
400                                 // Offset B6-C7 : reserved
402                 Offset(0xC8),   // [Adaptive Thermal Management (ATM)]
403                 ATMX, 8,        //  bit 7-4 - Thermal Table & bit 3-0 - Fan Speed Table
405                 Offset(0xC9),   // [Wattage of AC/DC]
406                 AC65, 8,        //
408                 Offset(0xCA),   // Reserved - but should be 0
410                 Offset(0xCB),   // [ATM configuration]
411                 BFUD, 1,        //   bit 0 - Battery FUD Flag
412                     , 7,        //   bit 1~7 - Reserved
414                 Offset(0xCC),   //
415                 PWMH, 8,        // CC : AC Power Consumption (MSB)
416                 PWML, 8,        // CD : AC Power Consumption (LSB) - unit: 100mW
418                 Offset(0xCE),   // [Configuration Space 4]
419                     , 2,        //   Windows key mode
420                     , 2,        //   Application key mode
421                     , 1,        //   Swap the Fn key and the left Ctrl key
422                     , 3,        //   Reserved bits[5:7]
424                 Offset(0xCF),   // [Configuration Space 5]
425                 HSID, 8,        //   Hand shaking byte of system information ID
427                 Offset(0xD0),   // [EC Type]
428                                 // D1-DF : reserved
430                 Offset(0xE0),   // @@ Mapping to old EC RAM for battery information
431                 ECRC, 16,       // BAT1 Sys command [0] RC
432                 ECAC, 16,       // BAT1 Sys command [0] AV_I
433                 ECVO, 16,       // BAT1 Sys command [0] Voltage
435                                 // E1-E7 : reserved
436                 Offset(0xE8),   // [Version 0]
437                 Offset(0xE9),   // [Version 1]
438                 Offset(0xEA),   // [Machine ID]
439                 Offset(0xEB),   // [Function Specification Minor Version]
440                 Offset(0xEC),   // [EC capability 0]
441                 Offset(0xED),   // [EC capability 1]
443                 Offset(0xEE),   // [Highest battery level]
444                 MBTH, 4,        //   bit 3-0: battery 0 highest level
445                 SBTH, 4,        //   bit 7-4: battery 1 highest level
446                                 //   note: if highest level is 0 or 0xF, it means not defined
447                                 //         (in this case, use default highest level, it is 6)
449                 Offset(0xEF),   // [EC Function Specification Major Version]
450                 Offset(0xF0),   // [Build ID]~ offset:0F7h
452                 Offset(0xF8),   // [Build Date (F8: MSB, F9:LSB)]
453                     , 4,        //   bit 3-0: day(1-31)
454                     , 4,        //   bit 7-4: month(1-12)
455                     , 8,        //   bit 15-8: year(2000 base)
457                 Offset(0xFA),   // [Build Time (in 2seconds)]
458                                 //   ex: when index FAh=5Ah and index FBh=ADh, Build Time is 5AADh .. 12:53:46
460                 Offset(0xFC),   // [reserved]~ offset:0FFh
461         } // End of ERAM
463         //
464         // Battery Information ID : 00/10
465         //
466         Field (ERAM, ByteAcc, NoLock, Preserve)
467         {
468                 Offset(0xA0),
469                 SBRC, 16,    // Remaining Capacity
470                 SBFC, 16,    // Fully Charged Capacity
471                 SBAE, 16,    // Average Time To Empty
472                 SBRS, 16,    // Relative State Of Charge
473                 SBAC, 16,    // Average Current
474                 SBVO, 16,    // Voltage
475                 SBAF, 16,    // Average Time To Full
476                 SBBS, 16,    // Battery State
477         }
479         //
480         // Battery Information ID : 01/11
481         //
482         Field (ERAM, ByteAcc, NoLock, Preserve)
483         {
484                 Offset(0xA0),
485                              // Battery Mode(w)
486                     , 15,
487                 SBCM, 1,     //  bit 15 - CAPACITY_MODE
488                              //        0: Report in mA/mAh ; 1: Enabled
489                 SBMD, 16,    // Manufacture Data
490                 SBCC, 16,    // Cycle Count
491         }
493         //
494         // Battery Information ID : 02/12
495         //
496         Field (ERAM, ByteAcc, NoLock, Preserve)
497         {
498                 Offset(0xA0),
499                 SBDC, 16,    // Design Capacity
500                 SBDV, 16,    // Design Voltage
501                 SBOM, 16,    // Optional Mfg Function 1
502                 SBSI, 16,    // Specification Info
503                 SBDT, 16,    // Manufacture Date
504                 SBSN, 16,    // Serial Number
505         }
507         //
508         // Battery Information ID : 04/14
509         //
510         Field (ERAM, ByteAcc, NoLock, Preserve)
511         {
512                 Offset(0xA0),
513                 SBCH, 32,    // Device Checmistory (string)
514         }
516         //
517         // Battery Information ID : 05/15
518         //
519         Field (ERAM, ByteAcc, NoLock, Preserve)
520         {
521                 Offset(0xA0),
522                 SBMN, 128,   // Manufacture Name (s)
523         }
525         //
526         // Battery Information ID : 06/16
527         //
528         Field (ERAM, ByteAcc, NoLock, Preserve)
529         {
530                 Offset(0xA0),
531                 SBDN, 128,   // Device Name (s)
532         }
534         Method (_CRS, 0, NotSerialized)
535         {
536                 Name (ECMD, ResourceTemplate()
537                 {
538                         IO (Decode16, 0x62, 0x62, 0, 1)
539                         IO (Decode16, 0x66, 0x66, 0, 1)
540                 })
541                 Return (ECMD)
542         }
544         Method (_REG, 2, NotSerialized)
545         {
546                 // Initialize AC power state
547                 \PWRS = ACPW
549                 // Initialize LID switch state
550                 \LIDS = ~HPLD
552                 // Enable OS control of fan speed
553                 // TODO FCOS = 1
555                 // Force a read of CPU temperature
556                 // TODO Which temperature corresponds to the CPU?
557                 Local0 = TMP0
558                 /* So that we don't get a warning that Local0 is unused.  */
559                 Local0++
560         }
562 /* Attention Codes
563  *  00h     No Event
564  *  01h-0Fh Reserved for ACPI Events
565  *  10h-1Fh Hotkey Events
566  *  22h     Critical Low Battery
567  *  23h     Battery Empty
568  *  24h     Trip Point Capacity Event for Battery 0
569  *  26h     AC Adapter Attached
570  *  27h     AC Adapter Detached
571  *  28h     Power Off Switch Pressed
572  *  29h     Power Off Switch Released
573  *  2Ah     LID Open
574  *  2Bh     LID Close
575  *  3Eh     PME Event
576  *  40h     Thermal Event
577  *  41h     Global Wireless Enable Switch
578  *  43h     Mute State Change
579  *  4Ah     Battery 0 Attach/Detach
580  *  4Bh     Battery 0 State Change
581  *  66h     Mute Button
582  */
584         // Battery at critical low state
585         Method (_Q22)
586         {
587                 If (MBTS)
588                 {
589                         Notify (BATX, 0x80)
590                 }
591         }
593         // AC Power Connected
594         Method (_Q26, 0, NotSerialized)
595         {
596                 \PWRS = 1
597                 Notify (AC, 0x80)
598                 Notify (BATX, 0x80)
599                 \PNOT ()
600         }
602         // AC Power Removed
603         Method (_Q27, 0, NotSerialized)
604         {
605                 \PWRS = 0
606                 Notify (AC, 0x80)
607                 \PNOT ()
608         }
610         // LID Open
611         Method (_Q2A)
612         {
613                 \LIDS = 1
614                 Notify (\_SB.LID0, 0x80)
615         }
617         // LID Close (Suspend Trigger)
618         Method (_Q2B)
619         {
620                 \LIDS = 0
621                 Notify (\_SB.LID0, 0x80)
622         }
624         // Battery Attach/Detach Event
625         Method (_Q4A)
626         {
627                 Notify (BATX, 0x80)
628                 Notify (BATX, 0x81)
629                 \PNOT ()
630         }
632         // Battery State Change Event
633         Method (_Q4B)
634         {
635                 Notify (BATX, 0x80)
636         }
638         // Global Wireless Disable/Enable Event
639         Method (_Q41, 0, NotSerialized)
640         {
641                 IF (DCWL) //if Wlan exist
642                 {
643                         //TODO LANE = WLAT
644                 }
645         }
647         #include "ac.asl"
648         #include "battery.asl"
649         // TODO #include "fan.asl"