From 1c19d95208187998bab51c797f45f688f4bfff1d Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Mon, 8 Feb 2021 21:14:37 -0800 Subject: quiche: Add board_set method for ps8822 mux for rx dp eq This CL adds a method to change Rx DP gain from 12 to 20 dB. This value was requested by the MST vendor. BUG=b:178656398 BRANCH=None TEST=verifed register setting when DP mode is active on quiche Signed-off-by: Scott Collyer Change-Id: I6355da1ad88c3e1f29f07ca036adbf8fc9b908ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2686919 Commit-Queue: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Aseda Aboagye Reviewed-by: Diana Z --- board/quiche/board.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/board/quiche/board.c b/board/quiche/board.c index 0abb6d76c2..05fc76d132 100644 --- a/board/quiche/board.c +++ b/board/quiche/board.c @@ -157,6 +157,22 @@ struct ppc_config_t ppc_chips[] = { #endif #ifdef SECTION_IS_RW +/* + * PS8802 set mux board tuning. + * Adds in board specific gain and DP lane count configuration + */ +static int board_ps8822_mux_set(const struct usb_mux *me, + mux_state_t mux_state) +{ + int rv = EC_SUCCESS; + + /* DP specific config */ + if (mux_state & USB_PD_MUX_DP_ENABLED) + rv = ps8822_set_dp_rx_eq(me, PS8822_DPEQ_LEVEL_UP_20DB); + + return rv; +} + /* TCPCs */ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { [USB_PD_PORT_HOST] = { @@ -179,6 +195,7 @@ const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { .i2c_port = I2C_PORT_I2C1, .i2c_addr_flags = PS8822_I2C_ADDR3_FLAG, .driver = &ps8822_usb_mux_driver, + .board_set = &board_ps8822_mux_set, }, [USB_PD_PORT_DP] = { .usb_port = USB_PD_PORT_DP, -- cgit v1.2.1