summaryrefslogtreecommitdiff
path: root/drivers/power/supply/ab8500-bm.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2021-11-20 16:53:13 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-11-22 17:16:25 +0100
commit6252c706cdb003da0046ced1a088b9f31af1fd9b (patch)
tree1c747054bca99530f432f1fa660ec6feb7d94929 /drivers/power/supply/ab8500-bm.h
parent3aca6ecdab44b30e812001ab4de19b79001a3fbd (diff)
downloadlwn-6252c706cdb003da0046ced1a088b9f31af1fd9b.tar.gz
lwn-6252c706cdb003da0046ced1a088b9f31af1fd9b.zip
power: supply: ab8500: Standardize operating temperature
Instead of storing the temperature limits in our custom struct struct ab8500_bm_data, make struct power_supply_battery_info a member of this and store the min and max temperatures inside that struct as the temp_min/temp_max and temp_alert_min/temp_alert_max respectively. The values can be assigned from the device tree, but if not present will be set to the same defaults as are currently in the code. This way we start to move over to using struct power_supply_battery_info and make it possible to move the data over to the device tree and we will move piece by piece toward using the standard info struct. Temperature hysteresis is currently not supported by the standard struct but we move the assignment here as well so that we have all parameterization in one spot. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/ab8500-bm.h')
-rw-r--r--drivers/power/supply/ab8500-bm.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/power/supply/ab8500-bm.h b/drivers/power/supply/ab8500-bm.h
index bcb054810290..fe783610bc54 100644
--- a/drivers/power/supply/ab8500-bm.h
+++ b/drivers/power/supply/ab8500-bm.h
@@ -460,10 +460,7 @@ struct ab8500_bm_charger_parameters {
/**
* struct ab8500_bm_data - ab8500 battery management data
- * @temp_under under this temp, charging is stopped
- * @temp_low between this temp and temp_under charging is reduced
- * @temp_high between this temp and temp_over charging is reduced
- * @temp_over over this temp, charging is stopped
+ * @bi battery info from device tree
* @temp_now present battery temperature
* @temp_interval_chg temperature measurement interval in s when charging
* @temp_interval_nochg temperature measurement interval in s when not charging
@@ -491,10 +488,7 @@ struct ab8500_bm_charger_parameters {
* @fg_params fuel gauge parameters
*/
struct ab8500_bm_data {
- int temp_under;
- int temp_low;
- int temp_high;
- int temp_over;
+ struct power_supply_battery_info bi;
int temp_now;
int temp_interval_chg;
int temp_interval_nochg;
@@ -564,6 +558,8 @@ int ab8500_fg_inst_curr_started(struct ab8500_fg *di);
int ab8500_fg_inst_curr_done(struct ab8500_fg *di);
int ab8500_bm_of_probe(struct power_supply *psy,
struct ab8500_bm_data *bm);
+void ab8500_bm_of_remove(struct power_supply *psy,
+ struct ab8500_bm_data *bm);
extern struct platform_driver ab8500_fg_driver;
extern struct platform_driver ab8500_btemp_driver;