summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjiazi Yang <Tomato_Yang@asus.com>2016-07-28 05:15:01 -0400
committerMartin Roth <martinroth@google.com>2016-08-12 18:06:53 +0200
commit51fc93fb22e3e9ed929b1196bbd4b9ea2a071ad6 (patch)
tree465e992b9c2a91b42434049df3d6129d052b718a /src
parent6359a7592619c77ea21b6ea9a94d261a3257d6d0 (diff)
chromeec/acpi: add Tablet event and EC ACPI MEM
Switch DPTF table when TABLET/NOTEBOOK mode changes 1. EC send EC_HOST_EVENT_MODE_CHANGE(29/0x1D) when mode changes 2. Host read current "physical mode" from EC ERAM BUG=chrome-os-partner:53526 BRANCH=master TEST=build glados Change-Id: I836d2b9d1a24c455c4b8d4b85f7edc19259d2f71 Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: 9506c4c07e0f713c9a22a0231bc4255f6876783f Original-Change-Id: I5a3363ff9c958decb5aed1c85fc2a1ef6670931d Original-Signed-off-by: jiazi Yang <Tomato_Yang@asus.com> Original-Signed-off-by: Shasha Zhao <Sarah_Zhao@asus.com> Original-Signed-off-by: jiazi Yang <Tomato_Yang@asus.com> Original-Reviewed-on: https://chromium-review.googlesource.com/365991 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/16151 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src')
-rw-r--r--src/ec/google/chromeec/acpi/ec.asl17
-rw-r--r--src/ec/google/chromeec/ec_commands.h9
2 files changed, 26 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl
index 13317f6d4c..84d5e32785 100644
--- a/src/ec/google/chromeec/acpi/ec.asl
+++ b/src/ec/google/chromeec/acpi/ec.asl
@@ -25,6 +25,7 @@ External (\_SB.DPTF.TEVT, MethodObj)
#ifdef DPTF_ENABLE_CHARGER
External (\_SB.DPTF.TCHG, DeviceObj)
#endif
+External (\_SB.DPTF.TPET, MethodObj)
Device (EC0)
{
@@ -52,6 +53,7 @@ Device (EC0)
PATT, 8, // Programmable Auxiliary Trip Threshold
PATC, 8, // Programmable Auxiliary Trip Commit
CHGL, 8, // Charger Current Limit
+ TBMD, 1, // Tablet mode
}
#if CONFIG_EC_GOOGLE_CHROMEEC_ACPI_MEMMAP
@@ -296,6 +298,15 @@ Device (EC0)
Notify (CREC, 0x80)
}
+ // TABLET mode switch Event
+ Method (_Q1D, 0, NotSerialized)
+ {
+ Store ("EC: TABLET mode switch Event", Debug)
+ If (CondRefOf (\_SB.DPTF.TPET)) {
+ \_SB.DPTF.TPET()
+ }
+ }
+
/*
* Dynamic Platform Thermal Framework support
*/
@@ -422,6 +433,12 @@ Device (EC0)
Store (0xFF, ^CHGL)
}
+ /* Read current Tablet mode */
+ Method (RCTM, 0, NotSerialized)
+ {
+ Return (^TBMD)
+ }
+
#include "ac.asl"
#include "battery.asl"
#include "cros_ec.asl"
diff --git a/src/ec/google/chromeec/ec_commands.h b/src/ec/google/chromeec/ec_commands.h
index 2e2a695966..4a551c2e65 100644
--- a/src/ec/google/chromeec/ec_commands.h
+++ b/src/ec/google/chromeec/ec_commands.h
@@ -327,6 +327,12 @@
#define EC_ACPI_MEM_CHARGING_LIMIT_STEP_MA 64
/* Value to disable DPTF battery charging limit */
#define EC_ACPI_MEM_CHARGING_LIMIT_DISABLED 0xff
+/*
+ * Report device orientation
+ * bit 0 device is tablet mode
+ */
+#define EC_ACPI_MEM_DEVICE_ORIENTATION 0x09
+#define EC_ACPI_MEM_DEVICE_TABLET_MODE 0x01
/*
* ACPI addresses 0x20 - 0xff map to EC_MEMMAP offset 0x00 - 0xdf. This data
@@ -465,6 +471,9 @@ enum host_event_code {
/* Emulate MKBP event */
EC_HOST_EVENT_MKBP = 27,
+ /* TABLET/LAPTOP mode event*/
+ EC_HOST_EVENT_MODE_CHANGE = 29,
+
/*
* The high bit of the event mask is not used as a host event code. If
* it reads back as set, then the entire event mask should be