Vladimir Serbinenko | 9bf05de | 2013-11-14 19:11:19 +0100 | [diff] [blame] | 1 | /* |
| 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. |
Vladimir Serbinenko | 9bf05de | 2013-11-14 19:11:19 +0100 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include "smi.h" |
| 18 | |
| 19 | Scope (\_SB) |
| 20 | { |
| 21 | Device(DOCK) |
| 22 | { |
| 23 | Name(_HID, "ACPI0003") |
| 24 | Name(_UID, 0x00) |
| 25 | Name(_PCL, Package() { \_SB } ) |
| 26 | |
| 27 | Method(_DCK, 1, NotSerialized) |
| 28 | { |
| 29 | if (Arg0) { |
| 30 | /* connect dock */ |
Vladimir Serbinenko | f319ae4 | 2014-08-19 00:48:39 +0200 | [diff] [blame] | 31 | Store (1, \GP28) |
Vladimir Serbinenko | 9bf05de | 2013-11-14 19:11:19 +0100 | [diff] [blame] | 32 | Store (1, \_SB.PCI0.LPCB.EC.DKR1) |
| 33 | Store (1, \_SB.PCI0.LPCB.EC.DKR2) |
| 34 | Store (1, \_SB.PCI0.LPCB.EC.DKR3) |
| 35 | } else { |
| 36 | /* disconnect dock */ |
Vladimir Serbinenko | f319ae4 | 2014-08-19 00:48:39 +0200 | [diff] [blame] | 37 | Store (0, \GP28) |
Vladimir Serbinenko | 9bf05de | 2013-11-14 19:11:19 +0100 | [diff] [blame] | 38 | Store (0, \_SB.PCI0.LPCB.EC.DKR1) |
| 39 | Store (0, \_SB.PCI0.LPCB.EC.DKR2) |
| 40 | Store (0, \_SB.PCI0.LPCB.EC.DKR3) |
| 41 | } |
| 42 | Xor(Arg0, \_SB.PCI0.LPCB.EC.DKR1, Local0) |
| 43 | Return (Local0) |
| 44 | } |
| 45 | |
| 46 | Method(_STA, 0, NotSerialized) |
| 47 | { |
| 48 | Return (\_SB.PCI0.LPCB.EC.DKR1) |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | Scope(\_SB.PCI0.LPCB.EC) |
| 54 | { |
| 55 | Method(_Q18, 0, NotSerialized) |
| 56 | { |
| 57 | Notify(\_SB.DOCK, 3) |
| 58 | } |
| 59 | |
| 60 | Method(_Q45, 0, NotSerialized) |
| 61 | { |
| 62 | Notify(\_SB.DOCK, 3) |
| 63 | } |
| 64 | |
Vladimir Serbinenko | 9bf05de | 2013-11-14 19:11:19 +0100 | [diff] [blame] | 65 | Method(_Q58, 0, NotSerialized) |
| 66 | { |
| 67 | Notify(\_SB.DOCK, 0) |
| 68 | } |
| 69 | |
| 70 | Method(_Q37, 0, NotSerialized) |
| 71 | { |
| 72 | Notify(\_SB.DOCK, 0) |
| 73 | } |
| 74 | } |