summaryrefslogtreecommitdiff
path: root/board/delbin
diff options
context:
space:
mode:
Diffstat (limited to 'board/delbin')
-rw-r--r--board/delbin/board.c35
-rw-r--r--board/delbin/board.h4
2 files changed, 39 insertions, 0 deletions
diff --git a/board/delbin/board.c b/board/delbin/board.c
index d7e7ad7f56..04dfa635c7 100644
--- a/board/delbin/board.c
+++ b/board/delbin/board.c
@@ -11,6 +11,8 @@
#include "cbi_ec_fw_config.h"
#include "driver/accel_bma2x2.h"
#include "driver/accelgyro_bmi260.h"
+#include "driver/ppc/sn5s330.h"
+#include "driver/ppc/syv682x.h"
#include "driver/retimer/bb_retimer.h"
#include "extpower.h"
#include "fan.h"
@@ -29,6 +31,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. */
@@ -243,3 +246,35 @@ __override void board_cbi_init(void)
/* TODO(b/159336576): Delbin: 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/delbin/board.h b/board/delbin/board.h
index 03c495d8d6..40625e92ea 100644
--- a/board/delbin/board.h
+++ b/board/delbin/board.h
@@ -70,6 +70,10 @@
#define USB_PORT_COUNT 1
#define CONFIG_USB_PORT_POWER_DUMB
+/* USBC PPC*/
+#define CONFIG_USBC_PPC_SN5S330 /* USBC port C0 */
+#define CONFIG_USBC_PPC_SYV682X /* USBC port C1 */
+
/* BC 1.2 */