From 4fcabe7ac114ca097893746f3154b90e91e7c31f Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Tue, 3 Dec 2019 10:36:05 +0800 Subject: fusb302: implement vbus measurement using tcpc Jacuzzi measure vbus using fusb302, add a config option CONFIG_USB_PD_VBUS_MEASURE_TCPC and related implementation. BUG=b:145376409 TEST=`ectool usbpdpower` BRANCH=none Change-Id: I84019a75338121f777a344a4b92710e2117a6bda Signed-off-by: Ting Shen Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1947507 Reviewed-by: Eric Yilun Lin Commit-Queue: Ting Shen Tested-by: Ting Shen --- include/usb_pd_tcpm.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/usb_pd_tcpm.h') diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index 7a7bd0b3a1..cfd7692852 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -435,4 +435,13 @@ int board_tcpc_post_init(int port) __attribute__((weak)); */ void board_pd_vconn_ctrl(int port, enum usbpd_cc_pin cc_pin, int enabled); +/** + * Get the VBUS voltage from TCPC + * + * @param port Type-C port number + * + * @return VBUS voltage in mV. + */ +int tcpc_get_vbus_voltage(int port); + #endif /* __CROS_EC_USB_PD_TCPM_H */ -- cgit v1.2.1