summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/src/battery.c')
-rw-r--r--zephyr/shim/src/battery.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/zephyr/shim/src/battery.c b/zephyr/shim/src/battery.c
index 73f72f2e81..cdf6e6d894 100644
--- a/zephyr/shim/src/battery.c
+++ b/zephyr/shim/src/battery.c
@@ -1,4 +1,4 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+/* Copyright 2021 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -8,7 +8,7 @@
#include "battery_fuel_gauge.h"
#define NODE_FUEL_GAUGE(node) \
-{ \
+ { \
.manuf_name = DT_PROP(node, manuf_name), \
.device_name = DT_PROP(node, device_name), \
.ship_mode = { \
@@ -22,7 +22,7 @@
.reg_data = DT_PROP_OR(node, sleep_mode_reg_data, 0), \
}, \
.fet = { \
- .mfgacc_support = DT_PROP_OR(node, fet_mgfacc_support, 0), \
+ .mfgacc_support = DT_PROP_OR(node, fet_mfgacc_support, 0), \
.reg_addr = DT_PROP_OR(node, fet_reg_addr, 0), \
.reg_mask = DT_PROP(node, fet_reg_mask), \
.disconnect_val = DT_PROP(node, fet_disconnect_val), \
@@ -34,32 +34,29 @@
(.imbalance_mv = DT_STRING_TOKEN(node, imbalance_mv),), ()) \
},
-#define NODE_BATT_INFO(node) \
-{ \
- .voltage_max = DT_PROP(node, voltage_max), \
- .voltage_normal = DT_PROP(node, voltage_normal), \
- .voltage_min = DT_PROP(node, voltage_min), \
- .precharge_voltage = DT_PROP_OR(node, precharge_voltage, 0), \
- .precharge_current = DT_PROP_OR(node, precharge_current, 0), \
- .start_charging_min_c = DT_PROP(node, start_charging_min_c), \
- .start_charging_max_c = DT_PROP(node, start_charging_max_c), \
- .charging_min_c = DT_PROP(node, charging_min_c), \
- .charging_max_c = DT_PROP(node, charging_max_c), \
- .discharging_min_c = DT_PROP(node, discharging_min_c), \
- .discharging_max_c = DT_PROP(node, discharging_max_c), \
-},
+#define NODE_BATT_INFO(node) \
+ { \
+ .voltage_max = DT_PROP(node, voltage_max), \
+ .voltage_normal = DT_PROP(node, voltage_normal), \
+ .voltage_min = DT_PROP(node, voltage_min), \
+ .precharge_voltage = DT_PROP_OR(node, precharge_voltage, 0), \
+ .precharge_current = DT_PROP_OR(node, precharge_current, 0), \
+ .start_charging_min_c = DT_PROP(node, start_charging_min_c), \
+ .start_charging_max_c = DT_PROP(node, start_charging_max_c), \
+ .charging_min_c = DT_PROP(node, charging_min_c), \
+ .charging_max_c = DT_PROP(node, charging_max_c), \
+ .discharging_min_c = DT_PROP(node, discharging_min_c), \
+ .discharging_max_c = DT_PROP(node, discharging_max_c), \
+ },
-#define NODE_BATT_PARAMS(node) \
-{ \
- .fuel_gauge = NODE_FUEL_GAUGE(node) \
- .batt_info = NODE_BATT_INFO(node) \
-},
+#define NODE_BATT_PARAMS(node) \
+ { .fuel_gauge = NODE_FUEL_GAUGE(node).batt_info = \
+ NODE_BATT_INFO(node) },
#if DT_HAS_COMPAT_STATUS_OKAY(battery_smart)
-const struct board_batt_params board_battery_info[] = {
- DT_FOREACH_STATUS_OKAY(battery_smart, NODE_BATT_PARAMS)
-};
+const struct board_batt_params board_battery_info[] = { DT_FOREACH_STATUS_OKAY(
+ battery_smart, NODE_BATT_PARAMS) };
#if DT_NODE_EXISTS(DT_NODELABEL(default_battery))
#define BAT_ENUM(node) DT_CAT(BATTERY_, node)