summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ec_commands.h26
-rw-r--r--include/usb_pd.h13
2 files changed, 16 insertions, 23 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 30783bc1bb..2ce5ca5271 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -5102,13 +5102,19 @@ struct ec_response_usb_pd_control_v1 {
char state[32];
} __ec_align1;
-/* Values representing usbc PD CC state */
-#define USBC_PD_CC_NONE 0 /* No accessory connected */
-#define USBC_PD_CC_NO_UFP 1 /* No UFP accessory connected */
-#define USBC_PD_CC_AUDIO_ACC 2 /* Audio accessory connected */
-#define USBC_PD_CC_DEBUG_ACC 3 /* Debug accessory connected */
-#define USBC_PD_CC_UFP_ATTACHED 4 /* UFP attached to usbc */
-#define USBC_PD_CC_DFP_ATTACHED 5 /* DPF attached to usbc */
+/* Possible port partner connections based on CC line states */
+enum pd_cc_states {
+ PD_CC_NONE = 0, /* No port partner attached */
+
+ /* From DFP perspective */
+ PD_CC_UFP_AUDIO_ACC = 2, /* UFP Audio accessory connected */
+ PD_CC_UFP_DEBUG_ACC = 3, /* UFP Debug accessory connected */
+ PD_CC_UFP_ATTACHED = 4, /* Plain UFP attached */
+
+ /* From UFP perspective */
+ PD_CC_DFP_DEBUG_ACC = 6, /* DFP debug accessory connected */
+ PD_CC_DFP_ATTACHED = 5, /* Plain DFP attached */
+};
#define USBC_CABLE_TYPE_UNDEF 0 /* Undefined */
#define USBC_CABLE_TYPE_PASSIVE 3 /* Passive cable attached */
@@ -5119,9 +5125,9 @@ struct ec_response_usb_pd_control_v2 {
uint8_t role;
uint8_t polarity;
char state[32];
- uint8_t cc_state; /* USBC_PD_CC_*Encoded cc state */
- uint8_t dp_mode; /* Current DP pin mode (MODE_DP_PIN_[A-E]) */
- uint8_t cable_type; /* USBC_CABLE_TYPE_*cable_type */
+ uint8_t cc_state; /* enum pd_cc_states representing cc state */
+ uint8_t dp_mode; /* Current DP pin mode (MODE_DP_PIN_[A-E]) */
+ uint8_t cable_type; /* USBC_CABLE_TYPE_*cable_type */
} __ec_align1;
#define EC_CMD_USB_PD_PORTS 0x0102
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 0c58138d1b..70b37f19ef 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1109,19 +1109,6 @@ enum pd_states {
/* Initial value for CC debounce variable */
#define PD_CC_UNSET -1
-enum pd_cc_states {
- PD_CC_NONE,
-
- /* From DFP perspective */
- PD_CC_NO_UFP,
- PD_CC_AUDIO_ACC,
- PD_CC_DEBUG_ACC,
- PD_CC_UFP_ATTACHED,
-
- /* From UFP perspective */
- PD_CC_DFP_ATTACHED
-};
-
#ifdef CONFIG_USB_PD_DUAL_ROLE
enum pd_dual_role_states {
/* While disconnected, toggle between src and sink */