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