summaryrefslogtreecommitdiff
path: root/zephyr/emul/emul_smart_battery.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-09-07 09:30:22 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-07 17:32:58 +0000
commitf8cbf77dc5dc10b21d3baa50e7bb3ec3c280380f (patch)
tree1c8289d90d2aedcbd620746d44102acd383404f0 /zephyr/emul/emul_smart_battery.c
parentc96175bef0c7985f55e0fc82c89d79d5b1adf2f5 (diff)
downloadchrome-ec-f8cbf77dc5dc10b21d3baa50e7bb3ec3c280380f.tar.gz
zephyr: Replace DT_ENUM_TOKEN with DT_STRING_TOKEN
In Zephyr v2.7, DT_ENUM_TOKEN is deprecated in favor of DT_STRING_TOKEN. Additionally, DT_ENUM_UPPER_TOKEN is deprecated in favor of DT_STRING_UPPER_TOKEN. See the v2.7 release notes for details: https://docs.zephyrproject.org/latest/releases/release-notes-2.7.html Since we backported the DT_STRING_* macros to our v2.6 branch, let's switch to them ahead of time to prepare for the v2.7 uprev. Note: the DT_STRING_* macros are compatible with Zephyr's device tree enums, but also allow non-enum properties to be used in the same fashion. This commit does the bare minimum for compatibility with v2.7, i.e., just swap the macros without dropping enum properties anywhere. We should investigate whether we want to continue using the enum properties or abandon some of them for any string in the future. BUG=b:198824039 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I1efd8f99bc7d93504c0ab94510406cd36ad24cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3144536 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/emul/emul_smart_battery.c')
-rw-r--r--zephyr/emul/emul_smart_battery.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/zephyr/emul/emul_smart_battery.c b/zephyr/emul/emul_smart_battery.c
index f7e13624cb..1fbc5b4993 100644
--- a/zephyr/emul/emul_smart_battery.c
+++ b/zephyr/emul/emul_smart_battery.c
@@ -805,8 +805,8 @@ static int sbat_emul_init(const struct emul *emul,
.mf_access = DT_INST_PROP(n, mf_access), \
.at_rate_full_mw_support = DT_INST_PROP(n, \
at_rate_full_mw_support), \
- .spec_info = ((DT_ENUM_TOKEN(DT_DRV_INST(n), \
- version) << \
+ .spec_info = ((DT_STRING_TOKEN(DT_DRV_INST(n), \
+ version) << \
BATTERY_SPEC_VERSION_SHIFT) & \
BATTERY_SPEC_VERSION_MASK) | \
((DT_INST_PROP(n, vscale) << \