diff options
author | Diana Z <dzigterman@chromium.org> | 2020-09-25 11:58:04 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-05 18:11:36 +0000 |
commit | 2a045fdf01481da310dbe3f4c46569c0fd4b31e9 (patch) | |
tree | 2f9c23831d22d622e697d90ec954989ccbc1f05a | |
parent | b0ae00fee75611adf4e265b67d3773b8bc371e50 (diff) | |
download | chrome-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.c | 4 | ||||
-rw-r--r-- | include/ec_commands.h | 4 | ||||
-rw-r--r-- | util/ectool.c | 2 |
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; } |