diff options
Diffstat (limited to 'board/dratini')
-rw-r--r-- | board/dratini/board.c | 22 | ||||
-rw-r--r-- | board/dratini/gpio.inc | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/board/dratini/board.c b/board/dratini/board.c index 4aca0c3938..f109379767 100644 --- a/board/dratini/board.c +++ b/board/dratini/board.c @@ -164,11 +164,33 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +/* Set aux switch to 0xc when CCD enabled on port C0 */ +static int board_anx7447_mux_set_c0(const struct usb_mux *me, + mux_state_t mux_state) +{ + int port = me->usb_port; + int rv = EC_SUCCESS; + + if (port != USB_PD_PORT_TCPC_0) + return rv; + + if (gpio_get_level(GPIO_CCD_MODE_ODL)) + return rv; + + CPRINTS("C%d: set AUX_SW_SEL=0x%x", port, 0xc); + rv = tcpc_write(port, ANX7447_REG_TCPC_AUX_SWITCH, 0xc); + if (rv) + CPRINTS("C%d: Setting AUX_SW_SEL failed", port); + + return rv; +} + const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { [USB_PD_PORT_TCPC_0] = { .mux = &(const struct usb_mux) { .usb_port = USB_PD_PORT_TCPC_0, .driver = &anx7447_usb_mux_driver, + .board_set = &board_anx7447_mux_set_c0, .hpd_update = &anx7447_tcpc_update_hpd_status, }, }, diff --git a/board/dratini/gpio.inc b/board/dratini/gpio.inc index 654a3ae4d0..bf1a8a431c 100644 --- a/board/dratini/gpio.inc +++ b/board/dratini/gpio.inc @@ -79,6 +79,9 @@ GPIO(USB_C1_TCPC_RST_ODL, PIN(3, 2), GPIO_ODR_HIGH) GPIO(EN_USB_A_5V, PIN(3, 5), GPIO_OUT_LOW) GPIO(EN_USB_A_LOW_PWR_OD, PIN(9, 4), GPIO_OUT_LOW) +/* CCD mode line*/ +GPIO(CCD_MODE_ODL, PIN(E, 5), GPIO_INPUT) + /* Misc Signals */ GPIO(EC_BATT_PRES_ODL, PIN(E, 1), GPIO_INPUT) GPIO(LED_AMBER_C0_L, PIN(C, 4), GPIO_OUT_HIGH) /* Amber C0 port */ |