summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-10-16 16:44:36 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-24 16:45:07 -0700
commit936f0bad4806705cf8c6f9523a9e99ae2070aed4 (patch)
tree24afe3adcd0432d424df5687011822b2c629e17e
parent67cd02cffdb80c137745f35abb03562402fd6c66 (diff)
downloadchrome-ec-936f0bad4806705cf8c6f9523a9e99ae2070aed4.tar.gz
ppc: syv682x: Add trigger for BC 1.2 when turning src path on/off
When using the syv682x PPC for VBUS detection, VBUS changes need to result in a call to usb_charger_vbus_change() which will set an event to wake the USB_CHG_N task. This was being handled when the port was attached as a sink, but was not being done when the port was attached as source. This CL adds a call to usb_charger_vbus_change() when the source path is enabled or disabled. BRANCH=none BUG=b:113267982 TEST=On DragonEgg, connect a USB 2.0 keyboard and verfied that it enumerates. localhost ~ # lsusb Bus 003 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120 Change-Id: Ie26ad1a062320eb1290fe8c6f6f8b3de8261a03f Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1285295 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--driver/ppc/syv682x.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/driver/ppc/syv682x.c b/driver/ppc/syv682x.c
index ea6e83ae48..d7c050cbce 100644
--- a/driver/ppc/syv682x.c
+++ b/driver/ppc/syv682x.c
@@ -129,7 +129,7 @@ static int syv682x_vbus_source_enable(int port, int enable)
} else if (flags[port] & SYV682X_FLAGS_SOURCE_ENABLED) {
/*
* For the disable case, make sure that VBUS was being sourced
- * proir to disabling the source path. Because the source/sink
+ * prior to disabling the source path. Because the source/sink
* paths can't be independently disabled, and this function will
* get called as part of USB PD initialization, setting the
* PWR_ENB always can lead to broken dead battery behavior.
@@ -149,6 +149,14 @@ static int syv682x_vbus_source_enable(int port, int enable)
else
flags[port] &= ~SYV682X_FLAGS_SOURCE_ENABLED;
+#if defined(CONFIG_USB_CHARGER) && defined(CONFIG_USB_PD_VBUS_DETECT_PPC)
+ /*
+ * Since the VBUS state could be changing here, need to wake the
+ * USB_CHG_N task so that BC 1.2 detection will be triggered.
+ */
+ usb_charger_vbus_change(port, enable);
+#endif
+
return EC_SUCCESS;
}