[coreboot-gerrit] Change in coreboot[master]: ec/lenovo/h8/acpi: Move ACPI HKEY device to new file

Patrick Rudolph (Code Review) gerrit at coreboot.org
Tue Nov 14 19:09:52 CET 2017


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/22463


Change subject: ec/lenovo/h8/acpi: Move ACPI HKEY device to new file
......................................................................

ec/lenovo/h8/acpi: Move ACPI HKEY device to new file

Move the APCI HKEY device to a new file and include it.
The future commits will extend it and this way it keeps readable.

Change-Id: Ie59b59e5a4148807125c71a362161026f685a97e
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/ec/lenovo/h8/acpi/ec.asl
A src/ec/lenovo/h8/acpi/thinkpad.asl
2 files changed, 157 insertions(+), 135 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/22463/1

diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index 750121d..5780602 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -286,141 +286,6 @@
 		^HKEY.RTAB (0xA)
 	}
 
-	Device (HKEY)
-	{
-		Name (_HID, EisaId ("IBM0068"))
-		Name (BTN, 0)
-		Name (BTAB, 0)
-
-		/* MASK */
-		Name (DHKN, 0x080C)
-
-		/* Effective Mask */
-		Name (EMSK, 0)
-
-		/* Effective Mask for tablet */
-		Name (ETAB, 0)
-
-		/* Device enabled. */
-		Name (EN, 0)
-
-		Method (_STA, 0, NotSerialized)
-		{
-			Return (0x0F)
-		}
-
-		/* Retrieve event. */
-		Method (MHKP, 0, NotSerialized)
-		{
-			Store (BTN, Local0)
-			If (LNotEqual (Local0, Zero)) {
-				Store (Zero, BTN)
-				Add (Local0, 0x1000, Local0)
-				Return (Local0)
-			}
-			Store (BTAB, Local0)
-			If (LNotEqual (Local0, Zero)) {
-				Store (Zero, BTAB)
-				Add (Local0, 0x5000, Local0)
-				Return (Local0)
-			}
-			Return (Zero)
-		}
-
-		/* Report event  */
-		Method (RHK, 1, NotSerialized) {
-			ShiftLeft (One, Subtract (Arg0, 1), Local0)
-			If (And (EMSK, Local0)) {
-				Store (Arg0, BTN)
-				Notify (HKEY, 0x80)
-			}
-		}
-
-		/* Report tablet  */
-		Method (RTAB, 1, NotSerialized) {
-			ShiftLeft (One, Subtract (Arg0, 1), Local0)
-			If (And (ETAB, Local0)) {
-				Store (Arg0, BTAB)
-				Notify (HKEY, 0x80)
-			}
-		}
-
-		/* Enable/disable all events.  */
-		Method (MHKC, 1, NotSerialized) {
-			If (Arg0) {
-				Store (DHKN, EMSK)
-				Store (Ones, ETAB)
-			}
-			Else
-			{
-				Store (Zero, EMSK)
-				Store (Zero, ETAB)
-			}
-			Store (Arg0, EN)
-		}
-
-		/* Enable/disable event.  */
-		Method (MHKM, 2, NotSerialized) {
-			If (LLessEqual (Arg0, 0x20)) {
-				ShiftLeft (One, Subtract (Arg0, 1), Local0)
-				If (Arg1)
-				{
-					Or (DHKN, Local0, DHKN)
-				}
-				Else
-				{
-					And (DHKN, Not (Local0), DHKN)
-				}
-				If (EN)
-				{
-					Store (DHKN, EMSK)
-				}
-			}
-		}
-
-		/* Mask hotkey all. */
-		Method (MHKA, 0, NotSerialized)
-		{
-			Return (0x07FFFFFF)
-		}
-
-		/* Report tablet mode switch state */
-		Method (MHKG, 0, NotSerialized)
-		{
-			Return (ShiftLeft(TBSW, 3))
-		}
-
-		/* Mute audio */
-		Method (SSMS, 1, NotSerialized)
-		{
-			Store(Arg0, ALMT)
-		}
-
-		/* Control mute microphone LED */
-		Method (MMTS, 1, NotSerialized)
-		{
-			If (Arg0)
-			{
-				TLED(0x8E)
-			}
-			Else
-			{
-				TLED(0x0E)
-			}
-		}
-
-		/* Version */
-		Method (MHKV, 0, NotSerialized)
-		{
-			Return (0x0100)
-		}
-
-		/* Master wireless switch state */
-		Method (WLSW, 0, NotSerialized)
-		{
-			Return (\_SB.PCI0.LPCB.EC.GSTS)
-		}
-	}
 
 #include "ac.asl"
 #include "battery.asl"
