diff options
Diffstat (limited to 'board/herobrine_npcx9/hibernate.c')
-rw-r--r-- | board/herobrine_npcx9/hibernate.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/board/herobrine_npcx9/hibernate.c b/board/herobrine_npcx9/hibernate.c new file mode 100644 index 0000000000..f6ebf462aa --- /dev/null +++ b/board/herobrine_npcx9/hibernate.c @@ -0,0 +1,24 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "gpio.h" + +void board_hibernate_late(void) +{ + /* Set the hibernate GPIO to turn off the rails */ + gpio_set_level(GPIO_HIBERNATE_L, 0); +} + +void board_hibernate(void) +{ + /* + * Sensors are unpowered in hibernate. Apply PD to the + * interrupt lines such that they don't float. + */ + gpio_set_flags(GPIO_ACCEL_GYRO_INT_L, + GPIO_INPUT | GPIO_PULL_DOWN); + gpio_set_flags(GPIO_LID_ACCEL_INT_L, + GPIO_INPUT | GPIO_PULL_DOWN); +} |