power: supply: add battery driver for AXP20X and AXP22X PMICs
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Tue, 18 Apr 2017 07:34:17 +0000 (09:34 +0200)
committerSebastian Reichel <sre@kernel.org>
Mon, 1 May 2017 09:52:23 +0000 (11:52 +0200)
commit46c202b5f25fb6fbd4af60ded133fa745b3601b3
treecb424e2f6f5c9e042d6b8a326ff99fba2d7e3c94
parent7221675c70d147f2ae6f044697dff046f3805224
power: supply: add battery driver for AXP20X and AXP22X PMICs

The X-Powers AXP20X and AXP22X PMICs can have a battery as power supply.

This patch adds the battery power supply driver to get various data from
the PMIC, such as the battery status (charging, discharging, full,
dead), current max limit, current current, battery capacity (in
percentage), voltage max and min limits, current voltage and battery
capacity (in Ah).

This battery driver uses the AXP20X/AXP22X ADC driver as PMIC data
provider.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/Kconfig
drivers/power/supply/Makefile
drivers/power/supply/axp20x_battery.c [new file with mode: 0644]