summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2022-03-15 10:50:44 +0100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-23 20:10:20 +0000
commita308e0d074dd5800df39e16b1643f6e1bbb56308 (patch)
tree9bb8c87a421556e9d17e89d14466ed268051abb7
parent1fd9e3a00e64d21148a1211517f9f9e0f75337e9 (diff)
downloadchrome-ec-a308e0d074dd5800df39e16b1643f6e1bbb56308.tar.gz
zephyr: remove named-batteries node
Replace obsolete name-batteries node with the batteries node for tests. Once there are no more named-batteries nodes, remove all sources that are related to this concept. BUG=b:218888909 TEST=zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I6b438e71ccc96159b6e90d99a733d8ac20cf3b6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3541920 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/dts/bindings/battery/named-batteries.yaml29
-rw-r--r--zephyr/shim/include/battery_enum.h15
-rw-r--r--zephyr/test/drivers/overlay.dts8
-rw-r--r--zephyr/test/drivers/src/stubs.c36
4 files changed, 4 insertions, 84 deletions
diff --git a/zephyr/dts/bindings/battery/named-batteries.yaml b/zephyr/dts/bindings/battery/named-batteries.yaml
deleted file mode 100644
index 7bff38ec75..0000000000
--- a/zephyr/dts/bindings/battery/named-batteries.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-description: Named Batteries parent node
-
-compatible: "named-batteries"
-
-# TODO(b/218888909): Delete this file after all boards have been converted to
-# use the "batteries" node
-
-# This file is deprecated. Do not additional enum-name. Instead create
-# a new battery descriptor file matching the battery-info.yaml format.
-
-child-binding:
- description: Named batteries child node
- properties:
- enum-name:
- type: string
- required: true
- enum:
- - "aec,5477109"
- - "ap16l5j"
- - "ap16l5j_009"
- - "ap16l8j"
- - "c235"
- - "lgc011"
- - "lgc_ap18c8k"
- - "lgc_l20l3pg2"
- - "murata_ap18c4k"
- - "smp_l20m3pg0"
- - "smp,l20m3pg1"
- - "smp_l20m3pg2"
diff --git a/zephyr/shim/include/battery_enum.h b/zephyr/shim/include/battery_enum.h
index a461829a31..559fec76e8 100644
--- a/zephyr/shim/include/battery_enum.h
+++ b/zephyr/shim/include/battery_enum.h
@@ -13,24 +13,11 @@
#define BATTERY_TYPE_WITH_COMMA(id) BATTERY_TYPE(id),
/* This produces a list of BATTERY_<ENUM_NAME> identifiers */
-#if DT_NODE_EXISTS(DT_PATH(batteries))
-
enum battery_type {
+#if DT_NODE_EXISTS(DT_PATH(batteries))
DT_FOREACH_CHILD(DT_PATH(batteries), BATTERY_TYPE_WITH_COMMA)
-
- BATTERY_TYPE_COUNT,
-};
-
-#else /* DT_NODE_EXISTS(DT_PATH(batteries)) */
-
-enum battery_type {
-#if DT_NODE_EXISTS(DT_PATH(named_batteries))
- DT_FOREACH_CHILD(DT_PATH(named_batteries), BATTERY_TYPE_WITH_COMMA)
#endif
-
BATTERY_TYPE_COUNT,
};
-#endif /* DT_NODE_EXISTS(DT_PATH(batteries)) */
-
#undef BATTERY_TYPE_WITH_COMMA
diff --git a/zephyr/test/drivers/overlay.dts b/zephyr/test/drivers/overlay.dts
index 8b512f2eec..33e4795450 100644
--- a/zephyr/test/drivers/overlay.dts
+++ b/zephyr/test/drivers/overlay.dts
@@ -238,11 +238,9 @@
};
};
- named-batteries {
- compatible = "named-batteries";
-
- lgc011 {
- enum-name = "lgc011";
+ batteries {
+ default_battery: lgc_ac17a8m {
+ compatible = "lgc,ac17a8m";
};
};
diff --git a/zephyr/test/drivers/src/stubs.c b/zephyr/test/drivers/src/stubs.c
index b9aae5e8ef..5c66a9d13f 100644
--- a/zephyr/test/drivers/src/stubs.c
+++ b/zephyr/test/drivers/src/stubs.c
@@ -69,42 +69,6 @@ uint8_t board_get_charger_chip_count(void)
return ARRAY_SIZE(chg_chips);
}
-const struct board_batt_params board_battery_info[] = {
- /* LGC\011 L17L3PB0 Battery Information */
- /*
- * Battery info provided by ODM on b/143477210, comment #11
- */
- [BATTERY_LGC011] = {
- .fuel_gauge = {
- .manuf_name = "LGC",
- .ship_mode = {
- .reg_addr = 0x00,
- .reg_data = { 0x10, 0x10 },
- },
- .fet = {
- .reg_addr = 0x0,
- .reg_mask = 0x6000,
- .disconnect_val = 0x6000,
- }
- },
- .batt_info = {
- .voltage_max = TARGET_WITH_MARGIN(13200, 5),
- .voltage_normal = 11550, /* mV */
- .voltage_min = 9000, /* mV */
- .precharge_current = 256, /* mA */
- .start_charging_min_c = 0,
- .start_charging_max_c = 45,
- .charging_min_c = 0,
- .charging_max_c = 60,
- .discharging_min_c = 0,
- .discharging_max_c = 75,
- },
- },
-};
-BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT);
-
-const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_LGC011;
-
int board_set_active_charge_port(int port)
{
int is_real_port = (port >= 0 &&