summaryrefslogtreecommitdiff
path: root/board/hatch/board.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2019-04-02 15:04:53 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-17 21:32:26 -0700
commita19ad262f2df67cf36d6051d1f309a9f50c2b7f3 (patch)
tree91f7e63b87c935a72adda74c0ed3838630b4ba96 /board/hatch/board.c
parentf562e995c896e32816f013b848b8ffe61c8f09cd (diff)
downloadchrome-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/hatch/board.c')
-rw-r--r--board/hatch/board.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/board/hatch/board.c b/board/hatch/board.c
index ae4a26aad4..4b1f8fa883 100644
--- a/board/hatch/board.c
+++ b/board/hatch/board.c
@@ -14,6 +14,9 @@
#include "driver/accelgyro_bmi160.h"
#include "driver/als_opt3001.h"
#include "driver/ppc/sn5s330.h"
+#include "driver/tcpm/anx7447.h"
+#include "driver/tcpm/ps8xxx.h"
+#include "driver/tcpm/tcpci.h"
#include "ec_commands.h"
#include "extpower.h"
#include "fan.h"
@@ -115,6 +118,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 = AN7447_TCPC0_I2C_ADDR,
+ .drv = &anx7447_tcpm_drv,
+ .flags = TCPC_FLAGS_RESET_ACTIVE_HIGH,
+ },
+ [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 = &anx7447_usb_mux_driver,
+ .hpd_update = &anx7447_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;