summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@chromium.org>2018-08-15 17:24:46 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-31 00:27:54 -0700
commit35d34375fe9f4a893b01ba3a84261f6c346a9f26 (patch)
treeda6c2f07055cd4d9faf2774a74f4efd075bb1891
parent260907bf15752cef85fd89d8d5e3d2f61d4b4a8d (diff)
downloadchrome-ec-35d34375fe9f4a893b01ba3a84261f6c346a9f26.tar.gz
nocturne: switch from tablet mode to base state reporting
On these devices we can't decide whether we should go in/out tablet mode solely because base was attached or detached. Let's report the new "base attached" event so that upper layers can figure the state properly. Note that we disable CONFIG_DPTF_DEVICE_ORIENTATION switch since it requires CONFIG_TABLET mode which we disable as well. That means that EC_ACPI_MEM_DEVICE_ORIENTATION will always return '0', which should be fine, as it is used by the TBMC (Tablet Motion Control) device which is not enabled on Nocturne. Note that base attach/detach events, like tablet mode switch events, will still wake up the AP as handles base state transitions always notifies host of attach/detach events. BUG=b:73133611 BRANCH=nocturne CQ-DEPEND=CL:1183972,CL:1187120 TEST=Build and boot Change-Id: Ide0693a50f041be876f42295bccf2896a13a625c Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1180539 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--board/nocturne/base_detect.c11
-rw-r--r--board/nocturne/board.h4
2 files changed, 4 insertions, 11 deletions
diff --git a/board/nocturne/base_detect.c b/board/nocturne/base_detect.c
index dba2a542b4..9158fb26fb 100644
--- a/board/nocturne/base_detect.c
+++ b/board/nocturne/base_detect.c
@@ -17,12 +17,12 @@
*/
#include "adc.h"
+#include "base_state.h"
#include "chipset.h"
#include "common.h"
#include "console.h"
#include "gpio.h"
#include "hooks.h"
-#include "tablet_mode.h"
#include "timer.h"
#include "util.h"
@@ -103,17 +103,12 @@ static void base_detect_changed(void)
{
switch (state) {
case BASE_DETACHED:
- /* Indicate that we are in tablet mode. */
- tablet_set_mode(1);
+ base_set_state(0);
base_power_enable(0);
break;
case BASE_ATTACHED:
- /*
- * TODO(b/73133611): Note, this simple logic may suffice for
- * now, but we may have to revisit this.
- */
- tablet_set_mode(0);
+ base_set_state(1);
base_power_enable(1);
break;
diff --git a/board/nocturne/board.h b/board/nocturne/board.h
index 6a7ba8d6c4..629b8e444d 100644
--- a/board/nocturne/board.h
+++ b/board/nocturne/board.h
@@ -58,9 +58,8 @@
#define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_PRESENT_L
/* Buttons / Switches */
+#define CONFIG_BASE_ATTACHED_SWITCH
#define CONFIG_BUTTON_TRIGGERED_RECOVERY
-#define CONFIG_TABLET_MODE
-#define CONFIG_TABLET_MODE_SWITCH
#define CONFIG_VOLUME_BUTTONS
/* Charger */
@@ -111,7 +110,6 @@
#define CONFIG_CHIPSET_RESET_HOOK
#define CONFIG_CPU_PROCHOT_ACTIVE_LOW
#define CONFIG_DPTF
-#define CONFIG_DPTF_DEVICE_ORIENTATION
#define CONFIG_POWER_COMMON
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86