diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-02-05 16:41:08 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-02-06 05:20:51 +0000 |
commit | c2eb14b9d1d3cec317354faeabb83572d29e379e (patch) | |
tree | 31010d85628a32c3dd29ced4ee2b686a9d70fb8c /common | |
parent | 98b6ac17e16b47ccc872a96e5728e092a776630e (diff) | |
download | chrome-ec-c2eb14b9d1d3cec317354faeabb83572d29e379e.tar.gz |
pd: Mark VBUS as present when power swapping from source to sink
If we power swap from a source to a sink and begin charging, VBUS will
never be marked as present, which has bad side-effects when VBUS
disappears and we wish to stop charging.
BUG=chrome-os-partner:36389
TEST=Manual on Samus. Connect Samus-to-Samus and initiate charge
override on the port. Verify that charging from the port begins. Unplug
the cable and verify that the in-OS charge icon disappears. Repeat 10x.
BRANCH=Samus
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I83206c341c0d74991ad60eef411d71d30b5c67a5
Reviewed-on: https://chromium-review.googlesource.com/246781
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_pd_protocol.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 8d168e1f1c..049e53f13f 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1123,6 +1123,7 @@ static void handle_ctrl_request(int port, uint16_t head, /* reset message ID and swap roles */ pd[port].msg_id = 0; pd[port].power_role = PD_ROLE_SINK; + pd[port].flags |= PD_FLAGS_VBUS_PRESENT; set_state(port, PD_STATE_SNK_DISCOVERY); } else if (pd[port].task_state == PD_STATE_SNK_DISCOVERY) { /* Don't know what power source is ready. Reset. */ |