diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2018-08-08 16:14:02 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-16 04:25:52 -0700 |
commit | 50e52e2182a09eb862e5a0b4cbb25d052c94364d (patch) | |
tree | 9eb7203d25181b3caa1e0ac81be6f5a54efc3efb | |
parent | 4a4e2c71a0f6aaa50e0728922f84a7d54c14380a (diff) | |
download | chrome-ec-50e52e2182a09eb862e5a0b4cbb25d052c94364d.tar.gz |
bip: config NC pins
This CL enables internal pull-down for unused pins to prevent
leakage current caused by floating state.
Disable keyboard scan module by setting KSO/KSI pins as GPIO input
in hibernate.
BUG=b:111006203
BRANCH=none
TEST=Check power consumption drops in hibernate.
Change-Id: I7e383153aa61ff939b9bc709fc6672718d9ec5fc
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/1163585
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | board/bip/board.c | 12 | ||||
-rw-r--r-- | board/bip/gpio.inc | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/board/bip/board.c b/board/bip/board.c index 697ad48f0d..8095b7db03 100644 --- a/board/bip/board.c +++ b/board/bip/board.c @@ -98,6 +98,18 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); +void board_hibernate_late(void) +{ + /* + * Set KSO/KSI pins to GPIO input function to disable keyboard scan + * while hibernating. This also prevent leakage current caused + * by internal pullup of keyboard scan module. + */ + gpio_set_flags_by_mask(GPIO_KSO_H, 0xff, GPIO_INPUT); + gpio_set_flags_by_mask(GPIO_KSO_L, 0xff, GPIO_INPUT); + gpio_set_flags_by_mask(GPIO_KSI, 0xff, GPIO_INPUT); +} + /******************************************************************************/ /* SPI devices */ /* TODO(b/75972988): Fill out correctly (SPI FLASH) */ diff --git a/board/bip/gpio.inc b/board/bip/gpio.inc index f3d6306d3c..f9cd44ca74 100644 --- a/board/bip/gpio.inc +++ b/board/bip/gpio.inc @@ -110,6 +110,17 @@ GPIO(USB2_OTG_ID, PIN(I, 2), GPIO_ODR_LOW | GPIO(BAT_LED_ORANGE, PIN(A, 6), GPIO_OUT_LOW) /* LED_1_L NOTE: actually active high, but labeled _L in the schematics */ GPIO(BAT_LED_BLUE, PIN(A, 3), GPIO_OUT_LOW) /* LED_2_L NOTE: actually active high, but labeled _L in the schematics */ +/* NC pins, enable internal pull-down to avoid floating state. */ +GPIO(GPIOB2_NC, PIN(B, 2), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOE6_NC, PIN(E, 6), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOG0_NC, PIN(G, 0), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOG1_NC, PIN(G, 1), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOH0_NC, PIN(H, 0), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOL2_NC, PIN(L, 2), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOL3_NC, PIN(L, 3), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOL6_NC, PIN(L, 6), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOM6_NC, PIN(M, 6), GPIO_INPUT | GPIO_PULL_DOWN) + /* Not implemented in hardware yet */ UNIMPLEMENTED(KB_BL_PWR_EN) |