From 50e52e2182a09eb862e5a0b4cbb25d052c94364d Mon Sep 17 00:00:00 2001 From: Dino Li Date: Wed, 8 Aug 2018 16:14:02 +0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1163585 Reviewed-by: Jett Rink --- board/bip/board.c | 12 ++++++++++++ board/bip/gpio.inc | 11 +++++++++++ 2 files changed, 23 insertions(+) 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) -- cgit v1.2.1