summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2023-03-13 10:37:29 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-14 05:41:53 +0000
commit3b6293d3027c03c42d700747d7dfc152174e8e74 (patch)
treee4d36be98dfc8e444dedba18fe7a469d307ede76 /include/driver
parentdba461e5e1821175757addfb4f58198b117b378f (diff)
downloadchrome-ec-3b6293d3027c03c42d700747d7dfc152174e8e74.tar.gz
tcpci: add tcpci_get_vbus_voltage_no_check
The function is identical to get_vbus_voltage but without checking the DEV_CAP_1. This is a refactor for some TCPCI (e.g. ANX7447) support VBUS sensing, but doesn't report it in DEV_CAP_1. BUG=b:272664811 TEST=./twister -T zephyr/test/drivers BRANCH=none Change-Id: Ic66fc1dd86eea363f82388453c0181f35bfc5ae6 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4333418 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'include/driver')
-rw-r--r--include/driver/tcpm/tcpci.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/driver/tcpm/tcpci.h b/include/driver/tcpm/tcpci.h
index 4ded8c23e7..917b2b65aa 100644
--- a/include/driver/tcpm/tcpci.h
+++ b/include/driver/tcpm/tcpci.h
@@ -380,6 +380,16 @@ int tcpci_get_chip_info_mutable(
int (*mutator)(int port, bool live,
struct ec_response_pd_chip_info_v1 *cached));
+/**
+ * This function is identical to the tcpci_get_vbus_voltage without
+ * checking the DEV_CAP_1.
+ *
+ * @param port: The USB-C port to query
+ * @param vbus: VBUS voltage in mV the TCPC sensed
+ *
+ * @return EC_SUCCESS on success, and otherwise on failure.
+ */
+int tcpci_get_vbus_voltage_no_check(int port, int *vbus);
int tcpci_get_vbus_voltage(int port, int *vbus);
bool tcpci_tcpm_get_snk_ctrl(int port);
int tcpci_tcpm_set_snk_ctrl(int port, int enable);