payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / lenovo / t60 / acpi / dock.asl
bloba67b412b7e0ecec49951e9011cd101ffb5bc9e2c
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include "smi.h"
5 Scope (\_SB)
7         OperationRegion (DLPC, SystemIO, 0x164c, 1)
8         Field(DLPC, ByteAcc, NoLock, Preserve)
9         {
10                     ,   3,
11                 DSTA,   1,
12         }
14         Device(DOCK)
15         {
16                 Name(_HID, "ACPI0003")
17                 Name(_UID, 0x00)
18                 Name(_PCL, Package() { \_SB } )
20                 Method(_DCK, 1, NotSerialized)
21                 {
22                         if (Arg0) {
23                            Sleep(250)
24                            /* connect dock */
25                            TRAP(SMI_DOCK_CONNECT)
26                         } else {
27                            /* disconnect dock */
28                            TRAP(SMI_DOCK_DISCONNECT)
29                         }
31                         Local0 = Arg0 ^ DSTA
32                         Return (Local0)
33                 }
35                 Method(_STA, 0, NotSerialized)
36                 {
37                         Return (DSTA)
38                 }
39         }
42 Scope(\_SB.PCI0.LPCB.EC)
44         OperationRegion(PMH7, SystemIO, 0x15e0, 0x10)
45         Field(PMH7, ByteAcc, NoLock, Preserve)
46         {
47                 Offset(0x0c),
48                         PIDX, 8,
49                 Offset(0x0e),
50                         PDAT, 8,
51         }
53         IndexField(PIDX, PDAT, ByteAcc, NoLock, Preserve)
54         {
55                 Offset (0x61),
56                         DPWR, 1,
57         }
59         Method(_Q18, 0, NotSerialized)
60         {
61                Notify(\_SB.DOCK, 3)
62         }
64         Method(_Q37, 0, NotSerialized)
65         {
66                 if (DPWR) {
67                         Notify(\_SB.DOCK, 0)
68                 } else {
69                         Notify(\_SB.DOCK, 3)
70                 }
71         }
73         Method(_Q50, 0, NotSerialized)
74         {
75                 if (\_SB.DOCK._STA()) {
76                         Notify(\_SB.DOCK, 1)
77                 }
78         }