blob: 720f92f974793feaf8a5b999e70462e33685d085 [file] [log] [blame]
Angel Pons7544e2f2020-04-03 01:23:10 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Patrick Georgi021b7032012-11-06 11:05:38 +01002
3Device(EC0)
4{
5 Name (_HID, EISAID("PNP0C09"))
6 Name (_UID, 1)
7
8 Name (_GPE, 23) // GPI07 / GPE23 -> Runtime SCI
9 Name (ECON, 0)
10 Name (QEVT, 0)
11
12 OperationRegion(ERAM, EmbeddedControl, 0x00, 0xff)
13 Field (ERAM, ByteAcc, NoLock, Preserve)
14 {
15 Offset(0xb1),
16 CPWR, 1,
17 ACCH, 1, // AC connected (charger present)
18 B1PR, 1, // battery 1 present
19 B2PR, 1, // battery 2 present
20 B1CH, 1, // battery 1 charged
21 B2CH, 1, // battery 2 charged
22 Offset(0xb2),
23 B1CG, 1, // battery 1 charging
24 B2CG, 1, // battery 2 charging
25 B1LO, 1, // battery 1 low
26 B2LO, 1, // battery 2 low
27 Offset(0xb3),
28 B1DW, 16, // battery 1 design capacity
29 B1FW, 16, // battery 1 last full charge capacity
30 B1DV, 16, // battery 1 design voltage
31 B1PW, 16, // battery 1 present capacity
32 Offset(0xbd),
33 B1PV, 16, // battery 1 present voltage
34 Offset(0xc1),
35 B2DW, 16, // battery 2 design capacity
36 B2FW, 16, // battery 2 last full charge capacity
37 B2DV, 16, // battery 2 design voltage
38 B2PW, 16, // battery 2 present capacity
39 Offset(0xcb),
40 B2PV, 16, // battery 2 present voltage
41 Offset(0xcf),
42 FDDI, 1, // floppy on lpt indicator?
43 LIDC, 1, // LID switch
44 Offset(0xd0),
45 TCPU, 8, // T_CPU in deg Celcius
46 Offset(0xd6),
47 /* exact purpose of these three is guessed,
48 but it's something about cooling */
49 ALRL, 1, // active cooling low limit
50 ALRH, 1, // active cooling high limit
51 ALRC, 1, // active cooling clear
52 Offset(0xe8),
53 B1RW, 16, // battery 1 remaining capacity
54 B2RW, 16, // battery 2 remaining capacity
55 }
56
57 Method (_CRS, 0)
58 {
59 Name (ECMD, ResourceTemplate()
60 {
61 IO (Decode16, 0x62, 0x62, 1, 1)
62 IO (Decode16, 0x66, 0x66, 1, 1)
63 })
64
65 Return (ECMD)
66 }
67
68 Method (_REG, 2)
69 {
70 // This method is needed by Windows XP/2000 for
71 // EC initialization before a driver is loaded
72
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +020073 If (Arg0 == 0x03) {
74 ECON = Arg1
Patrick Georgi021b7032012-11-06 11:05:38 +010075 }
76 }
77
78 // EC Query methods
79
80 Method (_Q11, 0)
81 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +020082 Debug = "_Q11: Fn-F8 (Sleep Button) pressed"
Patrick Georgi021b7032012-11-06 11:05:38 +010083 Notify(SLPB, 0x80)
84 }
85
86 Method (_Q30, 0)
87 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +020088 Debug = "_Q30: AC In"
Patrick Georgi021b7032012-11-06 11:05:38 +010089 Notify(ADP1, 0x80) // Tell the Power Adapter
90 PNOT() // and the CPU and Battery
91 }
92
93 Method (_Q31, 0)
94 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +020095 Debug = "_Q31: AC Out"
Patrick Georgi021b7032012-11-06 11:05:38 +010096 Notify(ADP1, 0x80) // Tell the Power Adapter
97 PNOT() // and the CPU and Battery
98 }
99
100 Method (_Q32, 0)
101 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200102 Debug = "_Q32: Bat1 In"
Patrick Georgi021b7032012-11-06 11:05:38 +0100103 Notify(BAT1, 0x81)
104 }
105
106 Method (_Q33, 0)
107 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200108 Debug = "_Q33: Bat1 Out"
Patrick Georgi021b7032012-11-06 11:05:38 +0100109 Notify(BAT1, 0x81)
110 }
111
112 Method (_Q34, 0)
113 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200114 Debug = "_Q34: Bat2 In"
Patrick Georgi021b7032012-11-06 11:05:38 +0100115 Notify(BAT2, 0x81)
116 }
117
118 Method (_Q35, 0)
119 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200120 Debug = "_Q35: Bat2 Out"
Patrick Georgi021b7032012-11-06 11:05:38 +0100121 Notify(BAT2, 0x81)
122 }
123
124 Method (_Q36, 0)
125 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200126 Debug = "_Q36: Bat1 Low Power"
Patrick Georgi021b7032012-11-06 11:05:38 +0100127 Notify(BAT1, 0x80)
128 }
129
130 Method (_Q37, 0)
131 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200132 Debug = "_Q37: Bat1 Full Charge"
Patrick Georgi021b7032012-11-06 11:05:38 +0100133 Notify(BAT1, 0x80)
134 }
135
136 Method (_Q38, 0)
137 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200138 Debug = "_Q38: Bat2 Low Power"
Patrick Georgi021b7032012-11-06 11:05:38 +0100139 Notify(BAT2, 0x80)
140 }
141
142 Method (_Q39, 0)
143 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200144 Debug = "_Q39: Bat2 Full Charge"
Patrick Georgi021b7032012-11-06 11:05:38 +0100145 Notify(BAT2, 0x80)
146 }
147
148 Method (_Q40, 0)
149 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200150 Debug = "_Q40: LID Open/Close"
Patrick Georgi021b7032012-11-06 11:05:38 +0100151 Notify(LID0, 0x80)
152 }
153
154 Method (_Q41, 0)
155 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200156 Debug = "_Q41: Floppy on Parallel Port: Call the Museum!"
Patrick Georgi021b7032012-11-06 11:05:38 +0100157 }
158
159 Method (_Q50, 0)
160 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200161 Debug = "_Q50: Processor is hot"
Patrick Georgi021b7032012-11-06 11:05:38 +0100162 Notify(\_TZ.THRM, 0x80)
163 }
164
165 Method (_Q51, 0)
166 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200167 Debug = "_Q51: Processor is boiling"
Patrick Georgi021b7032012-11-06 11:05:38 +0100168 Notify(\_TZ.THRM, 0x80)
169 }
170
171 Method (_Q52, 0)
172 {
Elyes HAOUAS53dd00a2020-10-08 10:06:43 +0200173 Debug = "_Q52: Processor is burning"
Patrick Georgi021b7032012-11-06 11:05:38 +0100174 Notify(\_TZ.THRM, 0x80)
175 }
176
177}