diff options
-rw-r--r-- | board/kevin/board.c | 13 | ||||
-rw-r--r-- | board/kevin/gpio.inc | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/board/kevin/board.c b/board/kevin/board.c index 393e5527ed..32255b8ace 100644 --- a/board/kevin/board.c +++ b/board/kevin/board.c @@ -234,6 +234,19 @@ int pd_snk_is_vbus_provided(int port) static void board_init(void) { + int i; + + /* + * Connect USB data switches. + * TODO(crosbug.com/p/52639): Synchronize switch open / close with + * USB mux control. + */ + for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; ++i) + usb_charger_set_switches(i, USB_SWITCH_CONNECT); + + /* Enable charger interrupt for BC1.2 detection on attach / detach */ + gpio_enable_interrupt(GPIO_CHARGER_INT_L); + /* Sensor Init */ gpio_config_module(MODULE_SPI_MASTER, 1); spi_enable(CONFIG_SPI_ACCEL_PORT, 1); diff --git a/board/kevin/gpio.inc b/board/kevin/gpio.inc index 80da1c0683..7f45432fd9 100644 --- a/board/kevin/gpio.inc +++ b/board/kevin/gpio.inc @@ -39,6 +39,8 @@ GPIO_INT(WARM_RESET_REQ, PIN(7, 3), GPIO_INT_RISING | GPIO_PULL_DOWN, warm_reset_request_interrupt) GPIO_INT(AP_OVERTEMP, PIN(7, 4), GPIO_INT_RISING | GPIO_PULL_DOWN, overtemp_interrupt) +GPIO_INT(CHARGER_INT_L, PIN(3, 3), GPIO_INT_FALLING | GPIO_PULL_UP, + bd99955_vbus_interrupt) /* VR EN */ GPIO(AP_CORE_EN, PIN(7, 2), GPIO_OUT_LOW) @@ -104,8 +106,6 @@ GPIO(EC_BOARD_ID_EN_L, PIN(3, 5), GPIO_OUT_HIGH) GPIO(USB_DP_HPD, PIN(6, 6), GPIO_OUT_LOW) GPIO(CHARGER_RESET_L, PIN(0, 1), GPIO_OUT_HIGH | GPIO_OPEN_DRAIN) GPIO(CR50_RESET_L, PIN(0, 2), GPIO_OUT_HIGH | GPIO_OPEN_DRAIN) -/* TODO: Detect VBUS changes from charger interrupt and wake charger task. */ -GPIO(CHARGER_INT_L, PIN(3, 3), GPIO_INPUT) GPIO(EC_BATT_PRES_L, PIN(3, 4), GPIO_INPUT) GPIO(LID_360_L, PIN(3, 6), GPIO_INPUT | GPIO_SEL_1P8V) GPIO(BASE_SIXAXIS_INT_L, PIN(4, 0), GPIO_INPUT | GPIO_SEL_1P8V) |