summaryrefslogtreecommitdiff
path: root/driver/tcpm/anx74xx.c
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2016-10-28 16:38:29 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-31 11:49:29 -0700
commite852d78bc28bb26e6b7ba27cb59ecf8a1ce3f076 (patch)
tree9f478382f7e8f2f3855464d324003774ded30375 /driver/tcpm/anx74xx.c
parentcf7ff32b92275f9d4cce4bc3bcaa7d8890b0cb2e (diff)
downloadchrome-ec-e852d78bc28bb26e6b7ba27cb59ecf8a1ce3f076.tar.gz
anx74xx: Added check for hard reset done bit in IRQ status
The check for hard reset complete was missing. Because of this, the USB PD protocol state machine would get stuck in state 36 PD_STATE_HARD_RESET_SEND waiting for the pd_task to be woken following the tx_complete. Instead it would always trip the 100 msec timeout. BRANCH=none BUG=chrome-os-partner:58738 TEST=manual Without this CL, connect to a Guppy TypeC charger and observe: > C0 st3 [101.946607 event set 0x00200000] C0 st15 C0 st3 C0 st6 C0 st36 [102.466846 New chg p0] [102.470376 Ramp reset: st1] [102.470905 CL: p0 s2 i2000 v5000] [103.543623 AC on] After adding the fix for checking hard reset done: > C0 st3 [32.880946 event set 0x00200000] C0 st15 C0 st3 C0 st6 C0 st36 [33.410038 New chg p0] C0 st37 [33.415641 Ramp reset: st1] [33.416160 CL: p0 s2 i2000 v5000] C0 HARD RST TX C0 st5 C0 st36 C0 st37 C0 HARD RST TX C0 st5 [34.489611 AC on] [34.489965 event set 0x00000008] [34.520457 event set 0x00400000] [34.520876 charge_request(8688mV, 4608mA)] C0 st6 [35.419391 Ramp p0 st2 500mA 0mA] Change-Id: I6822983002fa387c85f7e55af5fe1e142c7b88e2 Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/404878 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/tcpm/anx74xx.c')
-rw-r--r--driver/tcpm/anx74xx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/driver/tcpm/anx74xx.c b/driver/tcpm/anx74xx.c
index 073eb92867..c96cab36b0 100644
--- a/driver/tcpm/anx74xx.c
+++ b/driver/tcpm/anx74xx.c
@@ -612,6 +612,10 @@ static int anx74xx_alert_status(int port, int *alert)
/* Clears interrupt bits */
rv |= tcpc_write(port, ANX74XX_REG_IRQ_EXT_SOURCE_1, reg);
+ /* Check for Hard Reset done bit */
+ if (reg & ANX74XX_REG_ALERT_TX_HARD_RESETOK)
+ *alert |= ANX74XX_REG_ALERT_TX_HARD_RESETOK;
+
/* Read TCPC Alert register2 */
rv |= tcpc_read(port, ANX74XX_REG_IRQ_EXT_SOURCE_2, &reg);