1 /* SPDX-License-Identifier: GPL-2.0-only */
5 Name (_HID, EISAID("PNP0C09"))
8 Name (_GPE, 23) // GPI07 / GPE23 -> Runtime SCI
10 OperationRegion(ERAM, EmbeddedControl, 0x00, 0x37)
11 Field (ERAM, ByteAcc, NoLock, Preserve)
13 MODE, 1, // Thermal Policy (Quiet/Perform)
14 FAN, 1, // Fan Power (On/Off)
15 LIDS, 1, // LID Status (0=Open/1=Close)
16 LSW0, 1, // LCD Power Switch
18 BTYP, 1, // Battery Type (0=LiIon/1=NiMh)
19 MWKE, 1, // Enable Wakeup from RI
20 ADP, 1, // AC Adapter (0=Offline/1=Online)
21 BAT, 1, // Battery (0=Not Present/1=Present)
22 SLPT, 3, // Set Sleep Type on SLP enter (1=S1...4=S4)
23 CHRG, 1, // 0=Battery not charging/1=Battery charging
24 RI_W, 1, // Wake-up event source is RI
25 KB_W, 1, // Wake-up event source is keyboard
26 BATW, 1, // Wake-up event source is Battery Low
27 PMEW, 1, // Wake-up event source is PME
29 // Battery 0 Registers
30 // Battery Life = BRC0/BPR0
31 // Battery percentage = BRC0/BFC0 * 100
32 BDC0, 16, // Designed Capacity
33 BFC0, 16, // Last Full Charge Capacity
34 BDV0, 16, // Design Voltage
35 BPR0, 16, // Battery Present Rate
36 BRC0, 16, // Battery Remaining Capacity
37 BPV0, 16, // Battery Present Voltage
40 CTMP, 8, // CPU Temperature
42 CTRO, 8, // EC throttling on trip point
43 CRTT, 8, // Critical Shut-down Temperature
45 BKLL, 8, // Backlight Level
47 // Battery 2 Registers
50 BTY2, 1, // Battery Type (0=LiIon/1=NiMh)
52 BAT2, 1, // Battery (0=Not Present/1=Present)
54 CRG2, 1, // 0=Battery not charging/1=Battery charging
56 BDC2, 16, // Designed Capacity
57 BFC2, 16, // Last Full Charge Capacity
58 BDV2, 16, // Design Voltage
59 BPR2, 16, // Battery Present Rate
60 BRC2, 16, // Battery Remaining Capacity
61 BPV2, 16, // Battery Present Voltage
62 BTP2, 16, // Trip Point
64 PBMO, 2, // PBMO power control method
65 ECO, 1, // ECO on/off status
66 SUN, 1, // Sunlight Readable
67 RF, 1, // RF Enable/Disable status
68 DOCK, 1, // Dock In/Out status
69 CBAT, 1, // Car Battery status
70 APPS, 1, // OSD utility status
75 Method (_CRS, 0, Serialized)
77 Name (ECMD, ResourceTemplate()
79 IO (Decode16, 0x62, 0x62, 1, 1)
80 IO (Decode16, 0x66, 0x66, 1, 1)
86 // EC Query methods, called upon SCI interrupts.
89 Notify (\_SB.CP00, 0x80)
97 Notify (\_SB.AC, 0x80)
98 Notify (\_SB.BAT0, 0x80)
104 Notify(\_SB.BAT0, 0x80) // Execute BAT0 _BST
105 Notify(\_SB.BAT1, 0x80) // Execute BAT1 _BST
111 Notify(\_SB.BAT0, 0x00)
112 Notify(\_SB.AC, 0x80)
114 Notify(\_SB.AC, 0x80)
115 Notify(\_SB.BAT0, 0x01)
119 Notify(\_SB.BAT0, 0x80) // Execute BAT0 _BST
120 Notify(\_SB.BAT1, 0x80) // Execute BAT1 _BST
127 Notify(\_SB.BAT0, 0x80) // Execute BAT0 _BST
128 Notify(\_SB.BAT1, 0x80) // Execute BAT1 _BST
150 Notify(\_TZ.THRM, 0x80)
155 Notify(\_SB.ECO, 0x81)
160 Notify(\_SB.ECO, 0x82)
165 Notify(\_SB.ECO, 0x83)
170 Notify(\_SB.ECO, 0x84)
177 Notify (\_SB.PCI0.GFX0, 0x82)
181 Notify (\_SB.ECO, 0x85)
188 Notify(\_SB.ECO, 0x86)
195 Notify(\_SB.ECO, 0x87)
200 Notify(\_SB.ECO, 0x88)
205 Notify(\_SB.ECO, 0x89)
210 Notify(\_SB.ECO, 0x8a)
217 Notify(\_SB.ECO, 0x8b)
223 Notify(\_SB.ECO, 0x8c)
245 Notify(\_SB.ECO, 0x93)
251 Notify(\_SB.ECO, 0x93)
257 Notify(\_SB.ECO, 0x92)
263 Notify(\_SB.ECO, 0x92)
266 /* Enable RF device */
272 /* Disable RF device */
278 /* ACBS LAN Power On */
286 /* ACBS LAN Power Off */
304 TRAP(0xd2) // Check AC Status
306 Notify(\_SB.ECO, 0x90)
311 TRAP(0xd2) // Check AC Status
313 Notify(\_SB.ECO, 0x90)
319 Notify(\_SB.ECO, 0x94)
324 Notify(\_SB.ECO, 0x95)
335 Notify(\_SB.ECO, 0x95)
341 Notify(\_SB.ECO, 0x94)
346 Notify(\_SB.ECO, 0x96)
351 Notify(\_SB.ECO, 0x97)
354 // TODO Scope _SB devices for AC power, LID, Power button
359 /* This device is used by the GETAC P470 Windows drivers. */
363 Name(_HID, "MTC0303") // MTC0303 BIOS Service Provider
364 Method (GDPD, 0, Serialized)
366 // Set flag byte to zero
392 Method (GDPC, 0, Serialized)
411 /* Set Brightness Level */
412 Method(SBLL, 1, Serialized)
415 TRAP(0xd5) // See mainboard's smihandler.c
419 /* Get Brightness Level */
420 Method(GBLL, 0, Serialized)
422 TRAP(0xd6) // See mainboard's smihandler.c
426 /* Get Brightness Level Medium? */
427 Method(GBLM, 0, Serialized)
430 // XXX don't we have to set the brightness?
435 Method(SUTE, 1, Serialized)
446 Method(GECO, 0, Serialized)
453 Method(GBSL, 0, Serialized)
459 /* ??? Get LED/Device Enable Status */
460 Method(GRFD, 0, Serialized)
462 /* Let coreboot update the flags */
478 If (GP15 & 0x01) { // GDIS
481 If (GP12 & 0x01) { // WIFI Led (WLED)
484 If (BTEN & 0x01) { // BlueTooth Enable
487 If (GP10 & 0x01) { // GPS Enable
495 Method(SRFD, 1, Serialized)
526 Method(GDKD, 0, Serialized)
533 Method(SDKD, 0, Serialized)
539 /* Set IGD (Graphics) */
540 Method(SIGD, 1, Serialized)
550 /* SMI-C? Set Mic? */
551 Method (SMIC, 1, Serialized)
562 Method(GTSD, 0, Serialized)
564 Return (GP19) // TSDT
567 /* Not even decent function names anymore? */
568 Method(S024, 1, Serialized)
579 Method(GCVD, 0, Serialized)
585 /* ??? Something with PATA */
586 Method(S025, 1, Serialized)
597 Notify(^^PCI0.PATA, 0)
598 Notify(^^PCI0.PATA.PRID, 0)
604 Notify(^^PCI0.PATA, 0)
605 Notify(^^PCI0.PATA.PRID, 0)
606 Notify(^^PCI0.PATA.PRID.DSK1, 1)
607 Notify(^^PCI0.PATA.PRID.DSK0, 1)
613 Method(G021, 0, Serialized)
621 Notify(^^PCI0.PATA, 0)
622 Notify(^^PCI0.PATA.PRID.DSK1, 1)
623 Notify(^^PCI0.PATA.PRID.DSK0, 1)
627 Notify(^^PCI0.PATA, 0)
628 Notify(^^PCI0.PATA.PRID.DSK1, 1)
629 Notify(^^PCI0.PATA.PRID.DSK0, 1)
639 Method(GRFS, 0, Serialized)
646 Method(S00B, 1, Serialized)