diff options
author | Devin Lu <devin.lu@quantatw.com> | 2020-09-04 17:31:46 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-11 21:45:53 +0000 |
commit | 95b672067a2e76deb10f0fa9a149526ab7a7a1cd (patch) | |
tree | f761ed1838a1fc072a0a055f043a575524a018ec /board/careena | |
parent | 4532bb55f546931efd35eee77226615cc59a9eff (diff) | |
download | chrome-ec-95b672067a2e76deb10f0fa9a149526ab7a7a1cd.tar.gz |
careena/barla: enable 2nd TCPC source PS8755 for port 1
This patch adds one more TCPC PS8755 in the port 1.
These two are all supported by ps8xxx.c and the board function
board_get_ps8xxx_product_id is implemented to judge the source by
checking TCPC ID pin.
BUG=b:157298401, b:158983814
BRANCH=firmware-grunt-11031.B
TEST=Verify DUT with PS8755 or PS8751 in the sub-board can work
correctly in sink and source roles.
Verify USBC charger is able to charging.
Change-Id: I867e925ee5bb54597ba09539743a0048c220e298
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393407
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
(cherry picked from commit 09fd4554bfbc055f67a7a51a4858b27f6bebc878)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2404907
Diffstat (limited to 'board/careena')
-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 c256145a75..082a47ab50 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 8bd11127ea..ed17d38646 100644 --- a/board/careena/board.h +++ b/board/careena/board.h @@ -30,6 +30,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) |