diff options
author | David Huang <david.huang@quanta.corp-partner.google.com> | 2020-06-30 15:40:26 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-05 18:36:45 +0000 |
commit | 62dfe288411de85766ac136c2ccc10b2d73a9a89 (patch) | |
tree | 74c390f9d3607c0f29d4f0ea8baf83c775a3a6a2 /board/trondo | |
parent | c23554b473e8a9d772f55533bbf72c072c888828 (diff) | |
download | chrome-ec-62dfe288411de85766ac136c2ccc10b2d73a9a89.tar.gz |
volteer: move ppc_chips[] from baseboard to board
Move ppc_chips[] to board for board customize.
BUG=b:151978872
BRANCH=master
TEST=check ppc init succeed and switch source/sink correct with type c
device.
Change-Id: I287bbe44b163d72c19a3764dca431c84d86bbdec
Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2275971
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/trondo')
-rw-r--r-- | board/trondo/board.c | 36 | ||||
-rw-r--r-- | board/trondo/board.h | 4 |
2 files changed, 40 insertions, 0 deletions
diff --git a/board/trondo/board.c b/board/trondo/board.c index e4635a0237..3570d34cec 100644 --- a/board/trondo/board.c +++ b/board/trondo/board.c @@ -12,6 +12,8 @@ #include "driver/accel_bma2x2.h" #include "driver/accelgyro_bmi260.h" #include "driver/als_tcs3400.h" +#include "driver/ppc/sn5s330.h" +#include "driver/ppc/syv682x.h" #include "driver/retimer/bb_retimer.h" #include "driver/sync.h" #include "extpower.h" @@ -31,6 +33,7 @@ #include "throttle_ap.h" #include "uart.h" #include "usb_pd_tbt.h" +#include "usbc_ppc.h" #include "util.h" #include "gpio_list.h" /* Must come after other header files. */ @@ -221,3 +224,36 @@ __override void board_cbi_init(void) { /* TODO(b/159025023): Trondo: check FW_CONFIG fields for USB DB type */ } + +/******************************************************************************/ +/* USBC PPC configuration */ +struct ppc_config_t ppc_chips[] = { + [USBC_PORT_C0] = { + .i2c_port = I2C_PORT_USB_C0, + .i2c_addr_flags = SN5S330_ADDR0_FLAGS, + .drv = &sn5s330_drv, + }, + [USBC_PORT_C1] = { + .i2c_port = I2C_PORT_USB_C1, + .i2c_addr_flags = SYV682X_ADDR0_FLAGS, + .drv = &syv682x_drv, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(ppc_chips) == USBC_PORT_COUNT); +unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); + +/******************************************************************************/ +/* PPC support routines */ +void ppc_interrupt(enum gpio_signal signal) +{ + switch (signal) { + case GPIO_USB_C0_PPC_INT_ODL: + sn5s330_interrupt(USBC_PORT_C0); + break; + case GPIO_USB_C1_PPC_INT_ODL: + syv682x_interrupt(USBC_PORT_C1); + default: + break; + } +} + diff --git a/board/trondo/board.h b/board/trondo/board.h index 4495625709..5cd98b039d 100644 --- a/board/trondo/board.h +++ b/board/trondo/board.h @@ -66,6 +66,10 @@ /* USB Type A Features */ +/* USBC PPC*/ +#define CONFIG_USBC_PPC_SN5S330 /* USBC port C0 */ +#define CONFIG_USBC_PPC_SYV682X /* USBC port C1 */ + /* BC 1.2 */ /* Volume Button feature */ |