summaryrefslogtreecommitdiff
path: root/board/halvor/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/halvor/board.c')
-rw-r--r--board/halvor/board.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/board/halvor/board.c b/board/halvor/board.c
index 5180bf6bbf..f5341f136c 100644
--- a/board/halvor/board.c
+++ b/board/halvor/board.c
@@ -11,6 +11,8 @@
#include "cbi_ec_fw_config.h"
#include "driver/accel_bma2x2.h"
#include "driver/als_tcs3400.h"
+#include "driver/ppc/sn5s330.h"
+#include "driver/ppc/syv682x.h"
#include "driver/sync.h"
#include "extpower.h"
#include "gpio.h"
@@ -26,6 +28,7 @@
#include "tablet_mode.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. */
@@ -196,3 +199,35 @@ __override void board_cbi_init(void)
{
/* TODO (b/153705222): Check FW_CONFIG for USB DB options */
}
+
+/******************************************************************************/
+/* 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;
+ }
+}