summaryrefslogtreecommitdiff
path: root/include/usb_pd.h
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-08-18 11:43:25 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-18 23:04:51 +0000
commit59e395027ab03c0ca2b5263193b30dff1c063c44 (patch)
tree7965d55bbc96f1515bdd2ca063fe5d48b69f1bd4 /include/usb_pd.h
parentfb89306a92228081e4203a33725357dd9754b6c8 (diff)
downloadchrome-ec-59e395027ab03c0ca2b5263193b30dff1c063c44.tar.gz
TCPM: Rename enum tcpm_transmit_type
Rename tcpm_transmit_type to tcpm_sop_type to reflect that it can be used for Rx as well. Describe it in comments. This prepares to consolidate enum pd_msg_type into this enum. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ife97d4ad51c48f2e832b94e007954919e236a309 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3104290 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r--include/usb_pd.h62
1 files changed, 31 insertions, 31 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index aed49c8f07..5200ef4e1c 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1368,7 +1368,7 @@ void schedule_deferred_pd_interrupt(int port);
* PD_REV20 for PD Revision 2.0
* PD_REV30 for PD Revision 3.0
*/
-int pd_get_rev(int port, enum tcpm_transmit_type type);
+int pd_get_rev(int port, enum tcpm_sop_type type);
/**
* Get current PD VDO Version of Structured VDM
@@ -1378,7 +1378,7 @@ int pd_get_rev(int port, enum tcpm_transmit_type type);
* @return VDM_VER10 for VDM Version 1.0
* VDM_VER20 for VDM Version 2.0
*/
-int pd_get_vdo_ver(int port, enum tcpm_transmit_type type);
+int pd_get_vdo_ver(int port, enum tcpm_sop_type type);
/**
* Get transmit retry count for active PD revision.
@@ -1387,7 +1387,7 @@ int pd_get_vdo_ver(int port, enum tcpm_transmit_type type);
* @param type The partner to query (SOP, SOP', or SOP'')
* @return The number of retries to perform when transmitting.
*/
-int pd_get_retry_count(int port, enum tcpm_transmit_type type);
+int pd_get_retry_count(int port, enum tcpm_sop_type type);
/**
* Check if max voltage request is allowed (only used if
@@ -1714,7 +1714,7 @@ __override_proto int pd_custom_vdm(int port, int cnt, uint32_t *payload,
* @return if >0, number of VDOs to send back.
*/
int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload,
- uint32_t head, enum tcpm_transmit_type *rtype);
+ uint32_t head, enum tcpm_sop_type *rtype);
/**
* Handle Custom VDMs for flashing.
@@ -1735,7 +1735,7 @@ int pd_custom_flash_vdm(int port, int cnt, uint32_t *payload);
* @param opos object position of mode to exit.
* @return vdm for UFP to be sent to enter mode or zero if not.
*/
-uint32_t pd_dfp_enter_mode(int port, enum tcpm_transmit_type type,
+uint32_t pd_dfp_enter_mode(int port, enum tcpm_sop_type type,
uint16_t svid, int opos);
/**
@@ -1773,7 +1773,7 @@ int pd_dfp_dp_get_pin_mode(int port, uint32_t status);
* @param opos object position of mode to exit.
* @return 1 if UFP should be sent exit mode VDM.
*/
-int pd_dfp_exit_mode(int port, enum tcpm_transmit_type type, uint16_t svid,
+int pd_dfp_exit_mode(int port, enum tcpm_sop_type type, uint16_t svid,
int opos);
/**
@@ -1792,7 +1792,7 @@ void dfp_consume_attention(int port, uint32_t *payload);
* @param cnt number of data objects in payload
* @param payload payload data.
*/
-void dfp_consume_identity(int port, enum tcpm_transmit_type type, int cnt,
+void dfp_consume_identity(int port, enum tcpm_sop_type type, int cnt,
uint32_t *payload);
/**
@@ -1803,7 +1803,7 @@ void dfp_consume_identity(int port, enum tcpm_transmit_type type, int cnt,
* @param cnt number of data objects in payload
* @param payload payload data.
*/
-void dfp_consume_svids(int port, enum tcpm_transmit_type type, int cnt,
+void dfp_consume_svids(int port, enum tcpm_sop_type type, int cnt,
uint32_t *payload);
/**
@@ -1814,7 +1814,7 @@ void dfp_consume_svids(int port, enum tcpm_transmit_type type, int cnt,
* @param cnt number of data objects in payload
* @param payload payload data.
*/
-void dfp_consume_modes(int port, enum tcpm_transmit_type type, int cnt,
+void dfp_consume_modes(int port, enum tcpm_sop_type type, int cnt,
uint32_t *payload);
/**
@@ -1901,7 +1901,7 @@ void pd_dfp_discovery_init(int port);
* @param type SOP* type to set
* @param disc Discovery state to set (failed or complete)
*/
-void pd_set_identity_discovery(int port, enum tcpm_transmit_type type,
+void pd_set_identity_discovery(int port, enum tcpm_sop_type type,
enum pd_discovery_state disc);
/**
@@ -1912,7 +1912,7 @@ void pd_set_identity_discovery(int port, enum tcpm_transmit_type type,
* @return Current discovery state (failed or complete)
*/
enum pd_discovery_state pd_get_identity_discovery(int port,
- enum tcpm_transmit_type type);
+ enum tcpm_sop_type type);
/**
* Set SVID discovery state for this type and port.
@@ -1921,7 +1921,7 @@ enum pd_discovery_state pd_get_identity_discovery(int port,
* @param type SOP* type to set
* @param disc Discovery state to set (failed or complete)
*/
-void pd_set_svids_discovery(int port, enum tcpm_transmit_type type,
+void pd_set_svids_discovery(int port, enum tcpm_sop_type type,
enum pd_discovery_state disc);
/**
@@ -1932,7 +1932,7 @@ void pd_set_svids_discovery(int port, enum tcpm_transmit_type type,
* @return Current discovery state (failed or complete)
*/
enum pd_discovery_state pd_get_svids_discovery(int port,
- enum tcpm_transmit_type type);
+ enum tcpm_sop_type type);
/**
* Set Modes discovery state for this port, SOP* type, and SVID.
@@ -1942,7 +1942,7 @@ enum pd_discovery_state pd_get_svids_discovery(int port,
* @param svid SVID to set mode discovery state for
* @param disc Discovery state to set (failed or complete)
*/
-void pd_set_modes_discovery(int port, enum tcpm_transmit_type type,
+void pd_set_modes_discovery(int port, enum tcpm_sop_type type,
uint16_t svid, enum pd_discovery_state disc);
/**
@@ -1959,7 +1959,7 @@ void pd_set_modes_discovery(int port, enum tcpm_transmit_type type,
* PD_DISC_FAIL)
*/
enum pd_discovery_state pd_get_modes_discovery(int port,
- enum tcpm_transmit_type type);
+ enum tcpm_sop_type type);
/**
* Returns the mode vdo count of the specified SVID and sets
@@ -1973,7 +1973,7 @@ enum pd_discovery_state pd_get_modes_discovery(int port,
* @return Mode VDO cnt of specified SVID if is discovered,
* 0 otherwise
*/
-int pd_get_mode_vdo_for_svid(int port, enum tcpm_transmit_type type,
+int pd_get_mode_vdo_for_svid(int port, enum tcpm_sop_type type,
uint16_t svid, uint32_t *vdo_out);
/**
@@ -1989,7 +1989,7 @@ int pd_get_mode_vdo_for_svid(int port, enum tcpm_transmit_type type,
* mode, if any exist and no modes succeeded in discovery;
* NULL, otherwise
*/
-struct svid_mode_data *pd_get_next_mode(int port, enum tcpm_transmit_type type);
+struct svid_mode_data *pd_get_next_mode(int port, enum tcpm_sop_type type);
/**
* Return a pointer to the discover identity response structure for this SOP*
@@ -2000,7 +2000,7 @@ struct svid_mode_data *pd_get_next_mode(int port, enum tcpm_transmit_type type);
* @return pointer to response structure, which the caller may not alter
*/
const union disc_ident_ack *pd_get_identity_response(int port,
- enum tcpm_transmit_type type);
+ enum tcpm_sop_type type);
/**
* Return the VID of the USB PD accessory connected to a specified port
@@ -2033,7 +2033,7 @@ uint8_t pd_get_product_type(int port);
* @param type SOP* type to retrieve
* @return SVID count
*/
-int pd_get_svid_count(int port, enum tcpm_transmit_type type);
+int pd_get_svid_count(int port, enum tcpm_sop_type type);
/**
* Return the SVID of given SVID index of port partner connected
@@ -2044,7 +2044,7 @@ int pd_get_svid_count(int port, enum tcpm_transmit_type type);
* @param type SOP* type to retrieve
* @return SVID
*/
-uint16_t pd_get_svid(int port, uint16_t svid_idx, enum tcpm_transmit_type type);
+uint16_t pd_get_svid(int port, uint16_t svid_idx, enum tcpm_sop_type type);
/**
* Return the pointer to modes of VDO of port partner connected
@@ -2056,7 +2056,7 @@ uint16_t pd_get_svid(int port, uint16_t svid_idx, enum tcpm_transmit_type type);
* @return Pointer to modes of VDO
*/
uint32_t *pd_get_mode_vdo(int port, uint16_t svid_idx,
- enum tcpm_transmit_type type);
+ enum tcpm_sop_type type);
/*
* Looks for a discovered mode VDO for the specified SVID.
@@ -2066,7 +2066,7 @@ uint32_t *pd_get_mode_vdo(int port, uint16_t svid_idx,
* @param svid SVID to look up
* @return Whether a mode was discovered for the SVID
*/
-bool pd_is_mode_discovered_for_svid(int port, enum tcpm_transmit_type type,
+bool pd_is_mode_discovered_for_svid(int port, enum tcpm_sop_type type,
uint16_t svid);
/**
@@ -2078,7 +2078,7 @@ bool pd_is_mode_discovered_for_svid(int port, enum tcpm_transmit_type type,
* @return pointer to SVDM mode data
*/
struct svdm_amode_data *pd_get_amode_data(int port,
- enum tcpm_transmit_type type, uint16_t svid);
+ enum tcpm_sop_type type, uint16_t svid);
/*
* Returns cable revision
@@ -2119,7 +2119,7 @@ bool consume_sop_prime_prime_repeat_msg(int port, uint8_t msg_id);
* @param port USB-C port number
* @param type Transmit type (SOP, SOP')
*/
-void pd_discovery_access_clear(int port, enum tcpm_transmit_type type);
+void pd_discovery_access_clear(int port, enum tcpm_sop_type type);
/*
* Validate that this current task is the only one which has retrieved the
@@ -2130,7 +2130,7 @@ void pd_discovery_access_clear(int port, enum tcpm_transmit_type type);
* @param type Transmit type (SOP, SOP')
* @return True - No other tasks have accessed the data
*/
-bool pd_discovery_access_validate(int port, enum tcpm_transmit_type type);
+bool pd_discovery_access_validate(int port, enum tcpm_sop_type type);
/*
* Returns the pointer to PD alternate mode discovery results
@@ -2147,7 +2147,7 @@ bool pd_discovery_access_validate(int port, enum tcpm_transmit_type type);
* @return pointer to PD alternate mode discovery results
*/
struct pd_discovery *pd_get_am_discovery(int port,
- enum tcpm_transmit_type type);
+ enum tcpm_sop_type type);
/*
* Returns the pointer to PD active alternate modes.
@@ -2158,7 +2158,7 @@ struct pd_discovery *pd_get_am_discovery(int port,
* @return Pointer to PD active alternate modes.
*/
struct partner_active_modes *pd_get_partner_active_modes(int port,
- enum tcpm_transmit_type type);
+ enum tcpm_sop_type type);
/*
* Sets the current object position for DP alt-mode
@@ -2306,7 +2306,7 @@ enum tbt_compat_rounded_support get_tbt_rounded_support(int port);
* @return Discover Mode VDO for Intel SVID if the Intel mode VDO is
* discovered, 0 otherwise
*/
-uint32_t pd_get_tbt_mode_vdo(int port, enum tcpm_transmit_type type);
+uint32_t pd_get_tbt_mode_vdo(int port, enum tcpm_sop_type type);
/**
* Sets the Mux state to Thunderbolt-Compatible mode
@@ -2333,7 +2333,7 @@ enum tbt_compat_cable_speed get_tbt_cable_speed(int port);
* @param payload payload data
* @return Number of object filled
*/
-int enter_tbt_compat_mode(int port, enum tcpm_transmit_type sop,
+int enter_tbt_compat_mode(int port, enum tcpm_sop_type sop,
uint32_t *payload);
/**
@@ -2462,7 +2462,7 @@ void pd_dpm_request(int port, enum pd_dpm_request req);
* must be 1 - 7 inclusive.
* @return True if the setup was successful
*/
-bool pd_setup_vdm_request(int port, enum tcpm_transmit_type tx_type,
+bool pd_setup_vdm_request(int port, enum tcpm_sop_type tx_type,
uint32_t *vdm, uint32_t vdo_cnt);
/* Power Data Objects for the source and the sink */
@@ -2496,7 +2496,7 @@ static inline void pd_send_host_event(int mask) { }
* @param svid USB standard or vendor id
* @return object position of mode chosen in alternate mode otherwise zero.
*/
-int pd_alt_mode(int port, enum tcpm_transmit_type type, uint16_t svid);
+int pd_alt_mode(int port, enum tcpm_sop_type type, uint16_t svid);
/**
* Send hpd over USB PD.