summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/battery.c
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: Replace DT_ENUM_TOKEN with DT_STRING_TOKENJack Rosenthal2021-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* zephyr: add batteries to device treeMichał Barnaś2021-09-031-0/+69
This commit adds possibility to define board's batteries in device tree. Default battery is defined by adding "default_battery" as node's label. It also adds common batteries definitions that can be used using compatible string. If no 'batteries' node is defined in device tree, custom board's logic must be used and old "named-batteries" should be defined. BRANCH=main BUG=b:183544739 TEST=This commit shouldn't change behaviour of any build. Compiling and flashing CrOS EC and Zephyr should work without problems. Change-Id: I94f0121f45eb061f1358fadbcd7d8006c08b0bea Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3107385 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>