• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3External(\_SB.DDEF, MethodObj)
4External(\_SB.DTHL, MethodObj)
5External(\_SB.DTAB, MethodObj)
6
7Scope (\_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 (0)
15        }
16
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 (0)
25        }
26
27        /* If _SB.DTAB is not present, then DPTC Tablet Mode is not enabled. */
28        If (CondRefOf (\_SB.DTAB) && (\_SB.PCI0.LPCB.EC0.TBMD == 1))
29        {
30            \_SB.DTAB()
31            Return (0)
32        }
33
34#if CONFIG(FEATURE_DYNAMIC_DPTC)
35        \_SB.DTTS()
36#else
37        \_SB.DDEF()
38#endif
39        Return (0)
40    }
41}
42