mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-07 16:11:43 +00:00
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>