diff options
-rw-r--r-- | board/careena/board.c | 22 | ||||
-rw-r--r-- | board/careena/board.h | 4 | ||||
-rw-r--r-- | board/careena/gpio.inc | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/board/careena/board.c b/board/careena/board.c index 7f037ae131..4e601ba532 100644 --- a/board/careena/board.c +++ b/board/careena/board.c @@ -6,6 +6,7 @@ /* Careena board-specific configuration */ #include "button.h" +#include "driver/tcpm/ps8xxx.h" #include "extpower.h" #include "i2c.h" #include "lid_switch.h" @@ -61,4 +62,25 @@ const int keyboard_factory_scan_pins[][2] = { const int keyboard_factory_scan_pins_used = ARRAY_SIZE(keyboard_factory_scan_pins); + +static int board_is_support_ps8755_tcpc(void) +{ + /* + * 0: PS8751 + * 1: PS8755 + */ + return gpio_get_level(GPIO_TCPC_ID); +} + +__override uint16_t board_get_ps8xxx_product_id(int port) +{ + /* Careena variant doesn't have ps8xxx product in the port 0 */ + if (port == 0) + return 0; + + if (board_is_support_ps8755_tcpc()) + return PS8755_PRODUCT_ID; + + return PS8751_PRODUCT_ID; +} #endif diff --git a/board/careena/board.h b/board/careena/board.h index ed7e636ce3..4ae5153f47 100644 --- a/board/careena/board.h +++ b/board/careena/board.h @@ -29,6 +29,10 @@ #define CONFIG_BATTERY_MEASURE_IMBALANCE #define CONFIG_BATTERY_BQ4050 +/* Additional TCPC second source in Port 1 */ +#define CONFIG_USB_PD_TCPM_MULTI_PS8XXX +#define CONFIG_USB_PD_TCPM_PS8755 + #ifndef __ASSEMBLER__ enum pwm_channel { diff --git a/board/careena/gpio.inc b/board/careena/gpio.inc index 4b9efe9f09..eeccf9f50d 100644 --- a/board/careena/gpio.inc +++ b/board/careena/gpio.inc @@ -41,6 +41,7 @@ GPIO(PCH_SYS_PWROK, PIN(D, 6), GPIO_OUT_LOW) /* Power OK to SOC */ GPIO(CPU_PROCHOT, PIN(3, 4), GPIO_INPUT | GPIO_SEL_1P8V) /* PROCHOT to SOC */ GPIO(APU_ALERT_L, PIN(A, 2), GPIO_INPUT) /* Alert to SOC */ GPIO(3AXIS_INT_L, PIN(5, 0), GPIO_INPUT | GPIO_SEL_1P8V) /* 3 Axis Accel */ +GPIO(TCPC_ID, PIN(E, 0), GPIO_INPUT | GPIO_PULL_DOWN) /* TCPC ID pin */ GPIO(BAT_LED_AMBER_L, PIN(C, 3), GPIO_OUT_HIGH) GPIO(BAT_LED_WHITE_L, PIN(C, 4), GPIO_OUT_HIGH) |