From d7b77b62accbbe1d8086afffe288060a93cf7670 Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Mon, 27 Jun 2022 15:37:23 -0600 Subject: zephyr/shim/src/battery.c: Format with clang-format BUG=b:236386294 BRANCH=none TEST=none Change-Id: I4cfdd84ca0fdb48d3d2ec950bb4ffad3e25b5493 Signed-off-by: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730861 Reviewed-by: Jeremy Bettis --- zephyr/shim/src/battery.c | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) (limited to 'zephyr/shim/src/battery.c') diff --git a/zephyr/shim/src/battery.c b/zephyr/shim/src/battery.c index 73f72f2e81..37cc4db15a 100644 --- a/zephyr/shim/src/battery.c +++ b/zephyr/shim/src/battery.c @@ -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 = { \ @@ -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) -- cgit v1.2.1 From 71b2ef709dcb14260f5fdaa3ab4ced005a29fb46 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 12 Sep 2022 14:54:36 -0400 Subject: Update license boilerplate text in source code files Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis Reviewed-by: Jack Rosenthal --- zephyr/shim/src/battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zephyr/shim/src/battery.c') diff --git a/zephyr/shim/src/battery.c b/zephyr/shim/src/battery.c index 37cc4db15a..7decefbb01 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. */ -- cgit v1.2.1 From fa39878137aa84e7c3d072e8202d401abaec8e28 Mon Sep 17 00:00:00 2001 From: Zick Wei Date: Thu, 15 Sep 2022 18:43:41 +0800 Subject: zephyr: battery shim fix misspelling Fix misspelling in battery shim. BUG=b:246504615 BRANCH=none TEST=make sure battery can exit cutoff mode. Signed-off-by: Zick Wei Change-Id: I473bbef9e27d6ff7d409ea1fe3bec3af0bf3fa05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3897928 Reviewed-by: Peter Marheine Reviewed-by: Devin Lu Reviewed-by: Andrew McRae --- zephyr/shim/src/battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zephyr/shim/src/battery.c') diff --git a/zephyr/shim/src/battery.c b/zephyr/shim/src/battery.c index 7decefbb01..cdf6e6d894 100644 --- a/zephyr/shim/src/battery.c +++ b/zephyr/shim/src/battery.c @@ -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), \ -- cgit v1.2.1