summaryrefslogtreecommitdiff
path: root/common/usb_charger.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-06-01 16:23:30 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-02 14:06:53 -0700
commit54261224660e9deb980c8d39b74f144f01edf68a (patch)
treea794df2dc6bc10048ebc2f12be2b2efba5c40ef7 /common/usb_charger.c
parent4f600b32bbcdd1f870f8389b8666101d3a8513ed (diff)
downloadchrome-ec-54261224660e9deb980c8d39b74f144f01edf68a.tar.gz
cleanup: pd: Define VBUS detection source
Previously CONFIG_USB_PD_TCPM_VBUS had two uses which were independent: - When operating as a TCPC, it indicated that the VBUS level should be tracked (through GPIO inputs) and sent to the external TCPM when appropriate. - When operating as a TCPM, it indicated that the VBUS level should be obtained by querying the TCPC. These two independent uses have been split into CONFIG_USB_PD_TCPC_TRACK_VBUS and CONFIG_USB_PD_VBUS_DETECT_TCPC, which sould be more clear. In addition, CONFIG_USB_PD_VBUS_DETECT_* CONFIGs have been added for other means of VBUS detection. BUG=chromium:616580 BRANCH=None TEST=Verify kevin continues to boot + charge. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I936821481d6577e17e3e9c61ff97c037574d6923 Reviewed-on: https://chromium-review.googlesource.com/348950 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/usb_charger.c')
-rw-r--r--common/usb_charger.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/usb_charger.c b/common/usb_charger.c
index 2b9c505f2e..67dd612e36 100644
--- a/common/usb_charger.c
+++ b/common/usb_charger.c
@@ -89,8 +89,12 @@ static void usb_charger_init(void)
i,
&charge_none);
-#ifndef CONFIG_USB_PD_TCPM_VBUS
- /* Initialize VBUS supplier based on whether VBUS is present */
+#ifndef CONFIG_USB_PD_VBUS_DETECT_TCPC
+ /*
+ * Initialize VBUS supplier based on whether VBUS is present.
+ * For CONFIG_USB_PD_VBUS_DETECT_TCPC, usb_charger_vbus_change()
+ * will be called directly from TCPC alert.
+ */
update_vbus_supplier(i, pd_snk_is_vbus_provided(i));
#endif
}