summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2018-02-09 15:41:19 -0700
committerDaisuke Nojiri <dnojiri@chromium.org>2018-02-19 10:33:13 -0800
commit928a9df2c4f7d51db31de1618d0e072cddf70cf6 (patch)
treec215b05095f08177586291a1d5e5b6eb33483900
parent3f452c0d1412738539908ce86702368084ba27f1 (diff)
downloadchrome-ec-928a9df2c4f7d51db31de1618d0e072cddf70cf6.tar.gz
grunt: Turn PP1800_SENSOR off in S5
Disable sensor power (lid accel, gyro) in G3+S5. Enable it in S3+S0. We want it on in S3 for calculating the lid angle (needed on convertibles to disable resume from keyboard in tablet mode). BUG=b:72741289 BRANCH=none TEST=GPIO_EN_PP1800_SENSOR =0 in G3+S5 and =1 in S3+S0 Change-Id: I043b880b9fbd44242df0d2ac01c92a066d6b4377 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/912452 Reviewed-by: Lann Martin <lannm@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--board/grunt/board.c18
-rw-r--r--board/grunt/gpio.inc2
2 files changed, 19 insertions, 1 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c
index a5ad367919..2154fc8172 100644
--- a/board/grunt/board.c
+++ b/board/grunt/board.c
@@ -237,6 +237,24 @@ static void board_chipset_resume(void)
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
+static void board_chipset_startup(void)
+{
+ /*
+ * Enable sensor power (lid accel, gyro) in S3 for calculating the lid
+ * angle (needed on convertibles to disable resume from keyboard in
+ * tablet mode).
+ */
+ gpio_set_level(GPIO_EN_PP1800_SENSOR, 1);
+}
+DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT);
+
+static void board_chipset_shutdown(void)
+{
+ /* Disable sensor power (lid accel, gyro) in S5. */
+ gpio_set_level(GPIO_EN_PP1800_SENSOR, 0);
+}
+DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
+
/**
* Power on (or off) a single TCPC.
* minimum on/off delays are included.
diff --git a/board/grunt/gpio.inc b/board/grunt/gpio.inc
index 11f3b49dae..ce93325d96 100644
--- a/board/grunt/gpio.inc
+++ b/board/grunt/gpio.inc
@@ -26,7 +26,7 @@ GPIO_INT(USB_C0_CABLE_DET, PIN(3, 7), GPIO_INT_RISING, anx74xx_cable_det_inter
GPIO_INT(6AXIS_INT_L, PIN(8, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi160_interrupt)
GPIO(EN_PWR_A, PIN(E, 2), GPIO_OUT_HIGH) /* Enable Power */
-GPIO(EN_PP1800_SENSOR, PIN(6, 7), GPIO_OUT_HIGH) /* Enable Power */
+GPIO(EN_PP1800_SENSOR, PIN(6, 7), GPIO_OUT_LOW) /* Enable Power */
GPIO(ENABLE_BACKLIGHT_L, PIN(D, 3), GPIO_OUT_HIGH) /* Enable Backlight */
GPIO(PCH_RSMRST_L, PIN(C, 2), GPIO_OUT_LOW) /* RSMRST# to SOC */
GPIO(PCH_PWRBTN_L, PIN(C, 1), GPIO_OUT_HIGH) /* Power Button to SOC */