summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommy Chung <tommy.chung@quanta.corp-partner.google.com>2023-03-15 21:13:46 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-20 02:08:59 +0000
commite259d069568d5737e8be7519cf6da9e4d7be1865 (patch)
treeff67ff85ae7f5655565510e4625bbca79a01e438
parent0ff6f2a982e3d00d04f88cb4daf17af310c16616 (diff)
downloadchrome-ec-e259d069568d5737e8be7519cf6da9e4d7be1865.tar.gz
lantis: Enable 2nd TCPC source PS8805 for port 1
Used the SSFC bits to judge which source driver needs to be loaded. BUG=b:273637804 BRANCH=none TEST=verifying DUT with PS8705 or PS8805 in th daughter-board can charging and displaying, and verifying multiple Docks also works. Change-Id: I3f924f17145cf68e2eef863c47b1a46228c1c2cd Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4340870 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Devin Lu <devin.lu@quantatw.com>
-rw-r--r--board/lantis/board.c16
-rw-r--r--board/lantis/board.h4
2 files changed, 19 insertions, 1 deletions
diff --git a/board/lantis/board.c b/board/lantis/board.c
index 5ec54802d6..92c030def1 100644
--- a/board/lantis/board.c
+++ b/board/lantis/board.c
@@ -780,6 +780,22 @@ __override void typec_set_source_current_limit(int port, enum tcpc_rp_value rp)
charger_set_otg_current_voltage(port, current, 5000);
}
+__override uint16_t board_get_ps8xxx_product_id(int port)
+{
+ /* Lantis variant doesn't have ps8xxx product in the port 0 */
+ if (port == 0)
+ return 0;
+
+ switch (get_cbi_ssfc_tcpc_p1()) {
+ case SSFC_TCPC_P1_PS8805:
+ return PS8805_PRODUCT_ID;
+ case SSFC_TCPC_P1_DEFAULT:
+ case SSFC_TCPC_P1_PS8705:
+ default:
+ return PS8705_PRODUCT_ID;
+ }
+}
+
/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
const struct pwm_t pwm_channels[] = { [PWM_CH_KBLIGHT] = {
.channel = 0,
diff --git a/board/lantis/board.h b/board/lantis/board.h
index bda4b01280..007da07461 100644
--- a/board/lantis/board.h
+++ b/board/lantis/board.h
@@ -72,7 +72,9 @@
/* TCPC */
#define CONFIG_USB_PD_PORT_MAX_COUNT 2
#define CONFIG_USB_PD_TCPM_ITE_ON_CHIP /* C0: ITE EC TCPC */
-#define CONFIG_USB_PD_TCPM_PS8705 /* C1: PS8705 TCPC*/
+#define CONFIG_USB_PD_TCPM_MULTI_PS8XXX
+#define CONFIG_USB_PD_TCPM_PS8705 /* C1: PS8705 TCPC */
+#define CONFIG_USB_PD_TCPM_PS8805 /* C1: second source PS8805 TCPC */
#define CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT 1
#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
#define CONFIG_USB_PD_TCPC_LOW_POWER