USB PD: Decouple low power mode from DRP auto toggle |
||||
Issue descriptionCurrently our USB PD protocol stack has "low power mode" tightly coupled with PD_STATE_DRP_AUTO_TOGGLE. In addition, it has the side effect of us dual role toggling (and resolving as sources) even though we have no intention of being a source. (e.g. DRP toggle in S0, once we suspend we're still toggling, even after shutting down to S5, we're still toggling. I think that we should not toggle in those lower power states, but instead behave properly as a sink and present only the Rd's. Furthermore, once we're in the SNK_DISCONNECTED state, I think we should be able to go into low power mode and simply wait for a source to be detected.
,
Nov 6
I uploaded an attempt here: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1320909 Still need to update unit tests.
,
Nov 6
,
Nov 9
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/ec/+/96156f62636c772a7cbbd0ee581379cf31a81bd5 commit 96156f62636c772a7cbbd0ee581379cf31a81bd5 Author: Aseda Aboagye <aaboagye@google.com> Date: Fri Nov 09 17:13:57 2018 pd_protocol: Don't DRP toggle lower than S0. Currently our USB PD protocol stack has "low power mode" tightly coupled with PD_STATE_DRP_AUTO_TOGGLE. In addition, it has the side effect of us dual role toggling (and resolving as sources) even though we have no intention of being a source. (e.g. DRP toggle in S0, once we suspend we're still toggling, even after shutting down to S5, we're still toggling.) This commit makes it such that we not dual role toggle in those lower power states, but instead behave properly as a sink and present only the Rd's. It also fixes a bug where if a port was previously sourcing in S0 and remained sourcing in suspend, if the sink was unplugged the port would be stuck presenting Rp's until a sink was plugged and unplugged again. BUG=chromium:902437 BUG=b:119055792 BRANCH=firmware-nocturne-10984.B TEST=Flash nocturne, use twinkie verify port does not dual role toggle in suspend or off. TEST=Verify that TCPC goes into low power mode in SNK_DISCONNECTED. TEST=Verify that charging works in suspend and off. Change-Id: Ie44581a1a1a82cf29a786b57a71ce70760862ca2 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/1320909 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> [modify] https://crrev.com/96156f62636c772a7cbbd0ee581379cf31a81bd5/test/usb_pd.c [modify] https://crrev.com/96156f62636c772a7cbbd0ee581379cf31a81bd5/common/usb_pd_protocol.c
,
Nov 9
|
||||
►
Sign in to add a comment |
||||
Comment 1 by bleung@google.com
, Nov 6