summaryrefslogtreecommitdiff
path: root/common/usbc
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-10-14 13:59:06 -0600
committerCommit Bot <commit-bot@chromium.org>2020-10-27 18:26:36 +0000
commit2aa710396ffb3924263676ef28e513c67e709989 (patch)
treec0f0af9159bbf8c24276709059b5224f2ac99f1f /common/usbc
parentfdc2f4f7d0818989075e1a0c4d5b6e2246edb570 (diff)
downloadchrome-ec-2aa710396ffb3924263676ef28e513c67e709989.tar.gz
TCPMv2: Report source capabilities in TYPEC_STATUS
Report the source capabilities for a port to the TYPEC_STATUS host command, and add decoding for the interesting fields here to ectool. BRANCH=None BUG=b:167700356 TEST=on waddledoo, confirm source capability decoding from ectool matches that from TotalPhase for servo_v4 and a charger Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib79c36c613c47fc60cfd8736202216ee40fbb42f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2473098 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2504134
Diffstat (limited to 'common/usbc')
-rw-r--r--common/usbc/usb_pd_host.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/usbc/usb_pd_host.c b/common/usbc/usb_pd_host.c
index bb5d003ebb..c009c16568 100644
--- a/common/usbc/usb_pd_host.c
+++ b/common/usbc/usb_pd_host.c
@@ -159,7 +159,11 @@ static enum ec_status hc_typec_status(struct host_cmd_handler_args *args)
PD_STATUS_REV_SET_MAJOR(pd_get_rev(p->port, TCPC_TX_SOP_PRIME))
: 0;
- /* TODO(b/167700356): Add sink and source cap PDOs */
+ r->source_cap_count = pd_get_src_cap_cnt(p->port);
+ memcpy(r->source_cap_pdos, pd_get_src_caps(p->port),
+ r->source_cap_count * sizeof(uint32_t));
+
+ /* TODO(b/167700356): Add sink cap PDOs */
return EC_RES_SUCCESS;
}