From 577a7418553ab2f6198c422f33fd64907506e11a Mon Sep 17 00:00:00 2001 From: Divya Sasidharan Date: Tue, 9 May 2017 17:19:44 -0700 Subject: glkrvp: Enable USB MUX PS8743 driver Add Parade PS8743 USB Type-C Redriving Switch for USB Host / DisplayPort. BUG=b:64598680 BRANCH=glkrvp TEST=On glkrvp, Connect Apple dongle and verify mux setting with i2c read. 1. i2cxfer r 1 0x20 0 -> 0x50 (DP/USB enabled) 2. flip i2cxfer r 1 0x20 0 -> 0x54 (Flip bit enabled) Connect pluggable and verify the same. Similar testing was successful on second type-c port. Change-Id: I96ec380024eb659e071b019dd58b3c640fa1cc03 Signed-off-by: Divya Sasidharan Reviewed-on: https://chromium-review.googlesource.com/616075 Commit-Ready: Vijay P Hiremath Tested-by: Vijay P Hiremath Reviewed-by: Shawn N --- board/glkrvp/chg_usb_pd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'board/glkrvp/chg_usb_pd.c') diff --git a/board/glkrvp/chg_usb_pd.c b/board/glkrvp/chg_usb_pd.c index fd972fd76b..097b7ee1be 100644 --- a/board/glkrvp/chg_usb_pd.c +++ b/board/glkrvp/chg_usb_pd.c @@ -10,6 +10,7 @@ #include "task.h" #include "tcpci.h" #include "system.h" +#include "usb_mux.h" #include "util.h" #define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args) @@ -29,6 +30,22 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { }; BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_COUNT); +struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { + { + .port_addr = 0x20, + .driver = &ps874x_usb_mux_driver, + }, + { + .port_addr = 0x22, + .driver = &ps874x_usb_mux_driver, + }, +}; + +/* TODO: Implement this function and move to appropriate file */ +void usb_charger_set_switches(int port, enum usb_switch setting) +{ +} + static int board_charger_port_is_sourcing_vbus(int port) { int reg; -- cgit v1.2.1