T60: undock on external power loss
authorSven Schnelle <svens@stackframe.org>
Thu, 23 Jun 2011 11:43:52 +0000 (13:43 +0200)
committerSven Schnelle <svens@stackframe.org>
Thu, 23 Jun 2011 12:12:26 +0000 (14:12 +0200)
If power is unplugged/lost, we should undock the docking station.
The power loss can also be caused by the fact that the user removed
the thinkpad from the docking station without pressing the Undock button/hotkey
first. Without undocking it on this event, the thinkpad LPC switch will still
connect the Docking connector, which causes crashes when docking it again.

Change-Id: I9ed783e491827bde20264868eab2b3a79c232922
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/62
Tested-by: build bot (Jenkins)
src/ec/lenovo/h8/acpi/ec.asl
src/mainboard/lenovo/t60/acpi/dock.asl

index 3ba4aa9819aba25ad74154adbb59944272d2f956..368afa828dcff52fc4c0a4d8f53f87a093b819f1 100644 (file)
@@ -35,6 +35,8 @@ Device(EC)
                                HSPA, 1,
                Offset (0x0C),
                                LEDS, 8,        /* LED state */
+               Offset (0x2a),
+                               EVNT, 8,        /* write will trigger EC event */
                Offset (0x3a),
                                AMUT, 1,        /* Audio Mute */
                Offset (0x3B),
@@ -109,6 +111,7 @@ Device(EC)
        Method(_Q27, 0, NotSerialized)
        {
                Notify (AC, 0x80)
+               Store(0x50, EVNT)
        }
 
        Method(_Q2A, 0, NotSerialized)
index ae9d19e40571beb91344e0d03c0cfa16714cbe4a..ba50609f3eb61a478f210037a36a4e1f8d06dacd 100644 (file)
@@ -88,4 +88,11 @@ Scope(\_SB.PCI0.LPCB.EC)
                        Notify(\_SB.DOCK, 3)
                }
        }
+
+       Method(_Q50, 0, NotSerialized)
+       {
+               if (\_SB.DOCK._STA()) {
+                       Notify(\_SB.DOCK, 1)
+               }
+       }
 }