aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2023-09-06 16:50:38 +0100
committerMarc Zyngier <maz@kernel.org>2023-09-06 16:50:38 +0100
commitbe63edea325707f1ad26b8d46c9d7954e6f5b581 (patch)
tree0ab3f2172c0bb9c1e77dbd7ea63dc8ad79de9a26
parent6dbdd32aa305073f232c3fca9e2f7cad4242d907 (diff)
downloadcs-sw-be63edea325707f1ad26b8d46c9d7954e6f5b581.tar.gz
Increase delay when probing CC lines
It appears that the FUSB302 A_revB is getting confused when reading the CC lines back to back, and reports a whole lot of crap. Bumping the delay from 200ms to 500ms seems to help, so here it is. Also display the device ID in a format that matches the spec... Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--vdmtool.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vdmtool.c b/vdmtool.c
index ddf7ba4..0fcfae0 100644
--- a/vdmtool.c
+++ b/vdmtool.c
@@ -598,7 +598,7 @@ static void state_machine(struct vdm_context *cxt)
fusb302_tcpm_get_cc(PORT(cxt), &cc1, &cc2);
dprintf(cxt, "Poll: cc1=%d cc2=%d\n", (int)cc1, (int)cc2);
if (cc1 >= 2 || cc2 >= 2) {
- sleep_ms(200);
+ sleep_ms(500);
evt_dfpconnect(cxt);
} else {
vbus_off(cxt);
@@ -707,13 +707,15 @@ void m1_pd_bmc_fusb_setup(unsigned int port,
vbus_off(cxt);
tcpc_read(PORT(cxt), TCPC_REG_DEVICE_ID, &reg);
- cprintf(cxt, "Device ID: 0x%x\n", reg);
if (!(reg & 0x80)) {
cprintf(cxt, "Invalid device ID. Is the FUSB302 alive?\n");
cxt->hw = NULL;
return;
}
+ cprintf(cxt, "Device ID: %c_rev%c (0x%x)\n",
+ 'A' + ((reg >> 4) & 0x7), 'A' + (reg & 3), reg);
+
cprintf(cxt, "Init\n");
fusb302_tcpm_init(PORT(cxt));