1
0
Fork 0

max77818-battery: add support for tGain/tOFF/tCurve FG params

Read tGain/tOFF/tCurve from DT during driver init.

Note:
FG/battery driver has to re-init the device for changes to occur on
already configured devices, and this is normally only done right after
initial power-on with un-configured device.

A solution for this is however under development, which will make sure
that selected FG parameters are validated during each boot.
pull/10/head
Steinar Bakkemo 2020-10-06 11:16:56 +02:00
parent 2051f54210
commit e9e3814946
2 changed files with 7 additions and 0 deletions

View File

@ -731,6 +731,12 @@ static void max77818_write_custom_params(struct max77818_chip *chip)
max77818_read_param(chip, "maxim,filter-cfg"));
regmap_write(map, MAX17042_LAvg_empty,
max77818_read_param(chip, "maxim,iavg-empty"));
regmap_write(map, MAX17042_TGAIN,
max77818_read_param(chip, "maxim,tgain"));
regmap_write(map, MAx17042_TOFF,
max77818_read_param(chip, "maxim,toff"));
regmap_write(map, MAX77818_TCURVE,
max77818_read_param(chip, "maxim,tcurve"));
/* The order of the following ones should be respected */
regmap_write(map, MAX17042_AtRate,

View File

@ -138,6 +138,7 @@ enum max77818_register {
MAX77818_TTF = 0x20,
MAX77818_ConvgCfg = 0x49,
MAX77818_Config2 = 0xBB,
MAX77818_TCURVE = 0xB9,
MAX77818_SmartChgCfg = 0xDB,
};