fuel_gauge: Add init priority

Add an device driver initialization priority for fuel gauge drivers.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
This commit is contained in:
Aaron Massey 2023-03-16 10:31:27 -06:00 committed by Carles Cufí
parent b32b321f50
commit a2e0a860a6
2 changed files with 7 additions and 1 deletions

View file

@ -13,6 +13,12 @@ module = FUEL_GAUGE
module-str = fuel_gauge
source "subsys/logging/Kconfig.template.log_config"
config FUEL_GAUGE_INIT_PRIORITY
int "Battery Fuel Gauge init priority"
default 90
help
Battery fuel gauge initialization priority.
source "drivers/fuel_gauge/sbs_gauge/Kconfig"
endif # FUEL_GAUGE

View file

@ -214,6 +214,6 @@ static const struct fuel_gauge_driver_api sbs_gauge_driver_api = {
}; \
\
DEVICE_DT_INST_DEFINE(index, &sbs_gauge_init, NULL, NULL, &sbs_gauge_config_##index, \
POST_KERNEL, 90, &sbs_gauge_driver_api);
POST_KERNEL, CONFIG_FUEL_GAUGE_INIT_PRIORITY, &sbs_gauge_driver_api);
DT_INST_FOREACH_STATUS_OKAY(SBS_GAUGE_INIT)