summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2019-11-19 17:26:39 -0800
committerCommit Bot <commit-bot@chromium.org>2019-12-02 23:23:04 +0000
commitda960f61b0d0dda2fb1c3732f508a5a82fe0a230 (patch)
tree727c3e41ebe6ac38e8a38c46ad42b803eb532811
parenta5a98e063de8a71ef6416986a5962e3f7a36e4ca (diff)
downloadchrome-ec-da960f61b0d0dda2fb1c3732f508a5a82fe0a230.tar.gz
usb_pd: Enable Try.Src when dedicated charge port present
When a dedicated charge port is connected, it can source power. Hence, allow PD for trying as source. BUG=b:144824310 BRANCH=None TEST=Tested on TGL-Y able to see try.src logs with DC jack present without the battery connected Change-Id: I46e419c7e08ab4cf1e43c8b65e9cc4fdadc73825 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1926712 Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--common/usb_pd_protocol.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index fc8b28f29f..d4f6f0c06b 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2403,6 +2403,15 @@ static void pd_update_try_source(void)
pd_try_src_enable &= (battery_is_present() == BP_YES);
#endif /* CONFIG_BATTERY_PRESENT_[CUSTOM|GPIO] */
+#if CONFIG_DEDICATED_CHARGE_PORT_COUNT > 0
+ /*
+ * Since a dedicated charge port can source power allow PD
+ * trying as source.
+ */
+ pd_try_src_enable |= (charge_manager_get_active_charge_port() ==
+ CHARGE_SUPPLIER_DEDICATED);
+#endif /* CONFIG_DEDICATED_CHARGE_PORT_COUNT */
+
/*
* Clear this flag to cover case where a TrySrc
* mode went from enabled to disabled and trying_source