mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-23 08:55:56 -04:00
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 Signed-off-by: Utkarsh Patel <utkarsh.h.patel@intel.com> Reviewed-by: Prashant Malani <pmalani@chromium.org> Signed-off-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20201210060903.2205-3-utkarsh.h.patel@intel.com
This commit is contained in:
committed by
Benson Leung
parent
ba8ce51545
commit
8553a979fc
@@ -1286,6 +1286,16 @@ enum ec_feature_code {
|
||||
EC_FEATURE_ISH = 40,
|
||||
/* New TCPMv2 TYPEC_ prefaced commands supported */
|
||||
EC_FEATURE_TYPEC_CMD = 41,
|
||||
/*
|
||||
* The EC will wait for direction from the AP to enter Type-C alternate
|
||||
* modes or USB4.
|
||||
*/
|
||||
EC_FEATURE_TYPEC_REQUIRE_AP_MODE_ENTRY = 42,
|
||||
/*
|
||||
* The EC will wait for an acknowledge from the AP after setting the
|
||||
* mux.
|
||||
*/
|
||||
EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK = 43,
|
||||
};
|
||||
|
||||
#define EC_FEATURE_MASK_0(event_code) BIT(event_code % 32)
|
||||
@@ -6054,6 +6064,13 @@ struct ec_params_charger_control {
|
||||
uint8_t allow_charging;
|
||||
} __ec_align_size1;
|
||||
|
||||
/* Get ACK from the USB-C SS muxes */
|
||||
#define EC_CMD_USB_PD_MUX_ACK 0x0603
|
||||
|
||||
struct ec_params_usb_pd_mux_ack {
|
||||
uint8_t port; /* USB-C port number */
|
||||
} __ec_align1;
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* Reserve a range of host commands for board-specific, experimental, or
|
||||
|
||||
Reference in New Issue
Block a user