diff options
-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) |