summaryrefslogtreecommitdiff
path: root/common/usbc/usb_pd_host.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2022-01-22 13:34:48 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-09 01:23:45 +0000
commit4797911678800b2192b2ce73415f1b477cc1d8ad (patch)
treeb1b0eb17404988f75819da70c62f8b5ee5d6b717 /common/usbc/usb_pd_host.c
parent2e5b1b1f36ddab0a6769a0e016ba0ac92263dbfd (diff)
downloadchrome-ec-4797911678800b2192b2ce73415f1b477cc1d8ad.tar.gz
TYPEC_CONTROL: Add new subcommand for TBT UFP behavior
Some systems may act as TBT UFPs under test scenarios, but generally have no reason to allow this behavior on released systems. Introduce a new command to allow the AP to control our TBT EnterMode UFP response. BRANCH=None BUG=b:213024508 TEST=on voxel, verify new command is present and returns unavailable Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I9f45132416882c812dc7f3a441e8462879c4a592 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3411534 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usbc/usb_pd_host.c')
-rw-r--r--common/usbc/usb_pd_host.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/usbc/usb_pd_host.c b/common/usbc/usb_pd_host.c
index 4d0fadeec3..d254e9827b 100644
--- a/common/usbc/usb_pd_host.c
+++ b/common/usbc/usb_pd_host.c
@@ -100,6 +100,14 @@ DECLARE_HOST_COMMAND(EC_CMD_TYPEC_DISCOVERY,
hc_typec_discovery,
EC_VER_MASK(0));
+/* Default to feature unavailable, with boards supporting it overriding */
+__overridable enum ec_status
+ board_set_tbt_ufp_reply(int port,
+ enum typec_tbt_ufp_reply reply)
+{
+ return EC_RES_UNAVAILABLE;
+}
+
static enum ec_status hc_typec_control(struct host_cmd_handler_args *args)
{
const struct ec_params_typec_control *p = args->params;
@@ -116,6 +124,8 @@ static enum ec_status hc_typec_control(struct host_cmd_handler_args *args)
break;
case TYPEC_CONTROL_COMMAND_ENTER_MODE:
return pd_request_enter_mode(p->port, p->mode_to_enter);
+ case TYPEC_CONTROL_COMMAND_TBT_UFP_REPLY:
+ return board_set_tbt_ufp_reply(p->port, p->tbt_ufp_reply);
default:
return EC_RES_INVALID_PARAM;
}