diff options
author | Scott Collyer <scollyer@google.com> | 2019-04-02 15:04:53 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-17 21:32:26 -0700 |
commit | a19ad262f2df67cf36d6051d1f309a9f50c2b7f3 (patch) | |
tree | 91f7e63b87c935a72adda74c0ed3838630b4ba96 /board/kohaku | |
parent | f562e995c896e32816f013b848b8ffe61c8f09cd (diff) | |
download | chrome-ec-a19ad262f2df67cf36d6051d1f309a9f50c2b7f3.tar.gz |
hatch/kohaku: Move TCPC definitions to board from baseboard
Kohaku uses PS8751 for port 0 TCPC. Therefore, the TCPC config and mux
config tables can't be common and must be moved out of baseboard into
their respective board.c files.
BUG=b:130194031
BRANCH=none
TEST=make -j buildall
Change-Id: Iea39e60d675a5ea0df346c52e78f5f472768984c
Signed-off-by: Scott Collyer <scollyer@google.com>
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1551582
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'board/kohaku')
-rw-r--r-- | board/kohaku/board.c | 30 | ||||
-rw-r--r-- | board/kohaku/board.h | 7 |
2 files changed, 37 insertions, 0 deletions
diff --git a/board/kohaku/board.c b/board/kohaku/board.c index db5d3d3399..d14a327655 100644 --- a/board/kohaku/board.c +++ b/board/kohaku/board.c @@ -14,6 +14,8 @@ #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" #include "driver/ppc/sn5s330.h" +#include "driver/tcpm/ps8xxx.h" +#include "driver/tcpm/tcpci.h" #include "ec_commands.h" #include "extpower.h" #include "fan.h" @@ -115,6 +117,34 @@ const struct pwm_t pwm_channels[] = { BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); /******************************************************************************/ +/* USB-C TPCP Configuration */ +const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { + [USB_PD_PORT_TCPC_0] = { + .i2c_host_port = I2C_PORT_TCPC0, + .i2c_slave_addr = PS8751_I2C_ADDR1, + .drv = &ps8xxx_tcpm_drv, + .flags = 0, + }, + [USB_PD_PORT_TCPC_1] = { + .i2c_host_port = I2C_PORT_TCPC1, + .i2c_slave_addr = PS8751_I2C_ADDR1, + .drv = &ps8xxx_tcpm_drv, + .flags = 0, + }, +}; + +struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { + [USB_PD_PORT_TCPC_0] = { + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + }, + [USB_PD_PORT_TCPC_1] = { + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + } +}; + +/******************************************************************************/ /* Sensors */ /* Base Sensor mutex */ static struct mutex g_base_mutex; diff --git a/board/kohaku/board.h b/board/kohaku/board.h index 73358c744c..aa609a051b 100644 --- a/board/kohaku/board.h +++ b/board/kohaku/board.h @@ -49,6 +49,13 @@ #define CONFIG_ALS_OPT3001 #define OPT3001_I2C_ADDR OPT3001_I2C_ADDR1 +/* USB Type C and USB PD defines */ +#define CONFIG_USB_PD_TCPM_PS8751 +#define BOARD_TCPC_C0_RESET_HOLD_DELAY PS8XXX_RESET_DELAY_MS +#define BOARD_TCPC_C0_RESET_POST_DELAY 0 +#define BOARD_TCPC_C1_RESET_HOLD_DELAY PS8XXX_RESET_DELAY_MS +#define BOARD_TCPC_C1_RESET_POST_DELAY 0 + /* Volume Button feature */ #define CONFIG_VOLUME_BUTTONS #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL |