Tim Van Patten | 9244358 | 2022-08-23 16:06:33 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | External(\_SB.DDEF, MethodObj) |
Tim Van Patten | a90aebb | 2022-08-16 12:09:23 -0600 | [diff] [blame] | 4 | External(\_SB.DTHL, MethodObj) |
Tim Van Patten | 9244358 | 2022-08-23 16:06:33 -0600 | [diff] [blame] | 5 | External(\_SB.DTAB, MethodObj) |
| 6 | |
| 7 | Scope (\_SB) |
| 8 | { |
| 9 | Method (DPTC, 0, Serialized) |
| 10 | { |
| 11 | /* If _SB.DDEF is not present, DPTC is not enabled so return early. */ |
| 12 | If (!CondRefOf (\_SB.DDEF)) |
| 13 | { |
| 14 | Return (Zero) |
| 15 | } |
| 16 | |
Tim Van Patten | a90aebb | 2022-08-16 12:09:23 -0600 | [diff] [blame] | 17 | /* If _SB.DTHL is not present, then DPTC Tablet Mode is not enabled. |
| 18 | * Throttle the SOC if the battery is not present (BTEX), the battery level is critical |
| 19 | * (BFCR), or the battery is cutoff (BFCT). */ |
| 20 | If (CondRefOf (\_SB.DTHL) && |
| 21 | (!\_SB.PCI0.LPCB.EC0.BTEX || \_SB.PCI0.LPCB.EC0.BFCR || \_SB.PCI0.LPCB.EC0.BFCT)) |
| 22 | { |
| 23 | \_SB.DTHL() |
| 24 | Return (Zero) |
| 25 | } |
| 26 | |
| 27 | /* If _SB.DTAB is not present, then DPTC Tablet Mode is not enabled. */ |
Felix Singer | 7b8ac00 | 2022-12-26 08:45:56 +0100 | [diff] [blame] | 28 | If (CondRefOf (\_SB.DTAB) && (\_SB.PCI0.LPCB.EC0.TBMD == 1)) |
Tim Van Patten | 9244358 | 2022-08-23 16:06:33 -0600 | [diff] [blame] | 29 | { |
| 30 | \_SB.DTAB() |
| 31 | Return (Zero) |
| 32 | } |
| 33 | |
EricKY Cheng | 429b199 | 2022-10-17 15:09:43 +0800 | [diff] [blame] | 34 | #if CONFIG(FEATURE_DYNAMIC_DPTC) |
| 35 | \_SB.DTTS() |
| 36 | #else |
Tim Van Patten | 9244358 | 2022-08-23 16:06:33 -0600 | [diff] [blame] | 37 | \_SB.DDEF() |
EricKY Cheng | 429b199 | 2022-10-17 15:09:43 +0800 | [diff] [blame] | 38 | #endif |
Tim Van Patten | 9244358 | 2022-08-23 16:06:33 -0600 | [diff] [blame] | 39 | Return (Zero) |
| 40 | } |
| 41 | } |