power: supply: max17040: Support compatible devices
authorIskren Chernev <iskren.chernev@gmail.com>
Tue, 22 Sep 2020 11:42:34 +0000 (14:42 +0300)
committerSebastian Reichel <sre@kernel.org>
Sat, 3 Oct 2020 17:12:00 +0000 (19:12 +0200)
commit4f7f8e87c49e029a52318dd76d561860119d0372
tree72118d21bb0c34837ea5bce4d93a15e5b128fc9d
parent11a2bdc10f5b5e092ee84f8dc2966c78471909fd
power: supply: max17040: Support compatible devices

The max17040 fuel gauge is part of a family of 8 chips that have very
similar mode of operations and registers.

This change adds:
- compatible strings for all supported devices and handling for the
  minor differences between them;
- handling for devices reporting double capacity via maxim,double-soc;

The datasheets of the supported devices are linked [0] [1] [2] [3].

[0] https://datasheets.maximintegrated.com/en/ds/MAX17040-MAX17041.pdf
[1] https://datasheets.maximintegrated.com/en/ds/MAX17043-MAX17044.pdf
[2] https://datasheets.maximintegrated.com/en/ds/MAX17048-MAX17049.pdf
[3] https://datasheets.maximintegrated.com/en/ds/MAX17058-MAX17059.pdf

Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Tested-by: Jonathan Bakker <xc-racer2@live.ca>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/Kconfig
drivers/power/supply/max17040_battery.c