summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2015-11-23 14:29:13 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-24 11:02:50 -0800
commitfeb63bec886ccd0abcb8961717ec9911fd7948a3 (patch)
tree1140453f19999dd5d5fdd9939b9e4b6b706fc02c
parent3df2228c147728b516e85f8d010b0905be182045 (diff)
downloadchrome-ec-feb63bec886ccd0abcb8961717ec9911fd7948a3.tar.gz
chell: Apply USB EQ settings to PS8740 USB mux
Apply the recommended USB EQ settings for Tx and Rx channel loss compensation to the PS8740 USB mux chip. This is called after the driver is initialized and sets up the chip for the first time. BUG=chrome-os-partner:47074 BRANCH=none TEST=build and boot on chell, read back registers to verify > i2cxfer r 1 0x34 0x32 0x60 [96] > i2cxfer r 1 0x34 0x3b 0x60 [96] > i2cxfer r 1 0x20 0x32 0x60 [96] > i2cxfer r 1 0x20 0x3b 0x60 [96] Change-Id: I95334be9eed2858864787500a7483fa043947148 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/313748 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/chell/board.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/board/chell/board.c b/board/chell/board.c
index 98f8962409..6c31a05dc8 100644
--- a/board/chell/board.c
+++ b/board/chell/board.c
@@ -20,6 +20,7 @@
#include "keyboard_scan.h"
#include "lid_switch.h"
#include "pi3usb9281.h"
+#include "ps8740.h"
#include "power.h"
#include "power_button.h"
#include "pwm.h"
@@ -149,14 +150,26 @@ struct pi3usb9281_config pi3usb9281_chips[] = {
BUILD_ASSERT(ARRAY_SIZE(pi3usb9281_chips) ==
CONFIG_USB_SWITCH_PI3USB9281_CHIP_COUNT);
+static int ps8740_tune_mux(const struct usb_mux *mux)
+{
+ /* Apply same USB EQ settings to both Type-C mux */
+ ps8740_tune_usb_eq(mux->port_addr,
+ PS8740_USB_EQ_TX_6_5_DB,
+ PS8740_USB_EQ_RX_14_3_DB);
+
+ return EC_SUCCESS;
+}
+
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
{
.port_addr = 0x34,
.driver = &ps8740_usb_mux_driver,
+ .board_init = &ps8740_tune_mux,
},
{
.port_addr = 0x20,
.driver = &ps8740_usb_mux_driver,
+ .board_init = &ps8740_tune_mux,
}
};