diff options
author | Edward Hill <ecgh@chromium.org> | 2018-08-28 15:43:32 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-17 21:34:41 -0700 |
commit | cc641491fe1f60e9b65a414ab346754f8410e554 (patch) | |
tree | f6c112c4cf2101505426cd2307e7e88b37cea5ab /board/atlas | |
parent | 1a7e596cb98369771cf30a602e307e0cf26f2522 (diff) | |
download | chrome-ec-cc641491fe1f60e9b65a414ab346754f8410e554.tar.gz |
pd: Check for dual-role partner when TOGGLE_OFF/FORCE_SINK
Charging via hub with the ANX3429 TCPC sometimes fails when the system
is in S5/G3. Both the hub and the ANX3429 are auto-toggling, so source
and sink roles depend on the timing of the connection. Charging will
fail when the hub expects the ANX3429 to be a source, but the
drp_state in S5/G3 is TOGGLE_OFF/FORCE_SINK.
Ideally we wouldn't use auto-toggle when drp_state is
TOGGLE_OFF/FORCE_SINK, but with the ANX3429 TCPC, auto-toggle can't be
prevented in low power mode.
To fix this, try being a sink in case the connected device is dual-role.
100 ms is enough time for a dual-role partner to switch from sink to
source. If the connected device is sink-only, then we will attempt
SNK_DISCONNECTED twice (due to debounce time), then return to low power
mode (and stay there). After 200 ms, reset ready for a new connection.
Move the next_state selection out into a function since things were
getting very narrow inside PD_STATE_DRP_AUTO_TOGGLE.
BRANCH=none
BUG=b:72007056
TEST=sink device + ANX3429: low power mode
TEST=sink device + PS8751: low power mode
TEST=charger via hub + ANX3429: starts charging (20/20 tries)
TEST=charger via hub + PS8751: starts charging
(all tests with Grunt in G3)
Change-Id: I097dcace96bc6e6e9cfab279bcbded50ef9951e3
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1194678
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/atlas')
0 files changed, 0 insertions, 0 deletions