[coreboot-gerrit] Patch set updated for coreboot: ec/google/chromeec: Add support for tablet mode switch driver
Gwendal Grignou (gwendal@chromium.org)
gerrit at coreboot.org
Tue Jan 31 00:54:22 CET 2017
Gwendal Grignou (gwendal at chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18173
-gerrit
commit 12b8079f0f09f79bb7c0c5e99f7b79b8572c64df
Author: Gwendal Grignou <gwendal at chromium.org>
Date: Thu Jan 19 18:30:21 2017 -0800
ec/google/chromeec: Add support for tablet mode switch driver
Add a new driver GOOG0006 to report tablet switch
to user space.
On glados based convertible, check that with a new kernel driver (cros_ec_tbmc)
evtest collect tablet switch changes.
Change-Id: I6821eaac1feb6c182bc973aaa2f747e687715afb
Signed-off-by: Gwendal Grignou <gwendal at chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/430951
Reviewed-by: Duncan Laurie <dlaurie at google.com>
---
src/ec/google/chromeec/acpi/ec.asl | 7 ++++++
src/ec/google/chromeec/acpi/tbmc.asl | 29 ++++++++++++++++++++++
src/mainboard/google/eve/ec.h | 6 ++++-
.../reef/variants/baseboard/include/baseboard/ec.h | 8 ++++--
4 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl
index b182766..a40d0ac 100644
--- a/src/ec/google/chromeec/acpi/ec.asl
+++ b/src/ec/google/chromeec/acpi/ec.asl
@@ -322,6 +322,7 @@ Device (EC0)
Notify (CREC, 0x80)
}
+#ifdef EC_ENABLE_TABLET_EVENT
// TABLET mode switch Event
Method (_Q1D, 0, NotSerialized)
{
@@ -329,7 +330,9 @@ Device (EC0)
If (CondRefOf (\_SB.DPTF.TPET)) {
\_SB.DPTF.TPET()
}
+ Notify (TBMC, 0x80)
}
+#endif
/*
* Dynamic Platform Thermal Framework support
@@ -478,4 +481,8 @@ Device (EC0)
#ifdef EC_ENABLE_PD_MCU_DEVICE
#include "pd.asl"
#endif
+
+#ifdef EC_ENABLE_TABLET_EVENT
+ #include "tbmc.asl"
+#endif
}
diff --git a/src/ec/google/chromeec/acpi/tbmc.asl b/src/ec/google/chromeec/acpi/tbmc.asl
new file mode 100644
index 0000000..25a27ef1b
--- /dev/null
+++ b/src/ec/google/chromeec/acpi/tbmc.asl
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google Inc.
+ *
+ * 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 (TBMC)
+{
+ Name (_HID, "GOOG0006")
+ Name (_UID, 1)
+ Name (_DDN, "Tablet Motion Control")
+ Method (TBMC)
+ {
+ If (LEqual (^^RCTM, One)) {
+ Return (0x1)
+ } Else {
+ Return (0x0)
+ }
+ }
+}
diff --git a/src/mainboard/google/eve/ec.h b/src/mainboard/google/eve/ec.h
index d0e59e1..884b105 100644
--- a/src/mainboard/google/eve/ec.h
+++ b/src/mainboard/google/eve/ec.h
@@ -35,7 +35,8 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP) |\
- EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU))
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU) |\
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE))
#define MAINBOARD_EC_SMI_EVENTS \
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED))
@@ -73,6 +74,9 @@
#define EC_ENABLE_LID_SWITCH
#define EC_ENABLE_WAKE_PIN GPE_EC_WAKE
+/* Enable Tablet switch */
+#define EC_ENABLE_TABLET_EVENT
+
#define SIO_EC_MEMMAP_ENABLE /* EC Memory Map Resources */
#define SIO_EC_HOST_ENABLE /* EC Host Interface Resources */
#define SIO_EC_ENABLE_PS2K /* Enable PS/2 Keyboard */
diff --git a/src/mainboard/google/reef/variants/baseboard/include/baseboard/ec.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/ec.h
index 87c127c..47b193f 100644
--- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/ec.h
+++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/ec.h
@@ -34,7 +34,8 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_MKBP) |\
- EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU))
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU) |\
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_MODE_CHANGE))
#define MAINBOARD_EC_SMI_EVENTS \
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED))
@@ -67,7 +68,10 @@
/* Enable LID switch and provide wake pin for EC */
#define EC_ENABLE_LID_SWITCH
-#define EC_ENABLE_WAKE_PIN GPE_EC_WAKE
+#define EC_ENABLE_WAKE_PIN GPE_EC_WAKE
+
+/* Enable Tablet switch */
+#define EC_ENABLE_TABLET_EVENT
#define SIO_EC_MEMMAP_ENABLE /* EC Memory Map Resources */
#define SIO_EC_HOST_ENABLE /* EC Host Interface Resources */
More information about the coreboot-gerrit
mailing list