diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-09-07 12:13:27 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-09-11 20:26:06 +0000 |
commit | 193e4ff4e3a358fbe29762ea1bcc733b97cfc9f9 (patch) | |
tree | 08780fc7b3af97390789f927341a8e2d1833ed5a | |
parent | 311b3e4e15fd37ea2ab151edb8b8a468e93355fd (diff) | |
download | chrome-ec-193e4ff4e3a358fbe29762ea1bcc733b97cfc9f9.tar.gz |
pd: Allow deep sleep in SRC_DISCOVERY
If the PD state machine remains in SRC_DISCOVERY for an extended period
of time, it's likely that a non-PD USB peripheral is attached. In this
case, we don't need to inhibit deep sleep, since we're not likely to
receive PD packets.
This change will cause us to enter deep sleep slightly more
aggressively, not inhibiting deep sleep until source caps are received
or replied with GoodCRC by the port partner. We can accommodate
additional task latency up to this point, since the spec calls for
source caps to be sent up to 50 times before failure.
BUG=b:35582718,chromium:763002
TEST=Test with `sleepmask 1` on kevin.
- Go to S3 with USB-C flash drive plugged, verify `sleepmask` shows 0.
- Go to S3 with zinger + USB C flash drive plugged
- Unplug zinger, verify `sleepmask` shows 0.
- Plug zinger, verify PD negotiates to 20V @ 2A.
- Plug OEM kevin charger, verify same.
BRANCH=gru
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib8e1bc94bdbcfddea004d572edf1ccadc8c8c1ce
Reviewed-on: https://chromium-review.googlesource.com/655919
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 9abb9f762efb3f386befc74e90275fe8789e3bd2)
Reviewed-on: https://chromium-review.googlesource.com/660459
-rw-r--r-- | common/usb_pd_protocol.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 6ac27bbf85..a522e66147 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -334,9 +334,9 @@ static inline void set_state(int port, enum pd_states next_state) } #ifdef CONFIG_LOW_POWER_IDLE - /* If any PD port is connected, then disable deep sleep */ + /* If a PD device is attached then disable deep sleep */ for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; i++) { - if (pd_is_connected(i)) + if (pd[i].flags & PD_FLAGS_PREVIOUS_PD_CONN) break; } if (i == CONFIG_USB_PD_PORT_COUNT) |