summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-08-18 09:25:45 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-19 19:10:30 +0000
commit4c3dd46682bf729d01ed76868176da99e234acc7 (patch)
treedbaf3928fcd9cec1f3552a6f4fca72c7afc476c8
parent529612865145ed8d4d3db5f4cbad1d970d9275d9 (diff)
downloadchrome-ec-4c3dd46682bf729d01ed76868176da99e234acc7.tar.gz
TCPM common: Store number of Identity VDOs
Store the number of valid identity VDOs that were received for use later. BRANCH=None BUG=b:165264379 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I54f991c862c4b6589edff2476a79b5c3a8b69b4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363416 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usb_pd_alt_mode_dfp.c1
-rw-r--r--include/usb_pd.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c
index 4c0345ff29..0cd5b2821e 100644
--- a/common/usb_pd_alt_mode_dfp.c
+++ b/common/usb_pd_alt_mode_dfp.c
@@ -334,6 +334,7 @@ void dfp_consume_identity(int port, enum tcpm_transmit_type type, int cnt,
/* Note: only store VDOs, not the VDM header */
memcpy(disc->identity.raw_value, payload + 1, identity_size);
+ disc->identity_cnt = identity_size / sizeof(uint32_t);
switch (ptype) {
case IDH_PTYPE_AMA:
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 2a6558429f..bdadab0aae 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -387,6 +387,8 @@ enum pd_alternate_modes {
struct pd_discovery {
/* Identity data */
union disc_ident_ack identity;
+ /* Identity VDO count */
+ int identity_cnt;
/* Supported SVIDs and corresponding mode VDOs */
struct svid_mode_data svids[SVID_DISCOVERY_MAX];
/* index of SVID currently being operated on */