From abd72bf6f8fbcfc8f7d6c80e1e807dd0e6248f1b Mon Sep 17 00:00:00 2001 From: "amber.chen" Date: Tue, 27 Apr 2021 14:39:16 +0800 Subject: boten: add USB-A power enable and disable Enable CONFIG_USB_PORT_POWER_DUMB for enabling/disabling charging from USB-A ports. This change also enables disables the USB1 low power limit by default BUG=b:182753927 BRANCH=dedede TEST=make -j BOARD=boten TEST=Run "test_that -b dedede firmware_ECUsbPorts" Signed-off-by: amber.chen Change-Id: I0d9721469cdd9744f24c36da3cf6d9185e46e630 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2852365 Reviewed-by: Diana Z Reviewed-by: Henry Sun Commit-Queue: Aseda Aboagye --- board/boten/board.c | 5 +++++ board/boten/board.h | 4 ++++ board/boten/gpio.inc | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'board/boten') diff --git a/board/boten/board.c b/board/boten/board.c index 274dc4e521..dae2e74308 100644 --- a/board/boten/board.c +++ b/board/boten/board.c @@ -211,6 +211,11 @@ const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; +/* USB-A charging control */ +const int usb_port_enable[USB_PORT_COUNT] = { + GPIO_EN_USB_A0_VBUS, +}; + void board_init(void) { gpio_enable_interrupt(GPIO_USB_C0_INT_ODL); diff --git a/board/boten/board.h b/board/boten/board.h index d0d93a952a..3976063373 100644 --- a/board/boten/board.h +++ b/board/boten/board.h @@ -90,6 +90,10 @@ /* USB Mux */ #define CONFIG_USB_MUX_IT5205 +/* USB Type A Features */ +#define USB_PORT_COUNT 1 +#define CONFIG_USB_PORT_POWER_DUMB + #ifndef __ASSEMBLER__ #include "gpio_signal.h" diff --git a/board/boten/gpio.inc b/board/boten/gpio.inc index eaccd0b8ae..afd17c3da0 100644 --- a/board/boten/gpio.inc +++ b/board/boten/gpio.inc @@ -80,7 +80,7 @@ GPIO(EC_I2C_USB_C0_SCL, PIN(A, 4), GPIO_INPUT) GPIO(EC_I2C_USB_C0_SDA, PIN(A, 5), GPIO_INPUT) /* USB pins */ -GPIO(EN_USB_A0_VBUS, PIN(L, 6), GPIO_OUT_HIGH) +GPIO(EN_USB_A0_VBUS, PIN(L, 6), GPIO_OUT_LOW) GPIO(EN_USB_A1_VBUS, PIN(E, 6), GPIO_OUT_LOW) GPIO(EC_AP_USB_C0_HPD, PIN(L, 4), GPIO_OUT_LOW) GPIO(EC_AP_USB_C1_HDMI_HPD, PIN(K, 7), GPIO_OUT_LOW) -- cgit v1.2.1