summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-06-25 11:27:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-29 17:32:26 +0000
commitd729b26f22776e8bce5a5b485be9bc252e832e8d (patch)
treef4c58639688cf962501e0ff1f3681f9c7a3370cb
parentaf430856c637235d9f705a51e7a69da0867d8f3a (diff)
downloadchrome-ec-d729b26f22776e8bce5a5b485be9bc252e832e8d.tar.gz
Guybrush: Set up custom Vbus source detection
In the USB common code, PPCs will always be given priority over TCPCs for detecting whether sourcing is enabled. However, with FRS enabled the PPC cached flags no longer accurately reflect whether we're sourcing. Therefore, set up a custom board function which may query the most appropriate chip, though for now set it up for the same component used by the Vbus discharge code. BRANCH=None BUG=b:183586640 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I4acf65930e944990e7770252de4ff47c671382a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2987596 Reviewed-by: Rob Barnes <robbarnes@google.com>
-rw-r--r--baseboard/guybrush/baseboard.h1
-rw-r--r--baseboard/guybrush/usb_pd_policy.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/baseboard/guybrush/baseboard.h b/baseboard/guybrush/baseboard.h
index 3b87a99b48..0aa01c7602 100644
--- a/baseboard/guybrush/baseboard.h
+++ b/baseboard/guybrush/baseboard.h
@@ -158,6 +158,7 @@
#define CONFIG_CMD_TCPC_DUMP
#define CONFIG_USB_CHARGER
#define CONFIG_USB_POWER_DELIVERY
+#define CONFIG_USB_PD_5V_EN_CUSTOM
#define CONFIG_USB_PD_ALT_MODE
#define CONFIG_USB_PD_ALT_MODE_DFP
#define CONFIG_USB_PD_DISCHARGE_TCPC
diff --git a/baseboard/guybrush/usb_pd_policy.c b/baseboard/guybrush/usb_pd_policy.c
index ac92a6e0ad..6a9e28704d 100644
--- a/baseboard/guybrush/usb_pd_policy.c
+++ b/baseboard/guybrush/usb_pd_policy.c
@@ -71,7 +71,14 @@ int pd_set_power_supply_ready(int port)
return EC_SUCCESS;
}
+/* Used by Vbus discharge common code with CONFIG_USB_PD_DISCHARGE */
int board_vbus_source_enabled(int port)
{
return ppc_is_sourcing_vbus(port);
}
+
+/* Used by USB charger task with CONFIG_USB_PD_5V_EN_CUSTOM */
+int board_is_sourcing_vbus(int port)
+{
+ return board_vbus_source_enabled(port);
+}