History

platform/chrome: Add Type-C mux set command definitions

Copy EC header definitions for the USB Type-C Mux control command from the EC code base. Also pull in "TBT_UFP_REPLY" definitions, since that is the prior entry in the enum. These headers are already present in the EC code base. [1] [1] https://chromium.googlesource.com/chromiumos/platform/ec/+/b80f85a94a423273c1638ef7b662c56931a138dd/include/ec_commands.h

Prashant Malani committed 4 years ago

Commit 77947231 parent f74c7551 file · +18 −0Browse files

Showing the changes to include/linux/platform_data (1 of 1 file). Show all

Unified · Split

include/linux/platform_data/cros_ec_commands.h+18−0
@@ -5724,8 +5724,21 @@ enum typec_control_command { · 5723 unmodified lines
57245724 TYPEC_CONTROL_COMMAND_EXIT_MODES,
57255725 TYPEC_CONTROL_COMMAND_CLEAR_EVENTS,
57265726 TYPEC_CONTROL_COMMAND_ENTER_MODE,
5727+ TYPEC_CONTROL_COMMAND_TBT_UFP_REPLY,
5728+ TYPEC_CONTROL_COMMAND_USB_MUX_SET,
57275729 };
57285730
5731+/* Replies the AP may specify to the TBT EnterMode command as a UFP */
5732+enum typec_tbt_ufp_reply {
5733+ TYPEC_TBT_UFP_REPLY_NAK,
5734+ TYPEC_TBT_UFP_REPLY_ACK,
5735+};
5736+
5737+struct typec_usb_mux_set {
5738+ uint8_t mux_index; /* Index of the mux to set in the chain */
5739+ uint8_t mux_flags; /* USB_PD_MUX_*-encoded USB mux state to set */
5740+} __ec_align1;
5741+
57295742 struct ec_params_typec_control {
57305743 uint8_t port;
57315744 uint8_t command; /* enum typec_control_command */
@@ -5739,6 +5752,8 @@ struct ec_params_typec_control { · 7 unmodified lines
57395752 union {
57405753 uint32_t clear_events_mask;
57415754 uint8_t mode_to_enter; /* enum typec_mode */
5755+ uint8_t tbt_ufp_reply; /* enum typec_tbt_ufp_reply */
5756+ struct typec_usb_mux_set mux_params;
57425757 uint8_t placeholder[128];
57435758 };
57445759 } __ec_align1;
@@ -5817,6 +5832,9 @@ enum tcpc_cc_polarity { · 72 unmodified lines
58175832 #define PD_STATUS_EVENT_SOP_DISC_DONE BIT(0)
58185833 #define PD_STATUS_EVENT_SOP_PRIME_DISC_DONE BIT(1)
58195834 #define PD_STATUS_EVENT_HARD_RESET BIT(2)
5835+#define PD_STATUS_EVENT_DISCONNECTED BIT(3)
5836+#define PD_STATUS_EVENT_MUX_0_SET_DONE BIT(4)
5837+#define PD_STATUS_EVENT_MUX_1_SET_DONE BIT(5)
58205838
58215839 struct ec_params_typec_status {
58225840 uint8_t port;