diff options
-rw-r--r-- | common/battery_fuel_gauge.c | 7 | ||||
-rw-r--r-- | include/battery_fuel_gauge.h | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/common/battery_fuel_gauge.c b/common/battery_fuel_gauge.c index 444144dfeb..4a989a0db4 100644 --- a/common/battery_fuel_gauge.c +++ b/common/battery_fuel_gauge.c @@ -64,6 +64,11 @@ static int get_battery_type(void) return battery_type; } +__overridable int board_get_default_battery_type(void) +{ + return DEFAULT_BATTERY_TYPE; +} + /* * Initialize the battery type for the board. * @@ -82,7 +87,7 @@ static inline const struct board_batt_params *get_batt_params(void) int type = get_battery_type(); return &board_battery_info[type == BATTERY_TYPE_COUNT ? - DEFAULT_BATTERY_TYPE : type]; + board_get_default_battery_type() : type]; } const struct battery_info *battery_get_info(void) diff --git a/include/battery_fuel_gauge.h b/include/battery_fuel_gauge.h index 8b1b7106bd..36da40b274 100644 --- a/include/battery_fuel_gauge.h +++ b/include/battery_fuel_gauge.h @@ -71,6 +71,13 @@ int battery_bq4050_imbalance_mv(void); #endif /** + * Return the board-specific default battery type. + * + * @return a value of `enum battery_type`. + */ +__override_proto int board_get_default_battery_type(void); + +/** * Return 1 if CFET is disabled, 0 if enabled. -1 if an error was encountered. * If the CFET mask is not defined, it will return 0. */ |