From patchwork Mon Mar 14 12:47:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: X60: Add _PRW/_PSW methods to LID/SLPB objects Date: Mon, 14 Mar 2011 12:47:18 -0000 From: Sven Schnelle X-Patchwork-Id: 2776 Message-Id: <1300106838-23881-1-git-send-email-svens@stackframe.org> To: coreboot@coreboot.org Cc: svens@stackframe.org This patch adds the required methods for enabling/disabling the LID and SLPB objects as wake source. On Thinkpads, the Fn key can (and is by the Vendor BIOS) programmed as Wake source, so let's do it the same way. Signed-off-by: Sven Schnelle Acked-by: Peter Stuge --- src/mainboard/lenovo/x60/acpi/lid.asl | 21 +++++++++++++++++++-- src/mainboard/lenovo/x60/acpi/sleepbutton.asl | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/mainboard/lenovo/x60/acpi/lid.asl b/src/mainboard/lenovo/x60/acpi/lid.asl index 2c92ee6..2dfa8d1 100644 --- a/src/mainboard/lenovo/x60/acpi/lid.asl +++ b/src/mainboard/lenovo/x60/acpi/lid.asl @@ -21,9 +21,12 @@ Field(ERAM, ByteAcc, NoLock, Preserve) { + Offset (0x32), + , 2, + WKLD, 1, Offset (0x46), - , 2, - LIDS , 1 + , 2, + LIDS, 1 } Device(LID) @@ -34,4 +37,18 @@ Device(LID) { return (LIDS) } + + Method(_PRW, 0, NotSerialized) + { + Return (Package() { 0x18, 0x03 }) + } + + Method(_PSW, 1, NotSerialized) + { + if (Arg0) { + Store(1, WKLD) + } else { + Store(0, WKLD) + } + } } diff --git a/src/mainboard/lenovo/x60/acpi/sleepbutton.asl b/src/mainboard/lenovo/x60/acpi/sleepbutton.asl index c339158..09e88aa 100644 --- a/src/mainboard/lenovo/x60/acpi/sleepbutton.asl +++ b/src/mainboard/lenovo/x60/acpi/sleepbutton.asl @@ -19,7 +19,31 @@ * MA 02110-1301 USA */ +Field(ERAM, ByteAcc, NoLock, Preserve) +{ + Offset (0x32), + , 4, + WKFN, 1, + Offset(0x83), + FNKY, 8 +} + Device(SLPB) { Name (_HID, EisaId ("PNP0C0E")) + Method(_PRW, 0, NotSerialized) + { + Return (Package() { 0x18, 0x03 }) + } + + Method(_PSW, 1, NotSerialized) + { + if (Arg0) { + Store(6, FNKY) /* Fn key acts as wake button */ + Store(1, WKFN) + } else { + Store(0, FNKY) /* Fn key normal operation */ + Store(0, WKFN) + } + } }