Skip to content

power_supply: bq27xxx: add calibration for bq34110

add two calibration procedures for the bq34110 fuel gauge

  • Board offset calibration: this is performed automatically by the device. This feature has not been tested

  • Voltage Divider calibration: Some boards use an external voltage divider to scale down the battery voltage at the VBAT pin. This is mandatory for batteries with cells more than 1 To get the right battery voltage enable the VEN_EN pin and then write the correct voltage divider into its corresponding data flash register The voltage divider value is computed using this formula : voltage_divider = [(R0 + R1) / R0 ] * 1000; with R0 and R1 the resistances that composes the voltage divider circuit R0 being the resistance connected to ground

add as well a delay between each read and write to the device otherwise the reads and writes will fail

perform the voltage_divider calibration at the begining of each probe and write registers only if they differ from the written values

Signed-off-by: Riadh Ghaddab rghaddab@baylibre.com

Merge request reports