summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2023-03-15 13:33:00 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-16 23:28:05 +0000
commit9f073bb967a5ffeea4e63f12927d91d78345cdb8 (patch)
tree1d6ef5f0c557ac3b394994589e1424a92f063276
parent2b6f15f37f9caf75e41c6de63b9855e4ecf6df16 (diff)
downloadchrome-ec-9f073bb967a5ffeea4e63f12927d91d78345cdb8.tar.gz
drawcia: Enable 2nd TCPC source PS8805 for port 1
Used the SSFC bits to judge which source driver needs to be loaded. BUG=b:273188377 BRANCH=none TEST=Verifying DUT with PS8705 or PS8805 in th daughter-board can charging and displaying. Verifying multiple Docks also works. Change-Id: I608272d02e8ae5dff2609c4f301bd39a392c6ded Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4339184 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Devin Lu <devin.lu@quantatw.com> Reviewed-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Devin Lu <devin.lu@quantatw.com>
-rw-r--r--board/drawcia/board.c16
-rw-r--r--board/drawcia/board.h4
2 files changed, 19 insertions, 1 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c
index 445ece3eb2..aa0c23c585 100644
--- a/board/drawcia/board.c
+++ b/board/drawcia/board.c
@@ -684,6 +684,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)
+{
+ /* Drawcia 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/drawcia/board.h b/board/drawcia/board.h
index afad544ef8..f53991da0b 100644
--- a/board/drawcia/board.h
+++ b/board/drawcia/board.h
@@ -74,7 +74,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