From ff7a100aaf125c95a7c88e70b409cb3e377ace43 Mon Sep 17 00:00:00 2001 From: Keith Short Date: Thu, 30 Apr 2020 17:47:32 -0600 Subject: it83xx tcpc: Captured received SOP message type Add support to the IT83xx TCPC driver to capture the received SOP messaage type, matching the implementation of all other TCPC drivers. This change also does a minor cleanup of the PD_HEADER_SOP macro to ensure callers cannot overflow the field. BUG=none BRANCH=none TEST=make buildall -j Signed-off-by: Keith Short Change-Id: I63d324761538c6fe1ae6cee9ad172ee052c474b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2173303 Tested-by: Diana Z Reviewed-by: Diana Z Commit-Queue: Diana Z --- include/usb_pd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/usb_pd.h b/include/usb_pd.h index 96d468839b..6033a4cfa0 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1183,7 +1183,7 @@ enum cable_outlet { * NOTE: This is not part of the PD spec. */ #define PD_HEADER_GET_SOP(header) (((header) >> 28) & 0xf) -#define PD_HEADER_SOP(sop) ((sop) << 28) +#define PD_HEADER_SOP(sop) (((sop) & 0xf) << 28) enum pd_msg_type { PD_MSG_SOP, -- cgit v1.2.1