summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2023-02-23 16:19:55 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-28 21:00:50 +0000
commitd06dad6213f10f976d14fd31c6af018cb1f1e0f5 (patch)
treed1a70a465b1746449e55dae4509d1268fea916e8
parent439a55ac8f8d241224a71db454d095f8d4840980 (diff)
downloadchrome-ec-d06dad6213f10f976d14fd31c6af018cb1f1e0f5.tar.gz
USB-PD: Fix RDO object position macros
RDO object positions are stored in B31...28, which account for 4 bits. This CL fixes the helper macros, which mask only B30...28, 3 bits. There is no functionality change. BUG=b:257320026 BRANCH=None TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I4f98f8e7faa7704a35ad33b64705e4cdeb3f2bd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290369 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--include/usb_pd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index ddc632e91c..0a56fd0f68 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -134,8 +134,8 @@ enum pd_rx_errors {
PDO_AUG_MAX_CURR(max_ma) | PDO_TYPE_AUGMENTED)
/* RDO : Request Data Object */
-#define RDO_OBJ_POS(n) (((n)&0x7) << 28)
-#define RDO_POS(rdo) (((rdo) >> 28) & 0x7)
+#define RDO_OBJ_POS(n) (((n)&0xF) << 28)
+#define RDO_POS(rdo) (((rdo) >> 28) & 0xF)
#define RDO_GIVE_BACK BIT(27)
#define RDO_CAP_MISMATCH BIT(26)
#define RDO_COMM_CAP BIT(25)