summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd.h70
-rw-r--r--include/usb_pd_vdo.h19
2 files changed, 89 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index ed15149441..f1171d6583 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1808,6 +1808,76 @@ void dfp_consume_modes(int port, enum tcpm_transmit_type type, int cnt,
uint32_t *payload);
/**
+ * Returns true if connected VPD supports Charge Through
+ *
+ * @param port USB-C port number
+ * @return TRUE if Charge Through is supported, else FALSE
+ */
+bool is_vpd_ct_supported(int port);
+
+/**
+ * Returns CTVPD ground impedance
+ *
+ * @param port USB-C port number
+ * @return Ground impedance through the VPD in 1 mOhm increments, else
+ * 0 if Charge Through isn't supported
+ */
+uint8_t get_vpd_ct_gnd_impedance(int port);
+
+/**
+ * Returns CTVPD VBUS impedance
+ *
+ * @param port USB-C port number
+ * @return VBUS impedance through the VPD in 2 mOhm increments, else
+ * 0 if Charge Through isn't supported
+ */
+uint8_t get_vpd_ct_vbus_impedance(int port);
+
+/**
+ * Returns CTVPD Current support
+ *
+ * @param port USB-C port number
+ * @return 0 - 3A capable or
+ * 1 - 5A capable
+ */
+uint8_t get_vpd_ct_current_support(int port);
+
+/**
+ * Returns CTVPD Maximum VBUS Voltage
+ *
+ * @param port USB-C port number
+ * @return 0 - 20V
+ * 1 - 30V
+ * 2 - 40V
+ * 3 - 50V
+ */
+uint8_t get_vpd_ct_max_vbus_voltage(int port);
+
+/**
+ * Returns VPD VDO Version
+ *
+ * @param port USB-C port number
+ * @return 0 for Version 1.0
+ */
+uint8_t get_vpd_ct_vdo_version(int port);
+
+/**
+ * Returns VPD Firmware Version
+ *
+ * @param port USB-C port number
+ * @return Firmware version assigned by the VID owner
+ */
+uint8_t get_vpd_ct_firmware_verion(int port);
+
+/**
+ * Returns HW Firmware Version
+ *
+ * @param port USB-C port number
+ * @return HW version assigned by the VID owner
+ */
+uint8_t get_vpd_ct_hw_version(int port);
+
+/**
* Initialize alternate mode discovery info for DFP
*
* @param port USB-C port number
diff --git a/include/usb_pd_vdo.h b/include/usb_pd_vdo.h
index ac8e67b73e..b146fde179 100644
--- a/include/usb_pd_vdo.h
+++ b/include/usb_pd_vdo.h
@@ -965,6 +965,22 @@ union enter_usb_data_obj {
uint32_t raw_value;
};
+union vpd_vdo {
+ struct {
+ uint32_t ct_support : 1;
+ uint32_t gnd_impedance : 6;
+ uint32_t vbus_impedance : 6;
+ uint32_t reserved0 : 1;
+ uint32_t ct_current_support : 1;
+ uint32_t max_vbus_voltage : 2;
+ uint32_t reserved1 : 4;
+ uint32_t vdo_version : 3;
+ uint32_t firmware_version : 4;
+ uint32_t hw_version : 4;
+ };
+ uint32_t raw_value;
+};
+
/*
* ############################################################################
*
@@ -982,6 +998,9 @@ union product_type_vdo1 {
union active_cable_vdo_rev20 a_rev20;
union active_cable_vdo1_rev30 a_rev30;
+ /* Vconn Power USB Device VDO */
+ union vpd_vdo vpd;
+
uint32_t raw_value;
};
BUILD_ASSERT(sizeof(uint32_t) == sizeof(union product_type_vdo1));