Files
system76-coreboot/src/soc/amd/common/acpi/dptc.asl
Felix Singer 7b8ac0030c {acpi,arch,soc}/acpi: Replace constant "One" with actual number
Change-Id: I3dfd7dd1de3bd27c35c195bd43c4a5b8c5a2dc53
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71522
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-27 09:05:15 +00:00

42 lines
1.1 KiB
Plaintext

/* SPDX-License-Identifier: GPL-2.0-only */
External(\_SB.DDEF, MethodObj)
External(\_SB.DTHL, MethodObj)
External(\_SB.DTAB, MethodObj)
Scope (\_SB)
{
Method (DPTC, 0, Serialized)
{
/* If _SB.DDEF is not present, DPTC is not enabled so return early. */
If (!CondRefOf (\_SB.DDEF))
{
Return (Zero)
}
/* If _SB.DTHL is not present, then DPTC Tablet Mode is not enabled.
* Throttle the SOC if the battery is not present (BTEX), the battery level is critical
* (BFCR), or the battery is cutoff (BFCT). */
If (CondRefOf (\_SB.DTHL) &&
(!\_SB.PCI0.LPCB.EC0.BTEX || \_SB.PCI0.LPCB.EC0.BFCR || \_SB.PCI0.LPCB.EC0.BFCT))
{
\_SB.DTHL()
Return (Zero)
}
/* If _SB.DTAB is not present, then DPTC Tablet Mode is not enabled. */
If (CondRefOf (\_SB.DTAB) && (\_SB.PCI0.LPCB.EC0.TBMD == 1))
{
\_SB.DTAB()
Return (Zero)
}
#if CONFIG(FEATURE_DYNAMIC_DPTC)
\_SB.DTTS()
#else
\_SB.DDEF()
#endif
Return (Zero)
}
}