Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/22919
Change subject: [TOTEST]mb/lenovo/x200/dock.asl: Issue DOCK ACPI events based on Dock ID ......................................................................
[TOTEST]mb/lenovo/x200/dock.asl: Issue DOCK ACPI events based on Dock ID
Some Dock events only need to happen based on the Dock Id (which functions as a presence detect GPIO).
Inspired by vendor bios DSDT.
This fixes ACPI undock events on every power unplug even when undock.
Change-Id: I1eef971d49508bcd94d5d1cf2b70395b7cd80b1c Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/mainboard/lenovo/x200/acpi/dock.asl 1 file changed, 37 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/22919/1
diff --git a/src/mainboard/lenovo/x200/acpi/dock.asl b/src/mainboard/lenovo/x200/acpi/dock.asl index 0c7c9ab..197f298 100644 --- a/src/mainboard/lenovo/x200/acpi/dock.asl +++ b/src/mainboard/lenovo/x200/acpi/dock.asl @@ -41,6 +41,24 @@ { Return (_SB.PCI0.LPCB.EC.DKR1) } + + Name (G_ID, 0xFFFFFFFF) + /* Returns 0x7 (dock present) or 0x3 (dock absent) */ + Method(GGID, 0, NotSerialized) + { + Store(G_ID, Local0) + if (LEqual(Local0, 0xFFFFFFFF)) + { + Store(Or (Or (GP02, ShiftLeft(GP03, 1)), + ShiftLeft(GP04, 2)), Local0) + If (LEqual(Local0, 0x00)) + { + Store(0x03, Local0) + } + Store(Local0, G_ID) + } + return (Local0) + } } }
@@ -63,7 +81,11 @@
Method(_Q50, 0, NotSerialized) { - Notify(_SB.DOCK, 3) + Store(_SB.DOCK.GGID (), Local0) + if (LNotEqual(Local0, 0x07)) + { + Notify(_SB.DOCK, 3) + } }
Method(_Q58, 0, NotSerialized) @@ -73,6 +95,19 @@
Method(_Q5A, 0, NotSerialized) { - Notify(_SB.DOCK, 3) + Store(_SB.DOCK.GGID (), Local0) + if (LEqual(Local0, 0x07)) + { + Notify(_SB.DOCK, 3) + } + if (LEqual(Local0, 0x03)) + { + Sleep(0x64) + Store(DKR1, Local1) + if (LEqual(Local1, 1)) + { + Notify(_SB.DOCK, 0) + } + } } }