diff options
author | Edward Hill <ecgh@chromium.org> | 2018-02-09 15:41:19 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-02-09 22:21:07 -0800 |
commit | 61e1151d2cdd3247a285a549ffa8fbd68d3597ca (patch) | |
tree | bc140c9c4199f60b96810feffa243cb8d316d21c | |
parent | f8da6be34b57e9c99cda56a9423a24e7045fbfc6 (diff) | |
download | chrome-ec-61e1151d2cdd3247a285a549ffa8fbd68d3597ca.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.c | 18 | ||||
-rw-r--r-- | board/grunt/gpio.inc | 2 |
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 */ |