diff options
author | Marco Chen <marcochen@google.com> | 2020-08-26 22:16:42 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-29 07:00:14 +0000 |
commit | 868d1c87c241e22b0c353e342486689caf554b9f (patch) | |
tree | 23161f961c9204a51ffdf4ed7391460761d0cddd | |
parent | e4d6fd51470e8e5302e20c0916da807bcb879208 (diff) | |
download | chrome-ec-868d1c87c241e22b0c353e342486689caf554b9f.tar.gz |
meep: enable 2nd TCPC source PS8755 for port 1
The original TCPC in the port 1 is PS8751 and this CL adds another
option of PS8755.
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 the SSFC bits field in the CBI.
BUG=b:159082424, b:163922535
BRANCH=octopus
TEST=verify DUT with PS8755 or PS8751 in the sub-board can work
correctly in sink and source roles.
Signed-off-by: Marco Chen <marcochen@chromium.org>
Change-Id: I0cba58eb7b22c95aac1344f1b3a68ce5dac43ab0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2377060
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | board/meep/board.c | 17 | ||||
-rw-r--r-- | board/meep/board.h | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/board/meep/board.c b/board/meep/board.c index a497e337fb..01b4d0f089 100644 --- a/board/meep/board.c +++ b/board/meep/board.c @@ -9,6 +9,7 @@ #include "adc_chip.h" #include "battery.h" #include "button.h" +#include "cbi_ssfc.h" #include "charge_manager.h" #include "charge_state.h" #include "common.h" @@ -348,6 +349,22 @@ __override uint32_t board_override_feature_flags0(uint32_t flags0) return (flags0 &= ~EC_FEATURE_MASK_0(EC_FEATURE_PWM_KEYB)); } +__override uint16_t board_get_ps8xxx_product_id(int port) +{ + /* Meep variant doesn't have ps8xxx product in the port 0 */ + if (port == 0) + return 0; + + switch (get_cbi_ssfc_tcpc_p1()) { + case TCPC_P1_PS8755: + return PS8755_PRODUCT_ID; + case TCPC_P1_DEFAULT: + case TCPC_P1_PS8751: + default: + return PS8751_PRODUCT_ID; + } +} + const struct ppc_config_t ppc_syv682x_port0 = { .i2c_port = I2C_PORT_TCPC0, .i2c_addr_flags = SYV682X_ADDR0_FLAGS, diff --git a/board/meep/board.h b/board/meep/board.h index fdc6604b3f..c0e33b1b58 100644 --- a/board/meep/board.h +++ b/board/meep/board.h @@ -54,6 +54,10 @@ /* Additional PPC second source */ #define CONFIG_USBC_PPC_SYV682X +/* Additional TCPC second source in Port 1 */ +#define CONFIG_USB_PD_TCPM_MULTI_PS8XXX +#define CONFIG_USB_PD_TCPM_PS8755 + #ifndef __ASSEMBLER__ #include "gpio_signal.h" |