blob: 6589ccf1a8df25ef33958e433fdf23b5f4f4d29a [file] [log] [blame]
Stefan Reinauerd6682e82013-02-21 15:39:35 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauerd6682e82013-02-21 15:39:35 -080014 */
15
16/*
17 * The mainboard must define a PNOT method to handle power
18 * state notifications and Notify CPU device objects to
19 * re-evaluate their _PPC and _CST tables.
20 */
21
Duncan Lauried338b462013-07-31 15:30:41 -070022// Mainboard specific throttle handler
Freddy Paule8cc52f2015-10-02 19:06:57 -070023#ifdef DPTF_ENABLE_CHARGER
Duncan Laurie3f1500f2014-03-06 08:37:49 -080024External (\_SB.DPTF.TCHG, DeviceObj)
Freddy Paule8cc52f2015-10-02 19:06:57 -070025#endif
Martin Roth9c055982018-05-01 21:52:42 -050026
Duncan Lauried338b462013-07-31 15:30:41 -070027
Stefan Reinauerd6682e82013-02-21 15:39:35 -080028Device (EC0)
29{
30 Name (_HID, EISAID ("PNP0C09"))
31 Name (_UID, 1)
Duncan Laurie045222f2013-05-21 07:49:11 -070032 Name (_GPE, EC_SCI_GPI)
Stefan Reinauerd6682e82013-02-21 15:39:35 -080033 Name (TOFS, EC_TEMP_SENSOR_OFFSET)
Duncan Laurie433432b2013-06-03 10:38:22 -070034 Name (TNCA, EC_TEMP_SENSOR_NOT_CALIBRATED)
35 Name (TNOP, EC_TEMP_SENSOR_NOT_POWERED)
36 Name (TBAD, EC_TEMP_SENSOR_ERROR)
37 Name (TNPR, EC_TEMP_SENSOR_NOT_PRESENT)
Stefan Reinauerd6682e82013-02-21 15:39:35 -080038 Name (DWRN, 15) // Battery capacity warning at 15%
39 Name (DLOW, 10) // Battery capacity low at 10%
40
Shawn Nematbakhsh37b7a662015-03-24 11:07:51 -070041 OperationRegion (ERAM, EmbeddedControl, 0x00, EC_ACPI_MEM_MAPPED_BEGIN)
Stefan Reinauerd6682e82013-02-21 15:39:35 -080042 Field (ERAM, ByteAcc, Lock, Preserve)
43 {
44 Offset (0x00),
45 RAMV, 8, // EC RAM Version
46 TSTB, 8, // Test Byte
47 TSTC, 8, // Complement of Test Byte
Patrick Georgif9267f92017-08-24 23:12:55 +020048 KBLV, 8, // Keyboard Backlight value
Duncan Lauriead8d9132013-12-10 07:41:33 -080049 FAND, 8, // Set Fan Duty Cycle
Duncan Laurie93e24442014-01-06 12:30:52 -080050 PATI, 8, // Programmable Auxiliary Trip Sensor ID
51 PATT, 8, // Programmable Auxiliary Trip Threshold
52 PATC, 8, // Programmable Auxiliary Trip Commit
Duncan Lauriee6b280e2014-02-10 16:21:05 -080053 CHGL, 8, // Charger Current Limit
jiazi Yang51fc93f2016-07-28 05:15:01 -040054 TBMD, 1, // Tablet mode
Patrick Georgif9267f92017-08-24 23:12:55 +020055 // DFUD must be 0 for the other 31 values to be valid
Patrick Georgi4bd68b82017-08-18 21:06:24 +020056 Offset (0x0a),
Patrick Georgif9267f92017-08-24 23:12:55 +020057 DFUD, 1, // Device Features Undefined
58 FLSH, 1, // Flash commands present
59 PFAN, 1, // PWM Fan control present
60 KBLE, 1, // Keyboard Backlight present
61 LTBR, 1, // Lightbar present
62 LEDC, 1, // LED control
63 MTNS, 1, // Motion sensors present
64 KEYB, 1, // EC is keyboard controller
65 PSTR, 1, // Persistent storage
66 P80P, 1, // EC serves I/O Port 80h
67 THRM, 1, // EC supports thermal management
68 SBKL, 1, // Screen backlight switch present
69 WIFI, 1, // WIFI switch present
70 HOST, 1, // EC monitors host events (eg SCI, SMI)
71 GPIO, 1, // EC provides GPIO commands
72 I2CB, 1, // EC provides I2C controller access
73 CHRG, 1, // EC provides commands for charger control
74 BATT, 1, // Simply Battery support
75 SBAT, 1, // Smart Battery support
76 HANG, 1, // EC can detect host hang
77 PMUI, 1, // Power Information
78 DSEC, 1, // another EC exists downstream
79 UPDC, 1, // supports USB Power Delivery
80 UMUX, 1, // supports USB Mux
81 MSFF, 1, // Motion Sense has FIFO
82 TVST, 1, // supports temporary secure vstore
83 TCMV, 1, // USB Type C Muxing is virtual (host assisted)
84 RTCD, 1, // EC provides an RTC device
85 FPRD, 1, // EC provides a fingerprint reader device
86 TPAD, 1, // EC provides a touchpad device
87 RWSG, 1, // EC has RWSIG task enabled
88 DEVE, 1, // EC supports device events
89 // make sure we're within our space envelope
90 Offset (0x0e),
Nicolas Boichat07fe6182018-01-26 14:37:16 +080091 Offset (0x12),
92 BTID, 8, // Battery index that host wants to read
Emil Lundmark9d5f9f22018-05-22 19:31:37 +020093 USPP, 8, // USB Port Power
Nicolas Boichat07fe6182018-01-26 14:37:16 +080094}
Stefan Reinauerd6682e82013-02-21 15:39:35 -080095
Martin Rothf5c35182017-06-24 14:09:38 -060096#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_ACPI_MEMMAP)
Shawn Nematbakhsh37b7a662015-03-24 11:07:51 -070097 OperationRegion (EMEM, EmbeddedControl,
98 EC_ACPI_MEM_MAPPED_BEGIN, EC_ACPI_MEM_MAPPED_SIZE)
99 Field (EMEM, ByteAcc, Lock, Preserve)
100#else
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800101 OperationRegion (EMEM, SystemIO, EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE)
102 Field (EMEM, ByteAcc, NoLock, Preserve)
Shawn Nematbakhsh37b7a662015-03-24 11:07:51 -0700103#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800104 {
Shawn Nematbakhsh37b7a662015-03-24 11:07:51 -0700105 #include "emem.asl"
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800106 }
107
Aaron Durbin05201d72016-09-23 16:06:14 -0500108#ifdef EC_ENABLE_LID_SWITCH
109 /* LID Switch */
110 Device (LID0)
111 {
112 Name (_HID, EisaId ("PNP0C0D"))
113 Method (_LID, 0)
114 {
115 Return (^^LIDS)
116 }
117
118#ifdef EC_ENABLE_WAKE_PIN
119 Name (_PRW, Package () { EC_ENABLE_WAKE_PIN, 0x5 })
120#endif
121 }
122#endif
123
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800124 Method (TINS, 1, Serialized)
125 {
126 Switch (ToInteger (Arg0))
127 {
128 Case (0) { Return (TIN0) }
129 Case (1) { Return (TIN1) }
130 Case (2) { Return (TIN2) }
131 Case (3) { Return (TIN3) }
132 Case (4) { Return (TIN4) }
133 Case (5) { Return (TIN5) }
134 Case (6) { Return (TIN6) }
135 Case (7) { Return (TIN7) }
136 Case (8) { Return (TIN8) }
137 Case (9) { Return (TIN9) }
138 Default { Return (TIN0) }
139 }
140 }
141
Duncan Laurie20373c02015-09-22 09:40:37 -0700142 Method (_CRS, 0, Serialized)
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800143 {
144 Name (ECMD, ResourceTemplate()
145 {
146 IO (Decode16,
147 EC_LPC_ADDR_ACPI_DATA,
148 EC_LPC_ADDR_ACPI_DATA,
149 0, 1)
150 IO (Decode16,
151 EC_LPC_ADDR_ACPI_CMD,
152 EC_LPC_ADDR_ACPI_CMD,
153 0, 1)
154 })
155 Return (ECMD)
156 }
157
158 Method (_REG, 2, NotSerialized)
159 {
160 // Initialize AC power state
161 Store (ACEX, \PWRS)
162
163 // Initialize LID switch state
164 Store (LIDS, \LIDS)
165 }
166
Duncan Lauriead8d9132013-12-10 07:41:33 -0800167 /* Read requested temperature and check against EC error values */
168 Method (TSRD, 1, Serialized)
169 {
170 Store (\_SB.PCI0.LPCB.EC0.TINS (Arg0), Local0)
171
172 /* Check for sensor not calibrated */
173 If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TNCA)) {
174 Return (Zero)
175 }
176
177 /* Check for sensor not present */
178 If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TNPR)) {
179 Return (Zero)
180 }
181
182 /* Check for sensor not powered */
183 If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TNOP)) {
184 Return (Zero)
185 }
186
187 /* Check for sensor bad reading */
188 If (LEqual (Local0, \_SB.PCI0.LPCB.EC0.TBAD)) {
189 Return (Zero)
190 }
191
192 /* Adjust by offset to get Kelvin */
193 Add (\_SB.PCI0.LPCB.EC0.TOFS, Local0, Local0)
194
195 /* Convert to 1/10 Kelvin */
196 Multiply (Local0, 10, Local0)
197
198 Return (Local0)
199 }
200
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800201 // Lid Closed Event
202 Method (_Q01, 0, NotSerialized)
203 {
204 Store ("EC: LID CLOSE", Debug)
205 Store (LIDS, \LIDS)
Aaron Durbin05201d72016-09-23 16:06:14 -0500206#ifdef EC_ENABLE_LID_SWITCH
207 Notify (LID0, 0x80)
Aaron Durbin05201d72016-09-23 16:06:14 -0500208#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800209 }
210
211 // Lid Open Event
212 Method (_Q02, 0, NotSerialized)
213 {
214 Store ("EC: LID OPEN", Debug)
215 Store (LIDS, \LIDS)
Furquan Shaikha3a84562017-11-28 14:32:17 -0800216 Notify (CREC, 0x2)
Aaron Durbin05201d72016-09-23 16:06:14 -0500217#ifdef EC_ENABLE_LID_SWITCH
218 Notify (LID0, 0x80)
Aaron Durbin05201d72016-09-23 16:06:14 -0500219#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800220 }
221
222 // Power Button
223 Method (_Q03, 0, NotSerialized)
224 {
225 Store ("EC: POWER BUTTON", Debug)
226 Notify (\_SB.PWRB, 0x80)
227 }
228
229 // AC Connected
230 Method (_Q04, 0, NotSerialized)
231 {
232 Store ("EC: AC CONNECTED", Debug)
233 Store (ACEX, \PWRS)
234 Notify (AC, 0x80)
Freddy Paule8cc52f2015-10-02 19:06:57 -0700235#ifdef DPTF_ENABLE_CHARGER
Duncan Laurie3f1500f2014-03-06 08:37:49 -0800236 If (CondRefOf (\_SB.DPTF.TCHG)) {
237 Notify (\_SB.DPTF.TCHG, 0x80)
238 }
Freddy Paule8cc52f2015-10-02 19:06:57 -0700239#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800240 \PNOT ()
241 }
242
243 // AC Disconnected
244 Method (_Q05, 0, NotSerialized)
245 {
246 Store ("EC: AC DISCONNECTED", Debug)
247 Store (ACEX, \PWRS)
248 Notify (AC, 0x80)
Freddy Paule8cc52f2015-10-02 19:06:57 -0700249#ifdef DPTF_ENABLE_CHARGER
Duncan Laurie3f1500f2014-03-06 08:37:49 -0800250 If (CondRefOf (\_SB.DPTF.TCHG)) {
251 Notify (\_SB.DPTF.TCHG, 0x80)
252 }
Freddy Paule8cc52f2015-10-02 19:06:57 -0700253#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800254 \PNOT ()
255 }
256
257 // Battery Low Event
258 Method (_Q06, 0, NotSerialized)
259 {
260 Store ("EC: BATTERY LOW", Debug)
261 Notify (BAT0, 0x80)
262 }
263
264 // Battery Critical Event
265 Method (_Q07, 0, NotSerialized)
266 {
267 Store ("EC: BATTERY CRITICAL", Debug)
268 Notify (BAT0, 0x80)
269 }
270
271 // Battery Info Event
272 Method (_Q08, 0, NotSerialized)
273 {
274 Store ("EC: BATTERY INFO", Debug)
275 Notify (BAT0, 0x81)
Nicolas Boichat07fe6182018-01-26 14:37:16 +0800276#ifdef EC_ENABLE_SECOND_BATTERY_DEVICE
277 If (CondRefOf (BAT1)) {
278 Notify (BAT1, 0x81)
279 }
280#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800281 }
282
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800283 // Thermal Overload Event
284 Method (_Q0A, 0, NotSerialized)
285 {
286 Store ("EC: THERMAL OVERLOAD", Debug)
287 Notify (\_TZ, 0x80)
288 }
289
290 // Thermal Event
291 Method (_Q0B, 0, NotSerialized)
292 {
293 Store ("EC: THERMAL", Debug)
294 Notify (\_TZ, 0x80)
295 }
296
297 // USB Charger
298 Method (_Q0C, 0, NotSerialized)
299 {
300 Store ("EC: USB CHARGER", Debug)
301 }
302
303 // Key Pressed
304 Method (_Q0D, 0, NotSerialized)
305 {
306 Store ("EC: KEY PRESSED", Debug)
Furquan Shaikha3a84562017-11-28 14:32:17 -0800307 Notify (CREC, 0x2)
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800308 }
309
Duncan Laurie18d9899b2013-08-28 09:54:04 -0700310 // Thermal Shutdown Imminent
311 Method (_Q10, 0, NotSerialized)
312 {
313 Store ("EC: THERMAL SHUTDOWN", Debug)
314 Notify (\_TZ, 0x80)
315 }
316
317 // Battery Shutdown Imminent
318 Method (_Q11, 0, NotSerialized)
319 {
320 Store ("EC: BATTERY SHUTDOWN", Debug)
321 Notify (BAT0, 0x80)
322 }
323
Duncan Lauried338b462013-07-31 15:30:41 -0700324 // Throttle Start
325 Method (_Q12, 0, NotSerialized)
326 {
Martin Roth6b1ceac2018-05-06 17:58:36 -0500327#ifdef EC_ENABLE_THROTTLING_HANDLER
Duncan Lauried338b462013-07-31 15:30:41 -0700328 Store ("EC: THROTTLE START", Debug)
Martin Roth6b1ceac2018-05-06 17:58:36 -0500329 \_TZ.THRT (1)
330#endif
Duncan Lauried338b462013-07-31 15:30:41 -0700331 }
332
333 // Throttle Stop
334 Method (_Q13, 0, NotSerialized)
335 {
Martin Roth6b1ceac2018-05-06 17:58:36 -0500336#ifdef EC_ENABLE_THROTTLING_HANDLER
Duncan Lauried338b462013-07-31 15:30:41 -0700337 Store ("EC: THROTTLE STOP", Debug)
Martin Roth6b1ceac2018-05-06 17:58:36 -0500338 \_TZ.THRT (0)
339#endif
Duncan Lauried338b462013-07-31 15:30:41 -0700340 }
341
Shawn Nematbakhsh98cc94c2014-08-28 11:33:41 -0700342#ifdef EC_ENABLE_PD_MCU_DEVICE
343 // PD event
344 Method (_Q16, 0, NotSerialized)
345 {
346 Store ("EC: GOT PD EVENT", Debug)
347 Notify (ECPD, 0x80)
348 }
349#endif
350
Duncan Lauried8401182014-09-29 08:32:19 -0700351 // Battery Status
352 Method (_Q17, 0, NotSerialized)
353 {
354 Store ("EC: BATTERY STATUS", Debug)
355 Notify (BAT0, 0x80)
Nicolas Boichat07fe6182018-01-26 14:37:16 +0800356#ifdef EC_ENABLE_SECOND_BATTERY_DEVICE
357 If (CondRefOf (BAT1)) {
358 Notify (BAT1, 0x80)
359 }
360#endif
Duncan Lauried8401182014-09-29 08:32:19 -0700361 }
362
Gwendal Grignou95b7a6c2016-05-03 23:53:23 -0700363 // MKBP interrupt.
Gwendal Grignou880b4582016-06-20 08:49:25 -0700364 Method (_Q1B, 0, NotSerialized)
Gwendal Grignou95b7a6c2016-05-03 23:53:23 -0700365 {
366 Store ("EC: MKBP", Debug)
367 Notify (CREC, 0x80)
368 }
369
jiazi Yang51fc93f2016-07-28 05:15:01 -0400370 // TABLET mode switch Event
371 Method (_Q1D, 0, NotSerialized)
372 {
373 Store ("EC: TABLET mode switch Event", Debug)
Furquan Shaikha3a84562017-11-28 14:32:17 -0800374 Notify (CREC, 0x2)
375#ifdef EC_ENABLE_TABLET_EVENT
Martin Roth9c055982018-05-01 21:52:42 -0500376 \_SB.DPTF.TPET()
Furquan Shaikhc96ad862018-01-26 10:40:09 -0800377#endif
378#ifdef EC_ENABLE_TBMC_DEVICE
Gwendal Grignou87d5fb82017-01-19 18:30:21 -0800379 Notify (TBMC, 0x80)
Gwendal Grignou87d5fb82017-01-19 18:30:21 -0800380#endif
Furquan Shaikha3a84562017-11-28 14:32:17 -0800381 }
jiazi Yang51fc93f2016-07-28 05:15:01 -0400382
Duncan Lauriead8d9132013-12-10 07:41:33 -0800383 /*
384 * Dynamic Platform Thermal Framework support
385 */
386
Duncan Laurie93e24442014-01-06 12:30:52 -0800387 /* Mutex for EC PAT interface */
388 Mutex (PATM, 1)
389
Duncan Lauriead8d9132013-12-10 07:41:33 -0800390 /*
391 * Set Aux Trip Point 0
392 * Arg0 = Temp Sensor ID
393 * Arg1 = Value to set
394 */
395 Method (PAT0, 2, Serialized)
396 {
Duncan Laurie93e24442014-01-06 12:30:52 -0800397 If (Acquire (^PATM, 1000)) {
398 Return (0)
399 }
400
Duncan Laurie93e24442014-01-06 12:30:52 -0800401 /* Set sensor ID */
402 Store (ToInteger (Arg0), ^PATI)
403
Duncan Laurie8be67592014-01-09 10:01:05 -0800404 /* Temperature is passed in 1/10 Kelvin */
Duncan Laurie20373c02015-09-22 09:40:37 -0700405 Divide (ToInteger (Arg1), 10, , Local1)
Duncan Laurie8be67592014-01-09 10:01:05 -0800406
407 /* Adjust by EC temperature offset */
408 Subtract (Local1, ^TOFS, ^PATT)
Duncan Laurie93e24442014-01-06 12:30:52 -0800409
410 /* Set commit value with SELECT=0 and ENABLE=1 */
411 Store (0x02, ^PATC)
412
413 Release (^PATM)
414 Return (1)
Duncan Lauriead8d9132013-12-10 07:41:33 -0800415 }
416
417 /*
418 * Set Aux Trip Point 1
419 * Arg0 = Temp Sensor ID
420 * Arg1 = Value to set
421 */
422 Method (PAT1, 2, Serialized)
423 {
Duncan Laurie93e24442014-01-06 12:30:52 -0800424 If (Acquire (^PATM, 1000)) {
425 Return (0)
426 }
427
Duncan Laurie93e24442014-01-06 12:30:52 -0800428 /* Set sensor ID */
429 Store (ToInteger (Arg0), ^PATI)
430
Duncan Laurie8be67592014-01-09 10:01:05 -0800431 /* Temperature is passed in 1/10 Kelvin */
Duncan Laurie20373c02015-09-22 09:40:37 -0700432 Divide (ToInteger (Arg1), 10, , Local1)
Duncan Laurie8be67592014-01-09 10:01:05 -0800433
434 /* Adjust by EC temperature offset */
435 Subtract (Local1, ^TOFS, ^PATT)
Duncan Laurie93e24442014-01-06 12:30:52 -0800436
437 /* Set commit value with SELECT=1 and ENABLE=1 */
438 Store (0x03, ^PATC)
439
440 Release (^PATM)
441 Return (1)
442 }
443
Duncan Laurie8be67592014-01-09 10:01:05 -0800444 /* Disable Aux Trip Points
445 * Arg0 = Temp Sensor ID
446 */
447 Method (PATD, 1, Serialized)
Duncan Laurie93e24442014-01-06 12:30:52 -0800448 {
449 If (Acquire (^PATM, 1000)) {
450 Return (0)
451 }
452
Duncan Laurie8be67592014-01-09 10:01:05 -0800453 Store (ToInteger (Arg0), ^PATI)
Duncan Laurie93e24442014-01-06 12:30:52 -0800454 Store (0x00, ^PATT)
455
456 /* Disable PAT0 */
457 Store (0x00, ^PATC)
458
459 /* Disable PAT1 */
460 Store (0x01, ^PATC)
461
462 Release (^PATM)
463 Return (1)
Duncan Lauriead8d9132013-12-10 07:41:33 -0800464 }
465
466 /*
Duncan Laurie93e24442014-01-06 12:30:52 -0800467 * Thermal Threshold Event
Duncan Lauriee6b280e2014-02-10 16:21:05 -0800468 */
Duncan Laurie8be67592014-01-09 10:01:05 -0800469 Method (_Q09, 0, NotSerialized)
Duncan Lauriead8d9132013-12-10 07:41:33 -0800470 {
Duncan Laurie93e24442014-01-06 12:30:52 -0800471 If (Acquire (^PATM, 1000)) {
472 Return ()
Duncan Lauriead8d9132013-12-10 07:41:33 -0800473 }
Duncan Laurie93e24442014-01-06 12:30:52 -0800474
Duncan Laurie93e24442014-01-06 12:30:52 -0800475 /* Read sensor ID for event */
476 Store (^PATI, Local0)
477
478 /* When sensor ID returns 0xFF then no more events */
479 While (LNotEqual (Local0, EC_TEMP_SENSOR_NOT_PRESENT))
480 {
Martin Roth15f232d2018-04-29 22:41:58 -0500481#ifdef HAVE_THERM_EVENT_HANDLER
482 \_SB.DPTF.TEVT (Local0)
483#endif
Aaron Durbinb3ce6582014-05-13 09:23:10 -0500484
Duncan Laurie93e24442014-01-06 12:30:52 -0800485 /* Keep reaading sensor ID for event */
486 Store (^PATI, Local0)
487 }
488
489 Release (^PATM)
Duncan Lauriead8d9132013-12-10 07:41:33 -0800490 }
491
Duncan Lauriee6b280e2014-02-10 16:21:05 -0800492 /*
493 * Set Charger Current Limit
494 * Arg0 = Current Limit in 64mA steps
495 */
496 Method (CHGS, 1, Serialized)
497 {
498 Store (ToInteger (Arg0), ^CHGL)
499 }
500
501 /*
502 * Disable Charger Current Limit
503 */
504 Method (CHGD, 0, Serialized)
505 {
506 Store (0xFF, ^CHGL)
507 }
508
jiazi Yang51fc93f2016-07-28 05:15:01 -0400509 /* Read current Tablet mode */
510 Method (RCTM, 0, NotSerialized)
511 {
512 Return (^TBMD)
513 }
514
Emil Lundmark9d5f9f22018-05-22 19:31:37 +0200515#if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_ACPI_USB_PORT_POWER)
516 /*
517 * Enable USB Port Power
518 * Arg0 = USB port ID
519 */
520 Method (UPPS, 1, Serialized)
521 {
522 Or (USPP, ShiftLeft (1, Arg0), USPP)
523 }
524
525 /*
526 * Disable USB Port Power
527 * Arg0 = USB port ID
528 */
529 Method (UPPC, 1, Serialized)
530 {
531 And (USPP, Not (ShiftLeft (1, Arg0)), USPP)
532 }
533#endif
534
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800535 #include "ac.asl"
536 #include "battery.asl"
Gwendal Grignou866cc3d2016-05-03 23:24:53 -0700537 #include "cros_ec.asl"
Duncan Laurie612163eb2014-06-13 10:35:22 -0700538
539#ifdef EC_ENABLE_ALS_DEVICE
540 #include "als.asl"
541#endif
Shawn Nematbakhsh98cc94c2014-08-28 11:33:41 -0700542
Duncan Laurieef549a02015-09-01 09:47:55 -0700543#ifdef EC_ENABLE_KEYBOARD_BACKLIGHT
Elyes HAOUASb9331092016-09-05 19:55:34 +0200544 #include "keyboard_backlight.asl"
Duncan Laurieef549a02015-09-01 09:47:55 -0700545#endif
546
Shawn Nematbakhsh98cc94c2014-08-28 11:33:41 -0700547#ifdef EC_ENABLE_PD_MCU_DEVICE
548 #include "pd.asl"
549#endif
Gwendal Grignou87d5fb82017-01-19 18:30:21 -0800550
Furquan Shaikhc96ad862018-01-26 10:40:09 -0800551#ifdef EC_ENABLE_TBMC_DEVICE
Gwendal Grignou87d5fb82017-01-19 18:30:21 -0800552 #include "tbmc.asl"
553#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800554}