@@ -429,4 +294,5 @@
 #include "beep.asl"
 #include "thermal.asl"
 #include "systemstatus.asl"
+#include "thinkpad.asl"
 }
diff --git a/src/ec/lenovo/h8/acpi/thinkpad.asl b/src/ec/lenovo/h8/acpi/thinkpad.asl
new file mode 100644
index 0000000..eb5b60e
--- /dev/null
+++ b/src/ec/lenovo/h8/acpi/thinkpad.asl
@@ -0,0 +1,156 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (c) 2011 Sven Schnelle <svens at stackframe.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+Device (HKEY)
+{
+	/* Generated by ssdt.c */
+	External (\HBDC, IntObj)
+
+	Name (_HID, EisaId ("IBM0068"))
+
+	Name (BTN, 0)
+
+	Name (BTAB, 0)
+
+	/* MASK */
+	Name (DHKN, 0x080C)
+
+	/* Effective Mask */
+	Name (EMSK, 0)
+
+	/* Effective Mask for tablet */
+	Name (ETAB, 0)
+
+	/* Device enabled. */
+	Name (EN, 0)
+
+	Method (_STA, 0, NotSerialized)
+	{
+		Return (0x0F)
+	}
+
+	/* Retrieve event. */
+	Method (MHKP, 0, NotSerialized)
+	{
+		Store (BTN, Local0)
+		If (LNotEqual (Local0, Zero)) {
+			Store (Zero, BTN)
+			Add (Local0, 0x1000, Local0)
+			Return (Local0)
+		}
+		Store (BTAB, Local0)
+		If (LNotEqual (Local0, Zero)) {
+			Store (Zero, BTAB)
+			Add (Local0, 0x5000, Local0)
+			Return (Local0)
+		}
+		Return (Zero)
+	}
+
+	/* Report event  */
+	Method (RHK, 1, NotSerialized) {
+		ShiftLeft (One, Subtract (Arg0, 1), Local0)
+		If (And (EMSK, Local0)) {
+			Store (Arg0, BTN)
+			Notify (HKEY, 0x80)
+		}
+	}
+
+	/* Report tablet  */
+	Method (RTAB, 1, NotSerialized) {
+		ShiftLeft (One, Subtract (Arg0, 1), Local0)
+		If (And (ETAB, Local0)) {
+			Store (Arg0, BTAB)
+			Notify (HKEY, 0x80)
+		}
+	}
+
+	/* Enable/disable all events.  */
+	Method (MHKC, 1, NotSerialized) {
+		If (Arg0) {
+			Store (DHKN, EMSK)
+			Store (Ones, ETAB)
+		}
+		Else
+		{
+			Store (Zero, EMSK)
+			Store (Zero, ETAB)
+		}
+		Store (Arg0, EN)
+	}
+
+	/* Enable/disable event.  */
+	Method (MHKM, 2, NotSerialized) {
+		If (LLessEqual (Arg0, 0x20)) {
+			ShiftLeft (One, Subtract (Arg0, 1), Local0)
+			If (Arg1)
+			{
+				Or (DHKN, Local0, DHKN)
+			}
+			Else
+			{
+				And (DHKN, Not (Local0), DHKN)
+			}
+			If (EN)
+			{
+				Store (DHKN, EMSK)
+			}
+		}
+	}
+
+	/* Mask hotkey all. */
+	Method (MHKA, 0, NotSerialized)
+	{
+		Return (0x07FFFFFF)
+	}
+
+	/* Report tablet mode switch state */
+	Method (MHKG, 0, NotSerialized)
+	{
+		Return (ShiftLeft(TBSW, 3))
+	}
+
+	/* Mute audio */
+	Method (SSMS, 1, NotSerialized)
+	{
+		Store(Arg0, ALMT)
+	}
+
+	/* Control mute microphone LED */
+	Method (MMTS, 1, NotSerialized)
+	{
+		If (Arg0)
+		{
+			TLED(0x8E)
+		}
+		Else
+		{
+			TLED(0x0E)
+		}
+	}
+
+	/* Version */
+	Method (MHKV, 0, NotSerialized)
+	{
+		Return (0x0100)
+	}
+
+	/* Master wireless switch state */
+	Method (WLSW, 0, NotSerialized)
+	{
+		Return (\_SB.PCI0.LPCB.EC.GSTS)
+	}
+}

-- 
To view, visit https://review.coreboot.org/22463
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie59b59e5a4148807125c71a362161026f685a97e
Gerrit-Change-Number: 22463
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171114/9810b3dd/attachment.html>


More information about the coreboot-gerrit mailing list