summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxiong.huang <xiong.huang@bitland.corp-partner.google.com>2019-08-07 19:06:02 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-14 12:17:18 +0000
commitc48c1b89f893caa2d064a9f8fc20062a997701ef (patch)
treec3160709398d0616faf9ff5499006980e7659a31
parente2d08fb1da6b3236db844b61a5ee55194706c48a (diff)
downloadchrome-ec-c48c1b89f893caa2d064a9f8fc20062a997701ef.tar.gz
kodama: Add usb mux IT5205 driver
Add usb mux IT5205 driver which helps Type-C DP display normally. IT6505 and FUSB42 keep in one direction, IT5205 control flipping. BUG=b:136977971, b:138686359 BRANCH=master TEST=HDMI in dongle display normally with positive and negative insertion. Cq-Depend:chromium:1730377 Change-Id: Icb587480d0a49f4f3f16e5367da5682f6627f3da Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741595 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--board/kodama/board.c4
-rw-r--r--board/kodama/board.h3
-rw-r--r--board/kodama/gpio.inc4
3 files changed, 8 insertions, 3 deletions
diff --git a/board/kodama/board.c b/board/kodama/board.c
index 23c98fde71..2f1c289e2c 100644
--- a/board/kodama/board.c
+++ b/board/kodama/board.c
@@ -17,6 +17,7 @@
#include "driver/charger/rt946x.h"
#include "driver/sync.h"
#include "driver/tcpm/mt6370.h"
+#include "driver/usb_mux/it5205.h"
#include "extpower.h"
#include "gpio.h"
#include "hooks.h"
@@ -93,7 +94,8 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
{
- .driver = &virtual_usb_mux_driver,
+ .port_addr = IT5205_I2C_ADDR1_FLAGS,
+ .driver = &it5205_usb_mux_driver,
.hpd_update = &virtual_hpd_update,
},
};
diff --git a/board/kodama/board.h b/board/kodama/board.h
index 4b57d12c9c..aa73d04da2 100644
--- a/board/kodama/board.h
+++ b/board/kodama/board.h
@@ -21,6 +21,8 @@
#define CONFIG_VOLUME_BUTTONS
+#define CONFIG_USB_MUX_IT5205
+
/* Battery */
#ifdef BOARD_KRANE
#define BATTERY_DESIRED_CHARGING_CURRENT 3500 /* mA */
@@ -47,6 +49,7 @@
/* I2C ports */
#define I2C_PORT_CHARGER 0
#define I2C_PORT_TCPC0 0
+#define I2C_PORT_USB_MUX 0
#define I2C_PORT_BATTERY 1
#define I2C_PORT_VIRTUAL_BATTERY I2C_PORT_BATTERY
#define I2C_PORT_ACCEL 1
diff --git a/board/kodama/gpio.inc b/board/kodama/gpio.inc
index ebf6e67ee5..c648d6b5a7 100644
--- a/board/kodama/gpio.inc
+++ b/board/kodama/gpio.inc
@@ -72,7 +72,7 @@ GPIO(EC_SKU_ID, PIN(B, 0), GPIO_ANALOG)
/* Other input pins */
GPIO(WP_L, PIN(C, 8), GPIO_INPUT) /* EC_FLASH_WP_ODL */
GPIO(BOOT0, PIN(F, 11), GPIO_INPUT)
-GPIO(CCD_MODE_ODL, PIN(A, 1), GPIO_INPUT)
+GPIO(CCD_MODE_ODL, PIN(A, 5), GPIO_INPUT)
/* Other output pins */
GPIO(ENTERING_RW, PIN(C, 6), GPIO_ODR_HIGH) /* EC_ENTERING_RW_ODL */
@@ -81,7 +81,7 @@ GPIO(EC_BOARD_ID_EN_L, PIN(C, 15), GPIO_ODR_HIGH) /* EC_BOARD_ID_EN_ODL */
GPIO(USB_C0_DP_POLARITY, PIN(C, 14), GPIO_OUT_LOW)
GPIO(USB_C0_HPD_OD, PIN(F, 1), GPIO_ODR_LOW)
GPIO(BOOTBLOCK_EN_L, PIN(C, 1), GPIO_ODR_HIGH)
-GPIO(USB_C0_DP_OE_L, PIN(A, 5), GPIO_OUT_HIGH)
+GPIO(USB_C0_DP_OE_L, PIN(A, 1), GPIO_OUT_HIGH)
GPIO(EN_PP3300_POGO, PIN(A, 13), GPIO_OUT_LOW)
GPIO(EN_POGO_CHARGE_L, PIN(B, 6), GPIO_OUT_HIGH)
GPIO(BC12_DET_EN, PIN(C, 4), GPIO_OUT_LOW)