summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-02-10 15:12:01 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-11 22:15:05 +0000
commitbd5e8c324045550215899f393cfdbce3ef506f9a (patch)
tree11e63ecd988d8d53d054f941269f9be0576d7c92
parenta8872ca8c5b8a6f5fd39a33d8b6762cf82c7d82a (diff)
downloadchrome-ec-bd5e8c324045550215899f393cfdbce3ef506f9a.tar.gz
EC_CMD_USB_PD_CONTROL: Always populate cable speed
For command version 3, always populate the TBT cable speed and generation, even if the mux isn't currently configured for TBT. For TBT and USB4 mux states, this is not a change from the existing code. For safe mode, populate the cable speed much earlier in time, reducing the chance for a stale EC_CMD_USB_PD_CONTROL command response to conflict with a more recent EC_CMD_USB_PD_MUX_INFO command response. BUG=b:173725284 TEST=make buildall TEST=Report Gen3 speed with Gen3 cable prior to Enter_USB BRANCH=firmware-volteer-13672.B-main Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ic38c62b8dfaf74932437e42daa30f79db3adc1ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2687720 Tested-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--common/usb_pd_host_cmd.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c
index c08332621b..e35f6241f8 100644
--- a/common/usb_pd_host_cmd.c
+++ b/common/usb_pd_host_cmd.c
@@ -307,7 +307,6 @@ static enum ec_status hc_usb_pd_control(struct host_cmd_handler_args *args)
struct ec_response_usb_pd_control_v1 *r_v1 = args->response;
struct ec_response_usb_pd_control *r = args->response;
const char *task_state_name;
- mux_state_t mux_state;
if (p->port >= board_get_usb_pd_port_count())
return EC_RES_INVALID_PARAM;
@@ -372,18 +371,8 @@ static enum ec_status hc_usb_pd_control(struct host_cmd_handler_args *args)
r_v2->control_flags = get_pd_control_flags(p->port);
if (IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP)) {
r_v2->dp_mode = get_dp_pin_mode(p->port);
- mux_state = usb_mux_get(p->port);
- if (mux_state & USB_PD_MUX_USB4_ENABLED) {
- r_v2->cable_speed =
- get_usb4_cable_speed(p->port);
- }
- if (mux_state & USB_PD_MUX_TBT_COMPAT_ENABLED ||
- mux_state & USB_PD_MUX_USB4_ENABLED) {
- r_v2->cable_speed =
- get_tbt_cable_speed(p->port);
- r_v2->cable_gen =
- get_tbt_rounded_support(p->port);
- }
+ r_v2->cable_speed = get_tbt_cable_speed(p->port);
+ r_v2->cable_gen = get_tbt_rounded_support(p->port);
}
if (args->version == 1)