summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-09-25 07:50:15 -0600
committerCommit Bot <commit-bot@chromium.org>2019-09-26 05:58:44 +0000
commit068b917ef17383c1cf8987d070b27fea30a72d75 (patch)
tree1c036c36ef0f7d0b6c44b4eb437ccc11edd9d994 /include
parent881d05951d94345c7c5bdea909cf5d393bd66a57 (diff)
downloadchrome-ec-068b917ef17383c1cf8987d070b27fea30a72d75.tar.gz
cleanup: remove copy of pd_cc_state enum
The EC command interface created a separate copy of the enum pd_cc_state. Remove the EC command version and move the pd_cc_state definition to the command interface. Also remove PD_CC_NO_UFP option as there is no difference between that value and PD_CC_NONE. Split PD_CC_DEBUG_ACC into separate UFP and DFP values for clarity. BRANCH=none BUG=none TEST=builds Change-Id: Ic8c4c5ac4dd340b1e605100e35acb147c226a455 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1825503 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Sam Hurst <shurst@google.com>
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 */