diff options
author | Diana Z <dzigterman@chromium.org> | 2020-10-09 13:42:42 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-21 00:26:39 +0000 |
commit | 49f4704e9a11d69e915bccb725ba509323925297 (patch) | |
tree | 32fc7394479f516904fe7ad81a6d5fea6133586e /common | |
parent | f420b2073e02a2e745bb4c43f4144cf60045b7be (diff) | |
download | chrome-ec-49f4704e9a11d69e915bccb725ba509323925297.tar.gz |
TCPMv2: Report partner PD revisions in TYPEC_STATUS
Gather and report both SOP and SOP' revisions for port partners.
BRANCH=None
BUG=b:167700356
TEST=on waddledoo, confirmed SOP and SOP' revisions were reported
correctly with:
- active cable and non-PD partner
- PD 3.0 dock and active cable
- PD 2.0 dock and active cable
- PD 3.0 and PD 2.0 partners with no e-mark cable
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I6448e5b80212b171a44864f90ae5cdfecbcb7244
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2473097
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usbc/usb_pd_host.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/usbc/usb_pd_host.c b/common/usbc/usb_pd_host.c index 61c1c69966..bb5d003ebb 100644 --- a/common/usbc/usb_pd_host.c +++ b/common/usbc/usb_pd_host.c @@ -152,7 +152,14 @@ static enum ec_status hc_typec_status(struct host_cmd_handler_args *args) r->events = pd_get_events(p->port); - /* TODO(b/167700356): Add revisions and source cap PDOs */ + r->sop_revision = r->sop_connected ? + PD_STATUS_REV_SET_MAJOR(pd_get_rev(p->port, TCPC_TX_SOP)) : 0; + r->sop_prime_revision = pd_get_identity_discovery(p->port, + TCPC_TX_SOP_PRIME) == PD_DISC_COMPLETE ? + PD_STATUS_REV_SET_MAJOR(pd_get_rev(p->port, TCPC_TX_SOP_PRIME)) + : 0; + + /* TODO(b/167700356): Add sink and source cap PDOs */ return EC_RES_SUCCESS; } |