1/* SPDX-License-Identifier: GPL-2.0-only */ 2 3#include "smi.h" 4 5Scope (\_SB) 6{ 7 OperationRegion (DLPC, SystemIO, 0x164c, 1) 8 Field(DLPC, ByteAcc, NoLock, Preserve) 9 { 10 , 3, 11 DSTA, 1, 12 } 13 14 Device(DOCK) 15 { 16 Name(_HID, "ACPI0003") 17 Name(_UID, 0x00) 18 Name(_PCL, Package() { \_SB } ) 19 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 } 30 31 Local0 = Arg0 ^ DSTA 32 Return (Local0) 33 } 34 35 Method(_STA, 0, NotSerialized) 36 { 37 Return (DSTA) 38 } 39 } 40} 41 42Scope(\_SB.PCI0.LPCB.EC) 43{ 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 } 52 53 IndexField(PIDX, PDAT, ByteAcc, NoLock, Preserve) 54 { 55 Offset (0x61), 56 DPWR, 1, 57 } 58 59 Method(_Q18, 0, NotSerialized) 60 { 61 Notify(\_SB.DOCK, 3) 62 } 63 64 Method(_Q37, 0, NotSerialized) 65 { 66 if (DPWR) { 67 Notify(\_SB.DOCK, 0) 68 } else { 69 Notify(\_SB.DOCK, 3) 70 } 71 } 72 73 Method(_Q50, 0, NotSerialized) 74 { 75 if (\_SB.DOCK._STA()) { 76 Notify(\_SB.DOCK, 1) 77 } 78 } 79} 80