summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-09-25 11:58:04 -0600
committerCommit Bot <commit-bot@chromium.org>2020-10-05 18:11:36 +0000
commit2a045fdf01481da310dbe3f4c46569c0fd4b31e9 (patch)
tree2f9c23831d22d622e697d90ec954989ccbc1f05a
parentb0ae00fee75611adf4e265b67d3773b8bc371e50 (diff)
downloadchrome-ec-2a045fdf01481da310dbe3f4c46569c0fd4b31e9.tar.gz
TCPMv2: Add events to TYPEC_STATUS host command
Add retrieval of the event bits to the TYPEC_STATUS host command and ectool output. BRANCH=None BUG=b:167700356 TEST=on waddledoo, verify events show up in "ectool typecstatus" Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: If9f4f9b56acb6108c5f87f0d2ddf7a7d945f9403 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2432455 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usbc/usb_pd_host.c4
-rw-r--r--include/ec_commands.h4
-rw-r--r--util/ectool.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/common/usbc/usb_pd_host.c b/common/usbc/usb_pd_host.c
index ff5b540536..be9a1c81aa 100644
--- a/common/usbc/usb_pd_host.c
+++ b/common/usbc/usb_pd_host.c
@@ -147,7 +147,9 @@ static enum ec_status hc_typec_status(struct host_cmd_handler_args *args)
tc_state_name = pd_get_task_state_name(p->port);
strzcpy(r->tc_state, tc_state_name, sizeof(r->tc_state));
- /* TODO(b/167700356): Add events, revisions, and source cap PDOs */
+ r->events = pd_get_events(p->port);
+
+ /* TODO(b/167700356): Add revisions and source cap PDOs */
return EC_RES_SUCCESS;
}
diff --git a/include/ec_commands.h b/include/ec_commands.h
index dcc0a54bb7..226b71eab7 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -6487,7 +6487,9 @@ struct ec_response_typec_status {
char tc_state[32]; /* TC state name */
- /* TODO(b/167700356): Add events, revisions, and source cap PDOs */
+ uint32_t events; /* PD_STATUS_EVENT bitmask */
+
+ /* TODO(b/167700356): Add revisions and source cap PDOs */
} __ec_align1;
/*****************************************************************************/
diff --git a/util/ectool.c b/util/ectool.c
index 822501dc60..770c94e2e0 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -9665,6 +9665,8 @@ int cmd_typec_status(int argc, char *argv[])
!!(r->mux_state & USB_PD_MUX_USB4_ENABLED));
}
+ printf("Port events: 0x%08x\n", r->events);
+
return 0;
}