diff options
author | Denis Brockus <dbrockus@google.com> | 2020-05-13 07:31:21 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-15 18:05:27 +0000 |
commit | 887e071cd0e00d2c41324364599c3099f25bebd3 (patch) | |
tree | 548e22db552aea8d8fa0eec87fd2a3b8e7f6ced2 /include/usb_pd_tcpm.h | |
parent | 7e70fc5301b425ce8e0265b6e7ebb3cf9e7109bb (diff) | |
download | chrome-ec-887e071cd0e00d2c41324364599c3099f25bebd3.tar.gz |
tcpc: change name of get_vbus_level to check_vbus_level
this is to add near future functionality to allow
not only the current PRESENT range check but to add
Save0V range checking as well, for platforms that
allow for this. This just lays the framework and
is functionally equivalent.
BUG=none
BRANCH=none
TEST=verify basic USB functionality
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I1eb3411bc3aa9b792c9b97799e1721e5cb229f64
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2199036
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'include/usb_pd_tcpm.h')
-rw-r--r-- | include/usb_pd_tcpm.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index a98d8e3000..5b160b46b5 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -8,6 +8,7 @@ #ifndef __CROS_EC_USB_PD_TCPM_H #define __CROS_EC_USB_PD_TCPM_H +#include <stdbool.h> #include "ec_commands.h" #include "i2c.h" @@ -106,6 +107,12 @@ enum tcpc_transmit_complete { TCPC_TX_COMPLETE_FAILED = 2, }; +/* USB-C PD Vbus levels */ +enum vbus_level { + VBUS_SAFE0V, + VBUS_PRESENT, +}; + /** * Returns whether the sink has detected a Rp resistor on the other side. */ @@ -202,13 +209,14 @@ struct tcpm_drv { enum tcpc_cc_voltage_status *cc2); /** - * Read VBUS + * Check VBUS level * * @param port Type-C port number + * @param level safe level voltage to check against * - * @return 0 => VBUS not detected, 1 => VBUS detected + * @return False => VBUS not at level, True => VBUS at level */ - int (*get_vbus_level)(int port); + bool (*check_vbus_level)(int port, enum vbus_level level); /** * Set the value of the CC pull-up used when we are a source. |