diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2016-04-27 11:52:58 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-04-27 18:12:28 -0700 |
commit | 2aadcea46120808076348783fc7202dcc3939d5a (patch) | |
tree | 99cf808b341c0b4d829610df8ef46389c108cd63 /driver | |
parent | 88caf3bc720796d79544dd4200edc11f8e3bbe63 (diff) | |
download | chrome-ec-2aadcea46120808076348783fc7202dcc3939d5a.tar.gz |
fusb302: Delay after enabling CC measurement switches
Delay after enabling CC measurements, before checking CC levels, in
order to improve accuracy.
BUG=None
TEST=Manual on Kevin. Verify CC levels are consistent with a specific
charger.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib9abab2abd68b071fb22200bcac36bea6e361d67
Reviewed-on: https://chromium-review.googlesource.com/340885
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Joe Bauman <joe.bauman@fairchildsemi.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/tcpm/fusb302.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/driver/tcpm/fusb302.c b/driver/tcpm/fusb302.c index 11464bbab3..2b84f31b3f 100644 --- a/driver/tcpm/fusb302.c +++ b/driver/tcpm/fusb302.c @@ -225,9 +225,11 @@ static void detect_cc_pin_sink(int port, int *cc1, int *cc2) tcpc_write(port, TCPC_REG_SWITCHES0, reg); - /* - * CC1 is now being measured by FUSB302. - */ + /* CC1 is now being measured by FUSB302. */ + + /* Wait on measurement */ + usleep(250); + tcpc_read(port, TCPC_REG_STATUS0, &bc_lvl_cc1); /* mask away unwanted bits */ @@ -245,9 +247,11 @@ static void detect_cc_pin_sink(int port, int *cc1, int *cc2) tcpc_write(port, TCPC_REG_SWITCHES0, reg); - /* - * CC2 is now being measured by FUSB302. - */ + /* CC2 is now being measured by FUSB302. */ + + /* Wait on measurement */ + usleep(250); + tcpc_read(port, TCPC_REG_STATUS0, &bc_lvl_cc2); /* mask away unwanted bits */ |