summaryrefslogtreecommitdiff
path: root/driver/tcpm/fusb302.h
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2016-07-18 18:55:52 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-20 13:04:37 -0700
commit17f02ee5a709ceccc5f9447b120aac8d93008039 (patch)
tree92675ec27a9e1cf53487485ff58e2c5efc8c1b1d /driver/tcpm/fusb302.h
parent819239f00b0a4d1335b2f2a7cab7b4630fc9c096 (diff)
downloadchrome-ec-17f02ee5a709ceccc5f9447b120aac8d93008039.tar.gz
tcpm: fusb302: Fix issue with MDAC register definition
There was a mistake in the initial driver implementation regarding the MDAC field in the measure register (address 0x04). The header file and associated code defined this 6 bit field to be the upper 6 bits of the 8 bit register. However, the data sheet for both rev A and B silicon show this field as being the lower 6 bits of this register. In addition, when using this threshold to distinguish between a Rd and Ra attach, the threshold test logic was backwards. If the threhold bit is set, then it means the voltage is higher than the 200mV setting and should indicate a Rd attach. BUG=chrome-os-partner:54790 BRANCH=none TEST=manual Tested with Anker TypeC hub using known polarity (CC1). Previously, would see CC2 be selected as the active polarity. This resulted in USB PD state machine getting stuck in SRC_DISCOVERY due to SRC_CAP messages not being received correctly. With the changes, verified that correct CC polarity is always detected and results in reaching SRC_READY state. Change-Id: Ia522abdac31642ff99bbf13ccc73a0a77bbdb32d Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/361614 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Joe Bauman <joe.bauman@fairchildsemi.com> Reviewed-by: Guenter Roeck <groeck@google.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/tcpm/fusb302.h')
-rw-r--r--driver/tcpm/fusb302.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/driver/tcpm/fusb302.h b/driver/tcpm/fusb302.h
index 66ca7e5dbe..56f1813d7b 100644
--- a/driver/tcpm/fusb302.h
+++ b/driver/tcpm/fusb302.h
@@ -49,14 +49,13 @@
#define TCPC_REG_SWITCHES1_TXCC1_EN (1<<0)
#define TCPC_REG_MEASURE 0x04
-#define TCPC_REG_MEASURE_MDAC5 (1<<7)
-#define TCPC_REG_MEASURE_MDAC4 (1<<6)
-#define TCPC_REG_MEASURE_MDAC3 (1<<5)
-#define TCPC_REG_MEASURE_MDAC2 (1<<4)
-#define TCPC_REG_MEASURE_MDAC1 (1<<3)
-#define TCPC_REG_MEASURE_MDAC0 (1<<2)
-#define TCPC_REG_MEASURE_VBUS (1<<1)
-#define TCPC_REG_MEASURE_XXXX5 (1<<0)
+#define TCPC_REG_MEASURE_VBUS (1<<6)
+#define TCPC_REG_MEASURE_MDAC5 (1<<5)
+#define TCPC_REG_MEASURE_MDAC4 (1<<4)
+#define TCPC_REG_MEASURE_MDAC3 (1<<3)
+#define TCPC_REG_MEASURE_MDAC2 (1<<2)
+#define TCPC_REG_MEASURE_MDAC1 (1<<1)
+#define TCPC_REG_MEASURE_MDAC0 (1<<0)
#define TCPC_REG_CONTROL0 0x06
#define TCPC_REG_CONTROL0_TX_FLUSH (1<<6)