diff options
author | johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> | 2021-05-21 15:06:06 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-03 03:13:50 +0000 |
commit | 0109dbe828adef87173c2278309e9383648543cd (patch) | |
tree | d63cefc6e566c2508b1b6e7d2f5c997a21604377 /board/cret | |
parent | 852c49f4ebe3676d02cfd5ed0450d4db87df798c (diff) | |
download | chrome-ec-0109dbe828adef87173c2278309e9383648543cd.tar.gz |
cret: Add GPIOC0 EC_ACOK_OTG for AC OTG OVP protect enable
When the Type-C AC plug-in enables charger the OTP/OVP protect
function.
BUG=b:188567172
BRANCH=dedede
TEST=Test on the proj-cret the GPIOC0 when Type-C device plug-in
is low and the Type-C AC plug-in is high
Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com>
Change-Id: Ib59fd7efc387726f4c5afb371804e6e5be311a70
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2910229
Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com>
Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/cret')
-rw-r--r-- | board/cret/board.c | 8 | ||||
-rw-r--r-- | board/cret/gpio.inc | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/board/cret/board.c b/board/cret/board.c index a11dc57796..def485c6f0 100644 --- a/board/cret/board.c +++ b/board/cret/board.c @@ -585,3 +585,11 @@ static void fw_config_tablet_mode(void) GPIO_INPUT | GPIO_PULL_DOWN); } } + +static void board_extpower(void) +{ + int extpower_present = extpower_is_present(); + + gpio_set_level(GPIO_EC_ACOK_OTG, extpower_present); +} +DECLARE_HOOK(HOOK_AC_CHANGE, board_extpower, HOOK_PRIO_DEFAULT);
\ No newline at end of file diff --git a/board/cret/gpio.inc b/board/cret/gpio.inc index 180e7f00ab..3686fa3ec3 100644 --- a/board/cret/gpio.inc +++ b/board/cret/gpio.inc @@ -128,12 +128,13 @@ ALTERNATE(PIN_MASK(3, 0x48), 0, MODULE_I2C, 0) /* I2C5 */ ALTERNATE(PIN_MASK(9, 0x01), 0, MODULE_I2C, 0) /* I2C2, I2C1 SCL */ ALTERNATE(PIN_MASK(8, 0x80), 0, MODULE_I2C, 0) /* I2C1 SDA */ +GPIO(EC_ACOK_OTG, PIN(C, 0), GPIO_OUT_LOW) /* OTG-OVP protect enable */ + /* NC pins, enable internal pull-up to avoid floating state. */ GPIO(GPIO32_NC, PIN(3, 2), GPIO_INPUT | GPIO_PULL_UP) GPIO(GPIO35_NC, PIN(3, 5), GPIO_INPUT | GPIO_PULL_UP) GPIO(GPIO57_NC, PIN(5, 7), GPIO_INPUT | GPIO_PULL_UP) GPIO(GPIO81_NC, PIN(8, 1), GPIO_INPUT | GPIO_PULL_UP) -GPIO(GPIOC0_NC, PIN(C, 0), GPIO_INPUT | GPIO_PULL_UP) GPIO(GPIOD0_NC, PIN(D, 0), GPIO_INPUT | GPIO_PULL_UP) GPIO(GPIOD1_NC, PIN(D, 1), GPIO_INPUT | GPIO_PULL_UP) GPIO(GPIOD6_NC, PIN(D, 6), GPIO_INPUT | GPIO_PULL_UP) |