From 6c1c73ed078a93fd5570b49f0bb7b013f7321296 Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Thu, 2 Jul 2020 17:35:12 +0800 Subject: asurada: enable usb ports power control BUG=b:150341440 TEST=`usbchargemode 0 on/off` BRANCH=master Signed-off-by: Ting Shen Change-Id: I263fc80259cd091af1a97644af48bc580ae2cf71 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2278721 Reviewed-by: Ting Shen Tested-by: Ting Shen Commit-Queue: Ting Shen --- board/asurada/board.c | 6 ++++++ board/asurada/board.h | 4 ++++ board/asurada/gpio.inc | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/board/asurada/board.c b/board/asurada/board.c index c6d38f492f..0d02a96f2d 100644 --- a/board/asurada/board.c +++ b/board/asurada/board.c @@ -370,6 +370,12 @@ static int board_ps8743_mux_set(const struct usb_mux *me, return ps8743_write(me, PS8743_REG_MODE, reg); } +/* USB-A */ +const int usb_port_enable[] = { + GPIO_EN_PP5000_USB_A0_VBUS, +}; +BUILD_ASSERT(ARRAY_SIZE(usb_port_enable) == USB_PORT_COUNT); + /* USB Mux */ const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { diff --git a/board/asurada/board.h b/board/asurada/board.h index dde2f7ebeb..a481822d68 100644 --- a/board/asurada/board.h +++ b/board/asurada/board.h @@ -191,6 +191,10 @@ #undef CONFIG_UART_TX_BUF_SIZE #define CONFIG_UART_TX_BUF_SIZE 4096 +/* USB-A */ +#define CONFIG_USB_PORT_POWER_DUMB +#define USB_PORT_COUNT 1 + /* GPIO name remapping */ #define GPIO_EN_HDMI_PWR GPIO_EC_X_GPIO1 #define GPIO_USB_C1_FRS_EN GPIO_EC_X_GPIO1 diff --git a/board/asurada/gpio.inc b/board/asurada/gpio.inc index 2f70ef813f..6c6bb849e3 100644 --- a/board/asurada/gpio.inc +++ b/board/asurada/gpio.inc @@ -75,6 +75,7 @@ GPIO(EC_INT_L, PIN(E, 6), GPIO_ODR_HIGH) /* EC_AP_INT_ODL */ /* USB and USBC Signals */ GPIO(EC_DPBRDG_HPD_ODL, PIN(J, 0), GPIO_ODR_HIGH) +GPIO(EN_PP5000_USB_A0_VBUS, PIN(B, 7), GPIO_OUT_LOW) /* Misc Signals */ GPIO(EC_BATT_PRES_ODL, PIN(C, 0), GPIO_INPUT) @@ -166,7 +167,6 @@ UNIMPLEMENTED_GPIO(EC_SPI_FLASH_CS_L, PIN(G, 7)) UNIMPLEMENTED_GPIO(DP_AUX_PATH_SEL, PIN(G, 0)) UNIMPLEMENTED_GPIO(EN_PP3000_SD_U, PIN(G, 1)) UNIMPLEMENTED_GPIO(UART1_TX, PIN(B, 1)) /* UART_EC_TX_DEBUG_RX */ -UNIMPLEMENTED_GPIO(EN_PP5000_USB_A0_VBUS, PIN(B, 7)) UNIMPLEMENTED_GPIO(CCD_MODE_ODL, PIN(C, 4)) #undef UNIMPLEMENTED_GPIO -- cgit v1.2.1