summaryrefslogtreecommitdiff
path: root/common/usb_charger.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-10-22 11:37:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-23 10:10:56 -0700
commit847978564a3ac343c191be94e7a83076ead33f70 (patch)
treed2b5292d9b3280b888fc3d8249d70dbe760a18ab /common/usb_charger.c
parentaccc98d7c3fdcad6e35ac2ebeb63fbda3abf8d2e (diff)
downloadchrome-ec-847978564a3ac343c191be94e7a83076ead33f70.tar.gz
pd: send soft reset on boot if VBUS is present
On boot, if VBUS is present, then when PD protocol gets to SNK_DISCOVERY state, if it times out waiting for source cap, then send attempt to send a soft reset first instead of directly sending a hard reset. This allows us to not lose VBUS in the case that we were in a stable contract as a sink before this boot (for example a sysjump or EC reboot). BUG=chrome-os-partner:44085, chrome-os-partner:44952 BRANCH=none TEST=test on glados and samus. test by sysjumping between RO and RW with zinger plugged in and no battery, and verify that we don't lose power. also test rebooting with a battery and verify we don't lose power. also tested with a third party PD charger. Change-Id: Ib7ce46d8b9843db66805ba3237d8919d611324e0 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/308201 Reviewed-by: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'common/usb_charger.c')
-rw-r--r--common/usb_charger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/usb_charger.c b/common/usb_charger.c
index 0474bc18b8..b22e8dc99d 100644
--- a/common/usb_charger.c
+++ b/common/usb_charger.c
@@ -82,6 +82,8 @@ void usb_charger_set_switches(int port, enum usb_switch setting)
void usb_charger_vbus_change(int port, int vbus_level)
{
+ /* If VBUS has transitioned low, notify PD module directly */
+ pd_vbus_low(port);
/* Update VBUS supplier and signal VBUS change to USB_CHG task */
update_vbus_supplier(port, vbus_level);
#if CONFIG_USB_PD_PORT_COUNT == 2