Skip to content

Commit 0c9888e

Browse files
tmlindsre
authored andcommitted
power: supply: cpcap-charger: Add minimal CPCAP PMIC battery charger
The custom CPCAP PMIC used on Motorola phones such as Droid 4 has a USB battery charger. It can optionally also have a companion chip that is used for wireless charging. The charger on CPCAP also can feed VBUS for the USB host mode. This can be handled by the existing kernel phy_companion interface. Cc: devicetree@vger.kernel.org Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
1 parent da26580 commit 0c9888e

4 files changed

Lines changed: 727 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Motorola CPCAP PMIC battery charger binding
2+
3+
Required properties:
4+
- compatible: Shall be "motorola,mapphone-cpcap-charger"
5+
- interrupts: Interrupt specifier for each name in interrupt-names
6+
- interrupt-names: Should contain the following entries:
7+
"chrg_det", "rvrs_chrg", "chrg_se1b", "se0conn",
8+
"rvrs_mode", "chrgcurr1", "vbusvld", "battdetb"
9+
- io-channels: IIO ADC channel specifier for each name in io-channel-names
10+
- io-channel-names: Should contain the following entries:
11+
"battdetb", "battp", "vbus", "chg_isense", "batti"
12+
13+
Optional properties:
14+
- mode-gpios: Optionally CPCAP charger can have a companion wireless
15+
charge controller that is controlled with two GPIOs
16+
that are active low.
17+
18+
Example:
19+
20+
cpcap_charger: charger {
21+
compatible = "motorola,mapphone-cpcap-charger";
22+
interrupts-extended = <
23+
&cpcap 13 0 &cpcap 12 0 &cpcap 29 0 &cpcap 28 0
24+
&cpcap 22 0 &cpcap 20 0 &cpcap 19 0 &cpcap 54 0
25+
>;
26+
interrupt-names =
27+
"chrg_det", "rvrs_chrg", "chrg_se1b", "se0conn",
28+
"rvrs_mode", "chrgcurr1", "vbusvld", "battdetb";
29+
mode-gpios = <&gpio3 29 GPIO_ACTIVE_LOW
30+
&gpio3 23 GPIO_ACTIVE_LOW>;
31+
io-channels = <&cpcap_adc 0 &cpcap_adc 1
32+
&cpcap_adc 2 &cpcap_adc 5
33+
&cpcap_adc 6>;
34+
io-channel-names = "battdetb", "battp",
35+
"vbus", "chg_isense",
36+
"batti";
37+
};

drivers/power/supply/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ config BATTERY_RX51
317317
Say Y here to enable support for battery information on Nokia
318318
RX-51, also known as N900 tablet.
319319

320+
config CHARGER_CPCAP
321+
tristate "CPCAP PMIC Charger Driver"
322+
depends on MFD_CPCAP && IIO
323+
default MFD_CPCAP
324+
help
325+
Say Y to enable support for CPCAP PMIC charger driver for Motorola
326+
mobile devices such as Droid 4.
327+
320328
config CHARGER_ISP1704
321329
tristate "ISP1704 USB Charger Detection"
322330
depends on USB_PHY

drivers/power/supply/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
5151
obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o
5252
obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o
5353
obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o pm2301_charger.o
54+
obj-$(CONFIG_CHARGER_CPCAP) += cpcap-charger.o
5455
obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
5556
obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o
5657
obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o

0 commit comments

Comments
 (0)