summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-09-02 12:54:23 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-05 19:26:35 -0700
commit5f9e39ceaf609bfa31685ed4e763ac6c6e4ea27b (patch)
treed898ac827ce2363457904ed5bfb0960d54f8853e
parent7f87c6aeae1b091f8bc670df64c5a173d429aa34 (diff)
downloadchrome-ec-5f9e39ceaf609bfa31685ed4e763ac6c6e4ea27b.tar.gz
bd99955: usb_charger: Don't do BC1.2 detection on source ports
If we're sourcing 5V to the port, consider the port as not providing power, for the purpose of VBUS / BC1.2 detection. BUG=chrome-os-partner:55432 BRANCH=None TEST=Manual on kevin, attach legacy peripheral in one port, zinger in the other, run "reboot" on EC console, and verify zinger port is selected as charge port. Also attach Apple charge-thru accessory w/o charger plugged, verify that charge manager is not informed of a BC1.2 / VBUS supplier. Change-Id: Ifbe587215f28756760e7106e1a00dd96319438e3 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/380324 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--driver/charger/bd99955.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/driver/charger/bd99955.c b/driver/charger/bd99955.c
index 2f0af04145..68ebc0f77d 100644
--- a/driver/charger/bd99955.c
+++ b/driver/charger/bd99955.c
@@ -343,11 +343,12 @@ static int bd99955_get_vbus_detect_interrupts(int port)
static void usb_charger_process(enum bd99955_charge_port port)
{
- int vbus_provided = bd99955_is_vbus_provided(port);
+ int chg_port = bd99955_pd_port_to_chg_port(port);
+ int vbus_provided = bd99955_is_vbus_provided(port) &&
+ !usb_charger_port_is_sourcing_vbus(chg_port);
/* Inform other modules about VBUS level */
- usb_charger_vbus_change(bd99955_pd_port_to_chg_port(port),
- vbus_provided);
+ usb_charger_vbus_change(chg_port, vbus_provided);
/* Do BC1.2 detection */
if (vbus_provided) {