summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-11-19 10:38:01 -0800
committerCommit Bot <commit-bot@chromium.org>2021-11-23 22:33:36 +0000
commitc956e39119aeaea16584c00e95949675fe6620e0 (patch)
treeb5e41cfedba9ee0b25ba73480cce2c9db5ade069
parent880291e559f418194324c16ab6f6a1951d4b542b (diff)
downloadchrome-ec-c956e39119aeaea16584c00e95949675fe6620e0.tar.gz
servo_v4p1: Add DP Rx EQ .board_set method for TUSB1064
This CL adds a .board_set method for the TUSB1064 usb_mux config to control the display port rx EQ gain. Previously, this gain was being applied in the driver init() function. The driver has been modified to remove this default gain setting. So now the gain must be selected by the boards that use the TUSB1064. BUG=b:206059703 BRANCH=none TEST=make -j BOARD=servo_v4p1 Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I5e2ce514d11b65b23afb7e59805c4184cffa8e24 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3291131 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/servo_v4p1/board.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/board/servo_v4p1/board.c b/board/servo_v4p1/board.c
index d9d48a42ce..385d46ef55 100644
--- a/board/servo_v4p1/board.c
+++ b/board/servo_v4p1/board.c
@@ -65,6 +65,26 @@ static void tca_evt(enum gpio_signal signal)
irq_ioexpanders();
}
+/*
+ * TUSB1064 set mux board tuning.
+ * Adds in board specific gain and DP lane count configuration
+ */
+static int board_tusb1064_dp_rx_eq_set(const struct usb_mux *me,
+ mux_state_t mux_state)
+{
+ int rv = EC_SUCCESS;
+
+ /*
+ * Apply 10dB gain. Note, this value is selected to match the gain that
+ * would be set by default if the 2 GPIO gain set pins are left
+ * floating.
+ */
+ if (mux_state & USB_PD_MUX_DP_ENABLED)
+ rv = tusb1064_set_dp_rx_eq(me, TUSB1064_DP_EQ_RX_10_0_DB);
+
+ return rv;
+}
+
const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[CHG] = { /* CHG port connected directly to USB 3.0 hub, no mux */ },
[DUT] = { /* DUT port with UFP mux */
@@ -72,6 +92,7 @@ const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
.i2c_port = I2C_PORT_MASTER,
.i2c_addr_flags = TUSB1064_I2C_ADDR10_FLAGS,
.driver = &tusb1064_usb_mux_driver,
+ .board_set = &board_tusb1064_dp_rx_eq_set,
}
};