summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames_chao <james_chao@asus.com>2015-12-29 21:46:18 +0800
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2015-12-29 22:35:15 +0000
commit12d9fe9eb8fb7b07ead123276ab047c1a1988660 (patch)
tree52cc871880e30a66ab631599e1494d3f0abd49db
parentad0ea04a5f6b373f8998207e51dd63502f3e6356 (diff)
downloadchrome-ec-12d9fe9eb8fb7b07ead123276ab047c1a1988660.tar.gz
Terra: keep GPIO_SMC_SHUTDOWN pull low when enter hibernate
BUG=chrome-os-partner:48799 BRANCH=firmware-strago-7287.B TEST=Enter the hibernate mode in ac mode, press the power button Change-Id: Idbca1cd1927ce9668df6957c100d60c40535180c Signed-off-by: james_chao <james_chao@asus.com> Reviewed-on: https://chromium-review.googlesource.com/320057 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/terra/board.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/board/terra/board.c b/board/terra/board.c
index 3e1f7b1c3b..2fbcabd5a8 100644
--- a/board/terra/board.c
+++ b/board/terra/board.c
@@ -89,3 +89,20 @@ struct ec_thermal_config thermal_params[] = {
{{0, 0, 0}, 0, 0}, /* Battery Sensor */
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+
+uint32_t board_get_gpio_hibernate_state(uint32_t port, uint32_t pin)
+{
+ int i;
+ const uint32_t out_low_gpios[][2] = {
+ GPIO_TO_PORT_MASK_PAIR(GPIO_SMC_SHUTDOWN),
+ };
+
+ /* Some GPIOs should be driven low in hibernate */
+ for (i = 0; i < ARRAY_SIZE(out_low_gpios); ++i) {
+ if (out_low_gpios[i][0] == port && out_low_gpios[i][1] == pin)
+ return GPIO_OUTPUT | GPIO_LOW;
+ }
+
+ /* Other GPIOs should be put in a low-power state */
+ return GPIO_INPUT | GPIO_PULL_UP;
+}