blob: 5085b29fb31e8eaed8b146b22255259cedd6f8e5 [file] [log] [blame]
Sven Schnelled8129f92011-04-20 09:12:17 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (c) 2011 Sven Schnelle <svens@stackframe.org>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Sven Schnelled8129f92011-04-20 09:12:17 +000015 */
16
17#include "smi.h"
18
19Scope (\_SB)
20{
21 OperationRegion (DLPC, SystemIO, 0x164c, 1)
22 Field(DLPC, ByteAcc, NoLock, Preserve)
23 {
24 , 3,
25 DSTA, 1,
26 }
27
28 Device(DOCK)
29 {
30 Name(_HID, "ACPI0003")
31 Name(_UID, 0x00)
32 Name(_PCL, Package() { \_SB } )
33
34 Method(_DCK, 1, NotSerialized)
35 {
36 if (Arg0) {
37 Sleep(250)
38 /* connect dock */
39 TRAP(SMI_DOCK_CONNECT)
40 } else {
41 /* disconnect dock */
42 TRAP(SMI_DOCK_DISCONNECT)
43 }
44
45 Xor(Arg0, DSTA, Local0)
46 Return (Local0)
47 }
48
49 Method(_STA, 0, NotSerialized)
50 {
51 Return (DSTA)
52 }
53 }
54}
55
56Scope(\_SB.PCI0.LPCB.EC)
57{
58 OperationRegion(PMH7, SystemIO, 0x15e0, 0x10)
59 Field(PMH7, ByteAcc, NoLock, Preserve)
60 {
61 Offset(0x0c),
62 PIDX, 8,
63 Offset(0x0e),
64 PDAT, 8,
65 }
66
67 IndexField(PIDX, PDAT, ByteAcc, NoLock, Preserve)
68 {
69 Offset (0x61),
70 DPWR, 1,
71 }
72
73 Method(_Q18, 0, NotSerialized)
74 {
75 Notify(\_SB.DOCK, 3)
76 }
77
78 Method(_Q37, 0, NotSerialized)
79 {
80 if (DPWR) {
81 Notify(\_SB.DOCK, 0)
82 } else {
83 Notify(\_SB.DOCK, 3)
84 }
85 }
Sven Schnelled8b60a02011-06-23 13:43:52 +020086
87 Method(_Q50, 0, NotSerialized)
88 {
89 if (\_SB.DOCK._STA()) {
90 Notify(\_SB.DOCK, 1)
91 }
92 }
Sven Schnelled8129f92011-04-20 09:12:17 +000093}