diff options
author | Mulin Chao <mlchao@nuvoton.com> | 2018-06-07 19:27:44 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-06-29 11:38:53 -0700 |
commit | fde9042dbac2a273f5607e659b8e5a98c301e42b (patch) | |
tree | 9321c705dbbf5159f9b50e8520e5fdd1f39f7be3 /chip/npcx/gpio_chip.h | |
parent | 47a1c1a0427400d5a0f5def8f69fcb70bbb4f4e7 (diff) | |
download | chrome-ec-fde9042dbac2a273f5607e659b8e5a98c301e42b.tar.gz |
npcx: gpio: bypass for excessive power consumption on low-voltage IOs.
It was found that for npcx ec's GPIOs that support low-voltage input,
there is an excessive power consumption when they are selected to
low-voltage mode and their Vin is 1.8V.
To bypass this issue when the chip enters deep sleep where current is
important, this CL includes:
1. Disable GPIOs without ISR which are selected to 1.8V and not i2c
ports in gpio_pre_init().
2. Disable input buffer of 1.8V i2c ports before entering deep sleep.
3. Enable input buffer of 1.8V i2c ports after ec wakes up.
BRANCH=none
BUG=b:110170824
TEST=No build errors for npcx ec series. Measured power consumption on
yorp and it saved ~1.3mA current after applying this patch at S0ix. Run
stress test on poppy and no symptom found. Remove CONFIG_LOW_POWER_IDLE
in board driver and no symptom occurred on poppy and yorp.
Change-Id: Iaf66c81ca16104839734ba19492f2061113dafb3
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/1098864
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/npcx/gpio_chip.h')
-rw-r--r-- | chip/npcx/gpio_chip.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/npcx/gpio_chip.h b/chip/npcx/gpio_chip.h index b5fcec20c8..6d704a5e6a 100644 --- a/chip/npcx/gpio_chip.h +++ b/chip/npcx/gpio_chip.h @@ -11,6 +11,8 @@ #define WUI(tbl, grp, idx) ((struct npcx_wui) { .table = tbl, .group = grp, \ .bit = idx }) #define WUI_INT(tbl, grp) WUI(tbl, grp, 0) +#define WUI_NONE ((struct npcx_wui) { .table = MIWU_TABLE_COUNT, .group = 0, \ + .bit = 0 }) /* Macros to initialize the alternative and low voltage mapping table. */ #define NPCX_GPIO_NONE ((struct npcx_gpio) {.port = 0, .bit = 0, .valid = 0}) @@ -43,6 +45,9 @@ void npcx_uart2gpio(void); */ void npcx_gpio2uart(void); +/* Set input buffer of all 1.8v i2c ports. */ +void gpio_enable_1p8v_i2c_wake_up_input(int enable); + /* * Include the MIWU, alternative and low-Voltage macro functions for GPIOs * depends on Nuvoton chip series. |