Skip to content

Commit

Permalink
power: supply: cpcap-battery: Add a battery driver
Browse files Browse the repository at this point in the history
On the CPCAP PMIC we can use the ADCs for monitoring the battery,
and there is also a coulomb counter. So let's add basic support for
the battery driver.

I did not add any capacity prediction as that should probably be
done in the user space. Or at least user space should tell the kernel
some battery statistics and then the kernel driver could display the
capacity based on that.

Cc: devicetree@vger.kernel.org
Cc: Marcel Partap <mpartap@gmx.net>
Cc: Michael Scott <michael.scott@linaro.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
  • Loading branch information
tmlind authored and sre committed Jun 8, 2017
1 parent 1483384 commit 874b2ad
Show file tree
Hide file tree
Showing 3 changed files with 817 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/power/supply/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ config BATTERY_ACT8945A
Say Y here to enable support for power supply provided by
Active-semi ActivePath ACT8945A charger.

config BATTERY_CPCAP
tristate "Motorola CPCAP PMIC battery driver"
depends on MFD_CPCAP && IIO
default MFD_CPCAP
help
Say Y here to enable support for battery on Motorola
phones and tablets such as droid 4.

config BATTERY_DS2760
tristate "DS2760 battery driver (HP iPAQ & others)"
depends on W1 && W1_SLAVE_DS2760
Expand Down
1 change: 1 addition & 0 deletions drivers/power/supply/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ obj-$(CONFIG_BATTERY_88PM860X) += 88pm860x_battery.o
obj-$(CONFIG_BATTERY_ACT8945A) += act8945a_charger.o
obj-$(CONFIG_BATTERY_AXP20X) += axp20x_battery.o
obj-$(CONFIG_CHARGER_AXP20X) += axp20x_ac_power.o
obj-$(CONFIG_BATTERY_CPCAP) += cpcap-battery.o
obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
obj-$(CONFIG_BATTERY_DS2780) += ds2780_battery.o
obj-$(CONFIG_BATTERY_DS2781) += ds2781_battery.o
Expand Down
Loading

0 comments on commit 874b2ad

Please sign in to comment.