| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
Device(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 Celsius |
| 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 |
|
| 73 |
If (Arg0 == 0x03) { |
| 74 |
ECON = Arg1 |
| 75 |
} |
| 76 |
} |
| 77 |
|
| 78 |
// EC Query methods |
| 79 |
|
| 80 |
Method (_Q11, 0) |
| 81 |
{ |
| 82 |
Printf ("_Q11: Fn-F8 (Sleep Button) pressed") |
| 83 |
Notify(SLPB, 0x80) |
| 84 |
} |
| 85 |
|
| 86 |
Method (_Q30, 0) |
| 87 |
{ |
| 88 |
Printf ("_Q30: AC In") |
| 89 |
Notify(ADP1, 0x80) // Tell the Power Adapter |
| 90 |
PNOT() // and the CPU and Battery |
| 91 |
} |
| 92 |
|
| 93 |
Method (_Q31, 0) |
| 94 |
{ |
| 95 |
Printf ("_Q31: AC Out") |
| 96 |
Notify(ADP1, 0x80) // Tell the Power Adapter |
| 97 |
PNOT() // and the CPU and Battery |
| 98 |
} |
| 99 |
|
| 100 |
Method (_Q32, 0) |
| 101 |
{ |
| 102 |
Printf ("_Q32: Bat1 In") |
| 103 |
Notify(BAT1, 0x81) |
| 104 |
} |
| 105 |
|
| 106 |
Method (_Q33, 0) |
| 107 |
{ |
| 108 |
Printf ("_Q33: Bat1 Out") |
| 109 |
Notify(BAT1, 0x81) |
| 110 |
} |
| 111 |
|
| 112 |
Method (_Q34, 0) |
| 113 |
{ |
| 114 |
Printf ("_Q34: Bat2 In") |
| 115 |
Notify(BAT2, 0x81) |
| 116 |
} |
| 117 |
|
| 118 |
Method (_Q35, 0) |
| 119 |
{ |
| 120 |
Printf ("_Q35: Bat2 Out") |
| 121 |
Notify(BAT2, 0x81) |
| 122 |
} |
| 123 |
|
| 124 |
Method (_Q36, 0) |
| 125 |
{ |
| 126 |
Printf ("_Q36: Bat1 Low Power") |
| 127 |
Notify(BAT1, 0x80) |
| 128 |
} |
| 129 |
|
| 130 |
Method (_Q37, 0) |
| 131 |
{ |
| 132 |
Printf ("_Q37: Bat1 Full Charge") |
| 133 |
Notify(BAT1, 0x80) |
| 134 |
} |
| 135 |
|
| 136 |
Method (_Q38, 0) |
| 137 |
{ |
| 138 |
Printf ("_Q38: Bat2 Low Power") |
| 139 |
Notify(BAT2, 0x80) |
| 140 |
} |
| 141 |
|
| 142 |
Method (_Q39, 0) |
| 143 |
{ |
| 144 |
Printf ("_Q39: Bat2 Full Charge") |
| 145 |
Notify(BAT2, 0x80) |
| 146 |
} |
| 147 |
|
| 148 |
Method (_Q40, 0) |
| 149 |
{ |
| 150 |
Printf ("_Q40: LID Open/Close") |
| 151 |
Notify(LID0, 0x80) |
| 152 |
} |
| 153 |
|
| 154 |
Method (_Q41, 0) |
| 155 |
{ |
| 156 |
Printf ("_Q41: Floppy on Parallel Port: Call the Museum!") |
| 157 |
} |
| 158 |
|
| 159 |
Method (_Q50, 0) |
| 160 |
{ |
| 161 |
Printf ("_Q50: Processor is hot") |
| 162 |
Notify(\_TZ.THRM, 0x80) |
| 163 |
} |
| 164 |
|
| 165 |
Method (_Q51, 0) |
| 166 |
{ |
| 167 |
Printf ("_Q51: Processor is boiling") |
| 168 |
Notify(\_TZ.THRM, 0x80) |
| 169 |
} |
| 170 |
|
| 171 |
Method (_Q52, 0) |
| 172 |
{ |
| 173 |
Printf ("_Q52: Processor is burning") |
| 174 |
Notify(\_TZ.THRM, 0x80) |
| 175 |
} |
| 176 |
|
| 177 |
} |