summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-03-08 11:54:16 -0700
committerJett Rink <jettrink@chromium.org>2019-03-18 22:18:55 +0000
commit9728988f8810859c81854456ce7a5851f1d44362 (patch)
tree22db181bd177f11186e229c2b3a3b407447e7659 /board
parent53d08058ce107f0529c45f910d84e9d5de5620e6 (diff)
downloadchrome-ec-9728988f8810859c81854456ce7a5851f1d44362.tar.gz
arcada_ish: set NB_MODE_L going to EC correctly
The lid angle is being correctly calculated and compared against the AP-set lid angle and hysteresis (MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE) BRANCH=none BUG=b:122281217,b:122052438,b:122885025 TEST=verify that the gpio NB_MODE# signal from ISH to EC is getting set properly based on lid orientation (verified with gpio_set on ISH console) Change-Id: I1116bb28e4add970cfe08adb0eade66da1c05074 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1512137 Reviewed-by: Mathew King <mathewk@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/arcada_ish/board.c9
-rw-r--r--board/arcada_ish/board.h7
-rw-r--r--board/arcada_ish/gpio.inc2
3 files changed, 16 insertions, 2 deletions
diff --git a/board/arcada_ish/board.c b/board/arcada_ish/board.c
index d8fd2f24d2..189897cfdd 100644
--- a/board/arcada_ish/board.c
+++ b/board/arcada_ish/board.c
@@ -14,6 +14,7 @@
#include "i2c.h"
#include "motion_sense.h"
#include "power.h"
+#include "tablet_mode.h"
#include "task.h"
#include "gpio_list.h" /* has to be included last */
@@ -156,3 +157,11 @@ int board_idle_task(void *unused)
while (1)
task_wait_event(-1);
}
+
+static void board_tablet_mode_change(void)
+{
+ /* Update GPIO to EC letting it know that we entered tablet mode */
+ gpio_set_level(GPIO_NB_MODE_L, tablet_get_mode());
+}
+DECLARE_HOOK(HOOK_TABLET_MODE_CHANGE, board_tablet_mode_change,
+ HOOK_PRIO_DEFAULT);
diff --git a/board/arcada_ish/board.h b/board/arcada_ish/board.h
index fe5e82777a..83ddaec08d 100644
--- a/board/arcada_ish/board.h
+++ b/board/arcada_ish/board.h
@@ -45,6 +45,12 @@
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_HECI
+#define CONFIG_LID_ANGLE
+#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
+#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
+
+#define CONFIG_TABLET_MODE
+
/* Host command over HECI */
#define CONFIG_HOSTCMD_HECI
@@ -68,7 +74,6 @@
#undef CONFIG_KEYBOARD_KSO_BASE
#undef CONFIG_FLASH
#undef CONFIG_FMAP
-#undef CONFIG_LID_SWITCH
#undef CONFIG_SWITCH
/* TODO: Watch Dog is supported but temporarily removed. Currently under
* development on KBL and will be carried over to WHL.
diff --git a/board/arcada_ish/gpio.inc b/board/arcada_ish/gpio.inc
index cca0d2f885..60c8e959ae 100644
--- a/board/arcada_ish/gpio.inc
+++ b/board/arcada_ish/gpio.inc
@@ -8,7 +8,7 @@
GPIO_INT(ACCEL_GYRO_INT_L, PIN(0), GPIO_INT_FALLING | GPIO_SEL_1P8V, lsm6dsm_interrupt)
GPIO(NB_MODE_L, PIN(4), GPIO_OUT_LOW)
-GPIO(LID_CL_NB_L, PIN(5), GPIO_INPUT)
+GPIO(LID_OPEN, PIN(5), GPIO_INPUT) /* LID_CL_NB_L */
GPIO(LID_CL_TAB_L, PIN(6), GPIO_INPUT)
/*