summaryrefslogtreecommitdiff
path: root/zephyr/shim/src
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2022-03-24 11:43:00 +0100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-29 20:33:45 +0000
commit34fb416205ff1fca268023f61c9952442e3daf37 (patch)
tree322ea2716cbad3f00019690d16cb52f00a88fb47 /zephyr/shim/src
parentc19ceb263f1e45a41ec1608f06fd7690febab24c (diff)
downloadchrome-ec-34fb416205ff1fca268023f61c9952442e3daf37.tar.gz
zephyr: eliminate use of node path for battery support
Creating the array board_battery_info bases on DT_PATH(batteries) call. Change it to use a compatible string that is more consistent and doesn't depend on a node name. Use "battery-smart" for that purpose. The commit shouldn't change the output binaries. BUG=b:226404277 TEST=zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0c6ab3a02eb21c78c2b89480880a0d2ae8af3abb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3548917 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/src')
-rw-r--r--zephyr/shim/src/battery.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/zephyr/shim/src/battery.c b/zephyr/shim/src/battery.c
index 6c4f211eda..e64393f5b5 100644
--- a/zephyr/shim/src/battery.c
+++ b/zephyr/shim/src/battery.c
@@ -6,8 +6,6 @@
#include<devicetree.h>
#include"battery_fuel_gauge.h"
-#if DT_NODE_EXISTS(DT_PATH(batteries))
-
#define NODE_FUEL_GAUGE(node) \
{ \
.manuf_name = DT_PROP(node, manuf_name), \
@@ -56,8 +54,10 @@
.batt_info = NODE_BATT_INFO(node) \
},
+#if DT_HAS_COMPAT_STATUS_OKAY(battery_smart)
+
const struct board_batt_params board_battery_info[] = {
- DT_FOREACH_CHILD(DT_PATH(batteries), NODE_BATT_PARAMS)
+ DT_FOREACH_STATUS_OKAY(battery_smart, NODE_BATT_PARAMS)
};
#if DT_NODE_EXISTS(DT_NODELABEL(default_battery))
@@ -66,4 +66,4 @@ const enum battery_type DEFAULT_BATTERY_TYPE =
BATTERY_TYPE(DT_NODELABEL(default_battery));
#endif
-#endif /* DT_NODE_EXISTS(DT_PATH(batteries)) */
+#endif /* DT_HAS_COMPAT_STATUS_OKAY(battery_smart) */