History

platform/chrome: cros_ec_typec: Send mux configuration acknowledgment to EC

In some corner cases downgrade of the superspeed typec device(e.g. Dell typec Dock, apple dongle) was seen because before the SOC mux configuration finishes, EC starts configuring the next mux state. With this change, once the SOC mux is configured, kernel will send an acknowledgment to EC via Host command EC_CMD_USB_PD_MUX_ACK [1]. After sending the host event EC will wait for the acknowledgment from kernel before starting the PD negotiation for the next mux state. This helps to have a framework to build better error handling along with the synchronization of timing sensitive mux states. This change also brings in corresponding EC header updates from the EC code base [1]. [1]: https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/master/include/ec_commands.h

Utkarsh Patel committed 5 years ago

Commit 8553a971 parent ba8ce512 files · +33 −0Browse files

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

Unified · Split

include/linux/platform_data/cros_ec_commands.h+17−0
@@ -1286,6 +1286,16 @@ enum ec_feature_code { · 1285 unmodified lines
12861286 EC_FEATURE_ISH = 40,
12871287 /* New TCPMv2 TYPEC_ prefaced commands supported */
12881288 EC_FEATURE_TYPEC_CMD = 41,
1289+ /*
1290+ * The EC will wait for direction from the AP to enter Type-C alternate
1291+ * modes or USB4.
1292+ */
1293+ EC_FEATURE_TYPEC_REQUIRE_AP_MODE_ENTRY = 42,
1294+ /*
1295+ * The EC will wait for an acknowledge from the AP after setting the
1296+ * mux.
1297+ */
1298+ EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK = 43,
12891299 };
12901300
12911301 #define EC_FEATURE_MASK_0(event_code) BIT(event_code % 32)
@@ -6054,6 +6064,13 @@ struct ec_params_charger_control { · 4762 unmodified lines
60546064 uint8_t allow_charging;
60556065 } __ec_align_size1;
60566066
6067+/* Get ACK from the USB-C SS muxes */
6068+#define EC_CMD_USB_PD_MUX_ACK 0x0603
6069+
6070+struct ec_params_usb_pd_mux_ack {
6071+ uint8_t port; /* USB-C port number */
6072+} __ec_align1;
6073+
60576074 /*****************************************************************************/
60586075 /*
60596076 * Reserve a range of host commands for board-specific, experimental, or