diff options
author | Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> | 2020-10-23 14:36:14 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-27 23:51:03 +0000 |
commit | 199d959772c7822cc30dec6c7fc1511e244b067a (patch) | |
tree | 68b7f08adb155196c903807c6f28f39985d36679 /board/woomax/board.c | |
parent | ca6368b8425548e6c3bdd67a1a0095d6a84cdc27 (diff) | |
download | chrome-ec-199d959772c7822cc30dec6c7fc1511e244b067a.tar.gz |
woomax: Change OPT3 USB HPD from TCPC1 GPIO02 to EC GPIOB1.
For board version 2, the OPT3 USB HPD change to EC GPIOB1.
BUG=b:160579667
BRANCH=firmware-zork-13434.B
TEST=make BOARD=woomax
Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>
Change-Id: Ic7ea0d02bd8942779138402155e9941f36c6d9f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2494601
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'board/woomax/board.c')
-rw-r--r-- | board/woomax/board.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/board/woomax/board.c b/board/woomax/board.c index 2a88f43bf4..e70d1fcb1d 100644 --- a/board/woomax/board.c +++ b/board/woomax/board.c @@ -9,6 +9,7 @@ #include "adc_chip.h" #include "button.h" #include "cbi_ec_fw_config.h" +#include "cros_board_info.h" #include "driver/accelgyro_bmi_common.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" @@ -336,9 +337,14 @@ BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); */ int board_usbc1_retimer_inhpd = IOEX_USB_C1_HPD_IN_DB; - +static uint32_t board_ver; static void setup_fw_config(void) { + cbi_get_board_version(&board_ver); + + if (board_ver >= 2) + board_usbc1_retimer_inhpd = GPIO_USB_C1_HPD_IN_DB; + /* Enable Gyro interrupts */ gpio_enable_interrupt(GPIO_6AXIS_INT_L); @@ -530,3 +536,20 @@ void hdmi_hpd_interrupt(enum gpio_signal signal) hook_call_deferred(&hdmi_hpd_handler_data, (2 * MSEC)); } +enum gpio_signal board_usbc_port_to_hpd_gpio(int port) +{ + /* USB-C0 always uses USB_C0_HPD */ + if (port == 0) + return GPIO_USB_C0_HPD; + /* + * USB-C1 OPT3 DB use IOEX_USB_C1_HPD_IN_DB for board version 1 + * USB-C1 OPT3 DB use GPIO_USB_C1_HPD_IN_DB for board version 2 + */ + else if (ec_config_has_mst_hub_rtd2141b()) + return (board_ver >= 2) + ? GPIO_USB_C1_HPD_IN_DB + : IOEX_USB_C1_HPD_IN_DB; + + /* USB-C1 OPT1 DB use DP2_HPD. */ + return GPIO_DP2_HPD; +} |