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 */