diff options
author | Denis Brockus <dbrockus@chromium.org> | 2020-01-06 11:11:05 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-09 19:24:10 +0000 |
commit | a6591e9d5c7caa04f94e604d8a649d9f8e6d5b5b (patch) | |
tree | 485aa454f6b06323d001ff04362dc01d25162fd9 /baseboard | |
parent | 50b67463387d99b1bd0a9a0214d023b9cbe494ae (diff) | |
download | chrome-ec-a6591e9d5c7caa04f94e604d8a649d9f8e6d5b5b.tar.gz |
zork: add DP1_HPD support for DB options
The GPIO to use for DP_HPD is different depending on
which retimer is being used. Added to select the
correct one.
BUG=b:139432598
BRANCH=none
TEST=make buildall -j
Change-Id: I11c30b37e148ecd958a5ef199739a90dd2b17dd8
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1988627
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/zork/baseboard.c | 14 | ||||
-rw-r--r-- | baseboard/zork/baseboard.h | 19 |
2 files changed, 21 insertions, 12 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c index e8d483487c..002d11d0b6 100644 --- a/baseboard/zork/baseboard.c +++ b/baseboard/zork/baseboard.c @@ -471,18 +471,12 @@ struct usb_mux usb_muxes[] = { }; BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); -enum zork_c1_retimer { - C1_RETIMER_UNKNOWN, - C1_RETIMER_PS8802, - C1_RETIMER_PS8818, -}; - -static enum zork_c1_retimer zork_c1_retimer = C1_RETIMER_UNKNOWN; - /* - * To support both OPT1 DB with PS8818 retimer, and OPT3 DB with PS8802 retimer, - * try both, and remember the first one that succeeds. + * To support both OPT1 DB with PS8818 retimer, and OPT3 DB with PS8802 + * retimer, Try both, and remember the first one that succeeds. */ +enum zork_c1_retimer zork_c1_retimer = C1_RETIMER_UNKNOWN; + static int zork_c1_set_mux(int port, mux_state_t mux_state) { int rv = EC_ERROR_UNKNOWN; diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h index 1ed4bee22b..58d19f86cb 100644 --- a/baseboard/zork/baseboard.h +++ b/baseboard/zork/baseboard.h @@ -280,6 +280,23 @@ enum sensor_id { SENSOR_COUNT, }; +/* Private + * Main intent is to indicate the retimer type attached + * but is also needed to determine the HPD from the port + */ +enum zork_c1_retimer { + C1_RETIMER_UNKNOWN, + C1_RETIMER_PS8802, + C1_RETIMER_PS8818, +}; +extern enum zork_c1_retimer zork_c1_retimer; + +#define PORT_TO_HPD(port) ((port == 0) \ + ? GPIO_USB_C0_HPD \ + : (zork_c1_retimer == C1_RETIMER_PS8802) \ + ? GPIO_DP1_HPD \ + : GPIO_DP2_HPD) + /* * Matrix to rotate accelerators into the standard reference frame. The default * is the identity which is correct for the reference design. Variations of @@ -314,8 +331,6 @@ void board_update_sensor_config_from_sku(void); int board_tcpc_fast_role_swap_enable(int port, int enable); #endif -#define PORT_TO_HPD(port) ((port) ? GPIO_DP2_HPD : GPIO_USB_C0_HPD) - #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BASEBOARD_H */ |