summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2020-11-20 15:55:07 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-24 00:02:48 +0000
commitc8a03c56d90d15e9138db2b22c8e8d94407418eb (patch)
treea4bce1c54c88cf71765b0f4ffc29105404445e64 /util
parentcac3d04165b61dfdceda4ac21ae284c7e10cdabe (diff)
downloadchrome-ec-c8a03c56d90d15e9138db2b22c8e8d94407418eb.tar.gz
genvif: USB_Comms_Capable should be YES if USB4_Supported
BUG=b:172293518 BRANCH=none TEST=verify XML output Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ic83fa9e9af4e8e4e4fc1e20635fa92d5d143531c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552859 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/genvif.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/util/genvif.c b/util/genvif.c
index 7776bc14ed..d7860b5c11 100644
--- a/util/genvif.c
+++ b/util/genvif.c
@@ -667,6 +667,21 @@ static bool is_usb_pd_supported(void)
return pd_supported;
}
+static bool is_usb_comms_capable(void)
+{
+ bool capable;
+
+ if (!get_vif_field_tag_bool(
+ &vif.Component[component_index]
+ .vif_field[USB_Comms_Capable],
+ &capable))
+ capable = is_usb4_supported() ||
+ (!(IS_ENABLED(CONFIG_USB_VPD) ||
+ IS_ENABLED(CONFIG_USB_CTVPD)));
+
+ return capable;
+}
+
static bool does_respond_to_discov_sop_ufp(void)
{
bool responds;
@@ -2741,8 +2756,7 @@ static void init_vif_component_general_pd_fields(
set_vif_field_b(&vif_fields[USB_Comms_Capable],
vif_component_name[USB_Comms_Capable],
- (!(IS_ENABLED(CONFIG_USB_VPD) ||
- IS_ENABLED(CONFIG_USB_CTVPD))));
+ is_usb_comms_capable());
{
bool supports_to_dfp = true;