summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Honscheid <honscheid@google.com>2022-08-29 16:08:46 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-29 23:51:30 +0000
commit39e695d3c81ff45d0a62960967a569d808768ce1 (patch)
tree473ebe947efabb9a049e7e0598bb5430b59a193d
parent7aa894e15600b02819119a02ca52bd8875009759 (diff)
downloadchrome-ec-39e695d3c81ff45d0a62960967a569d808768ce1.tar.gz
zephyr: Use DT_STRING_UPPER_TOKEN_BY_IDX
Use the new DT_STRING_UPPER_TOKEN_BY_IDX() macro to create the enum of i2c ports in i2c.h. This replaces a homegrown DT macro that no longer works and is blocking downstreaming BUG=None BRANCH=NOne TEST=./twister; zmake build herobrine Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Ib9fcea829e5e11b079bcec05d253fba52ab6915c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864143 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/shim/include/i2c/i2c.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/zephyr/shim/include/i2c/i2c.h b/zephyr/shim/include/i2c/i2c.h
index e611e2933b..bee8f794ca 100644
--- a/zephyr/shim/include/i2c/i2c.h
+++ b/zephyr/shim/include/i2c/i2c.h
@@ -159,10 +159,8 @@ enum i2c_ports_chip {
BUILD_ASSERT(I2C_PORT_COUNT != 0, "No I2C devices defined");
-#define DT_PROP_BY_IDX_UPPER_TOKEN(id, prop, idx) \
- DT_PROP(id, prop##_IDX_##idx##_UPPER_TOKEN)
-#define I2C_PORT_ENUM_IDX_COMMA(i2c_named_id, prop, idx) \
- DT_PROP_BY_IDX_UPPER_TOKEN(i2c_named_id, prop, idx) = \
+#define I2C_PORT_ENUM_IDX_COMMA(i2c_named_id, prop, idx) \
+ DT_STRING_UPPER_TOKEN_BY_IDX(i2c_named_id, prop, idx) = \
I2C_PORT(i2c_named_id),
#define NAMED_I2C_PORT_COMMA(i2c_named_id) \
DT_FOREACH_PROP_ELEM(i2c_named_id, enum_names, I2C_PORT_ENUM_IDX_COMMA)