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-09-02 01:09:48 +0000
commit4cb500f66fbe65f75c2a486af16f37b092a750ff (patch)
treebddda639e55b7cf39c58ff7890d69391b0d3a760
parent3e39e1c2f875251ee71e981c90b1cfa43ad9a33f (diff)
downloadchrome-ec-4cb500f66fbe65f75c2a486af16f37b092a750ff.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> (cherry picked from commit 868d1c87c241e22b0c353e342486689caf554b9f) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2388362 Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com>
-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 a739ae7eaf..46d0234b37 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"
@@ -352,6 +353,22 @@ uint32_t board_override_feature_flags1(uint32_t flags1)
return flags1;
}
+__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 = SYV682X_ADDR0,
diff --git a/board/meep/board.h b/board/meep/board.h
index ce2eb3183a..95fd082eb2 100644
--- a/board/meep/board.h
+++ b/board/meep/board.h
@@ -56,6 +56,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"