summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivya Sasidharan <divya.s.sasidharan@intel.com>2018-05-01 14:24:18 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-17 19:34:53 -0700
commit160f62a60a8c36474c77fff1afa15a002f942a83 (patch)
tree07622ca93d5c6cf31cd1847977b788b74941a256
parentae6d7a30c333308a5aebdfc0b7dc012a2a50324a (diff)
downloadchrome-ec-160f62a60a8c36474c77fff1afa15a002f942a83.tar.gz
yorp: Enable tablet mode
Enables tablet mode to change screen rotation with respect to portrait / landscape mode. BUG=b:78898771 BRANCH=None TEST=make buildall -j Change-Id: Ib959daee5b2dfa24b0a31e6bbf91f238d251abd0 Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1038605 Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com> Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--board/yorp/board.c9
-rw-r--r--board/yorp/board.h4
-rw-r--r--board/yorp/gpio.inc6
3 files changed, 19 insertions, 0 deletions
diff --git a/board/yorp/board.c b/board/yorp/board.c
index 2606bdb1a3..2b062171cd 100644
--- a/board/yorp/board.c
+++ b/board/yorp/board.c
@@ -31,6 +31,7 @@
#include "power_button.h"
#include "switch.h"
#include "system.h"
+#include "tablet_mode.h"
#include "temp_sensor.h"
#include "thermistor.h"
#include "tcpci.h"
@@ -305,6 +306,14 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
/* This callback disables keyboard when convertibles are fully open */
void lid_angle_peripheral_enable(int enable)
{
+ /*
+ * If the lid is in tablet position via other sensors,
+ * ignore the lid angle, which might be faulty then
+ * disable keyboard.
+ */
+ if (tablet_get_mode())
+ enable = 0;
+
keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
}
#endif
diff --git a/board/yorp/board.h b/board/yorp/board.h
index 9470cb037b..85fa2130c2 100644
--- a/board/yorp/board.h
+++ b/board/yorp/board.h
@@ -38,6 +38,10 @@
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
+#define CONFIG_TABLET_MODE
+#define CONFIG_TABLET_SWITCH
+#define TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
+
#define CONFIG_TEMP_SENSOR
#define CONFIG_THERMISTOR_NCP15WB
diff --git a/board/yorp/gpio.inc b/board/yorp/gpio.inc
index 826542cc79..5b16c12efc 100644
--- a/board/yorp/gpio.inc
+++ b/board/yorp/gpio.inc
@@ -14,6 +14,12 @@ GPIO_INT(LID_OPEN, PIN(D, 2), GPIO_INT_BOTH |
GPIO_INT(POWER_BUTTON_L, PIN(0, 1), GPIO_INT_BOTH, power_button_interrupt) /* EC_PWR_BTN_ODL */
GPIO_INT(AC_PRESENT, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_interrupt) /* ACOK_OD */
+/*
+ * Active = Low, Off = High for HGDEDM GMR sensor,
+ * (b/79779455) rename TABLET_MODE to TABLET_MODE_L in schematics
+ */
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, tablet_mode_isr)
+
/* USB-C interrupts */
GPIO_INT(USB_C0_PD_INT_ODL, PIN(6, 1), GPIO_INT_FALLING, tcpc_alert_event)
GPIO_INT(USB_C1_PD_INT_ODL, PIN(F, 5), GPIO_INT_FALLING, tcpc_alert_event)