summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Chen <marcochen@google.com>2020-08-26 22:16:42 +0800
committerCommit Bot <commit-bot@chromium.org>2020-08-29 22:43:24 +0000
commitb0209f71f6d438fd8aeaf78c1748b7ade742dfd2 (patch)
tree6108f6b3537071f2841ee0dbaed5400d8a3cd435
parent5ce176d76cb0779d7e3e8c0fc9d0f9a743ecf94d (diff)
downloadchrome-ec-firmware-zork-13421.B-master.tar.gz
meep: enable 2nd TCPC source PS8755 for port 1firmware-zork-13421.B-master
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> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383924 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--board/meep/board.c17
-rw-r--r--board/meep/board.h4
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"