Skip to content

Commit

Permalink
Merge tag 'for-4.2' of git://git.infradead.org/battery-2.6
Browse files Browse the repository at this point in the history
Pull power supply and reset updates from Sebastian Reichel:

 - new charger drivers: BQ24257, BQ25890, AXP288, RT9455

 - MAX17042 battery: add health & temperature support

 - BQ2415x charger: add ACPI support

 - misc fixes and cleanups

* tag 'for-4.2' of git://git.infradead.org/battery-2.6: (32 commits)
  power_supply: Correct kerneldoc copy paste errors
  wm831x_power: Fix off-by-one at free_irq()
  power_supply: rt9455_charger: Fix error reported by static analysis tool
  power_supply: bq24257: use flags argument of devm_gpiod_get
  power_supply: bq25890: use flags argument of devm_gpiod_get
  sbs-battery: add option to always register battery
  power: Add devm_power_supply_get_by_phandle() helper function
  power_supply: max17042: Add OF support for setting thresholds
  power_supply: sysfs: Bring back write to writeable properties
  power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabled
  power: reset: gpio-restart: increase priority slightly
  power_supply: bq25890: make chip_id int
  power_supply: Add support for Richtek RT9455 battery charger
  Documentation: devicetree: Add Richtek RT9455 bindings
  of: Add vendor prefix for Richtek Technology Corporation
  power_supply: 88pm860x_charger: Do not call free_irq() twice
  power: bq24190_charger: Change first_time flag reset condition
  power: axp288_charger: axp288 charger driver
  power: max17042_battery: add HEALTH and TEMP_* properties support
  power_supply: Add support for TI BQ25890 charger chip
  ...
  • Loading branch information
torvalds committed Jun 23, 2015
2 parents 5262f25 + 43df610 commit 36a1624
Show file tree
Hide file tree
Showing 29 changed files with 5,122 additions and 88 deletions.
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/power/bq24257.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Binding for TI bq24257 Li-Ion Charger

Required properties:
- compatible: Should contain one of the following:
* "ti,bq24257"
- reg: integer, i2c address of the device.
- ti,battery-regulation-voltage: integer, maximum charging voltage in uV.
- ti,charge-current: integer, maximum charging current in uA.
- ti,termination-current: integer, charge will be terminated when current in
constant-voltage phase drops below this value (in uA).

Example:

bq24257 {
compatible = "ti,bq24257";
reg = <0x6a>;

ti,battery-regulation-voltage = <4200000>;
ti,charge-current = <1000000>;
ti,termination-current = <50000>;
};
46 changes: 46 additions & 0 deletions Documentation/devicetree/bindings/power/bq25890.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Binding for TI bq25890 Li-Ion Charger

Required properties:
- compatible: Should contain one of the following:
* "ti,bq25890"
- reg: integer, i2c address of the device.
- ti,battery-regulation-voltage: integer, maximum charging voltage (in uV);
- ti,charge-current: integer, maximum charging current (in uA);
- ti,termination-current: integer, charge will be terminated when current in
constant-voltage phase drops below this value (in uA);
- ti,precharge-current: integer, maximum charge current during precharge
phase (in uA);
- ti,minimum-sys-voltage: integer, when battery is charging and it is below
minimum system voltage, the system will be regulated above
minimum-sys-voltage setting (in uV);
- ti,boost-voltage: integer, VBUS voltage level in boost mode (in uV);
- ti,boost-max-current: integer, maximum allowed current draw in boost mode
(in uA).

Optional properties:
- ti,boost-low-freq: boolean, if present boost mode frequency will be 500kHz,
otherwise 1.5MHz;
- ti,use-ilim-pin: boolean, if present the ILIM resistor will be used and the
input current will be the lower between the resistor setting and the IINLIM
register setting;
- ti,thermal-regulation-threshold: integer, temperature above which the charge
current is lowered, to avoid overheating (in degrees Celsius). If omitted,
the default setting will be used (120 degrees);

Example:

bq25890 {
compatible = "ti,bq25890";
reg = <0x6a>;

ti,battery-regulation-voltage = <4200000>;
ti,charge-current = <1000000>;
ti,termination-current = <50000>;
ti,precharge-current = <128000>;
ti,minimum-sys-voltage = <3600000>;
ti,boost-voltage = <5000000>;
ti,boost-max-current = <1000000>;

ti,use-ilim-pin;
ti,thermal-regulation-threshold = <120>;
};
48 changes: 48 additions & 0 deletions Documentation/devicetree/bindings/power/rt9455_charger.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Binding for Richtek rt9455 battery charger

Required properties:
- compatible: it should contain one of the following:
"richtek,rt9455".
- reg: integer, i2c address of the device.
- interrupt-parent: the phandle for the interrupt controller that
services interrupts for this device.
- interrupts: interrupt mapping for GPIO IRQ, it should be
configured with IRQ_TYPE_LEVEL_LOW flag.
- richtek,output-charge-current: integer, output current from the charger to the
battery, in uA.
- richtek,end-of-charge-percentage: integer, percent of the output charge current.
When the current in constant-voltage phase drops
below output_charge_current x end-of-charge-percentage,
charge is terminated.
- richtek,battery-regulation-voltage: integer, maximum battery voltage in uV.
- richtek,boost-output-voltage: integer, maximum voltage provided to consumer
devices, when the charger is in boost mode, in uV.

Optional properties:
- richtek,min-input-voltage-regulation: integer, input voltage level in uV, used to
decrease voltage level when the over current
of the input power source occurs.
This prevents input voltage drop due to insufficient
current provided by the power source.
Default: 4500000 uV (4.5V)
- richtek,avg-input-current-regulation: integer, input current value in uA drained by the
charger from the power source.
Default: 500000 uA (500mA)

Example:

rt9455@22 {
compatible = "richtek,rt9455";
reg = <0x22>;

interrupt-parent = <&gpio1>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;

richtek,output-charge-current = <500000>;
richtek,end-of-charge-percentage = <10>;
richtek,battery-regulation-voltage = <4200000>;
richtek,boost-output-voltage = <5050000>;

richtek,min-input-voltage-regulation = <4500000>;
richtek,avg-input-current-regulation = <500000>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@ Optional properties :
(datasheet-recommended value is 10000).
Defining this property enables current-sense functionality.

Optional threshold properties :
If skipped the condition won't be reported.
- maxim,cold-temp : Temperature threshold to report battery
as cold (in tenths of degree Celsius).
- maxim,over-heat-temp : Temperature threshold to report battery
as over heated (in tenths of degree Celsius).
- maxim,dead-volt : Voltage threshold to report battery
as dead (in mV).
- maxim,over-volt : Voltage threshold to report battery
as over voltage (in mV).

Example:

battery-charger@36 {
compatible = "maxim,max17042";
reg = <0x36>;
maxim,rsns-microohm = <10000>;
maxim,over-heat-temp = <600>;
maxim,over-volt = <4300>;
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ ralink Mediatek/Ralink Technology Corp.
ramtron Ramtron International
realtek Realtek Semiconductor Corp.
renesas Renesas Electronics Corporation
richtek Richtek Technology Corporation
ricoh Ricoh Co. Ltd.
rockchip Fuzhou Rockchip Electronics Co., Ltd
samsung Samsung Semiconductor
Expand Down
1 change: 0 additions & 1 deletion drivers/power/88pm860x_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,6 @@ static int pm860x_charger_remove(struct platform_device *pdev)
int i;

power_supply_unregister(info->usb);
free_irq(info->irq[0], info);
for (i = 0; i < info->irq_nums; i++)
free_irq(info->irq[i], info);
return 0;
Expand Down
28 changes: 28 additions & 0 deletions drivers/power/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ config CHARGER_DA9150
This driver can also be built as a module. If so, the module will be
called da9150-charger.

config AXP288_CHARGER
tristate "X-Powers AXP288 Charger"
depends on MFD_AXP20X && EXTCON_AXP288
help
Say yes here to have support X-Power AXP288 power management IC (PMIC)
integrated charger.

config AXP288_FUEL_GAUGE
tristate "X-Powers AXP288 Fuel Gauge"
depends on MFD_AXP20X && IIO
Expand Down Expand Up @@ -388,12 +395,26 @@ config CHARGER_BQ24190
help
Say Y to enable support for the TI BQ24190 battery charger.

config CHARGER_BQ24257
tristate "TI BQ24257 battery charger driver"
depends on I2C && GPIOLIB
depends on REGMAP_I2C
help
Say Y to enable support for the TI BQ24257 battery charger.

config CHARGER_BQ24735
tristate "TI BQ24735 battery charger support"
depends on I2C && GPIOLIB
help
Say Y to enable support for the TI BQ24735 battery charger.

config CHARGER_BQ25890
tristate "TI BQ25890 battery charger driver"
depends on I2C && GPIOLIB
select REGMAP_I2C
help
Say Y to enable support for the TI BQ25890 battery charger.

config CHARGER_SMB347
tristate "Summit Microelectronics SMB347 Battery Charger"
depends on I2C
Expand Down Expand Up @@ -439,6 +460,13 @@ config BATTERY_RT5033
The fuelgauge calculates and determines the battery state of charge
according to battery open circuit voltage.

config CHARGER_RT9455
tristate "Richtek RT9455 battery charger driver"
depends on I2C && GPIOLIB
select REGMAP_I2C
help
Say Y to enable support for Richtek RT9455 battery charger.

source "drivers/power/reset/Kconfig"

endif # POWER_SUPPLY
Expand Down
4 changes: 4 additions & 0 deletions drivers/power/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o
obj-$(CONFIG_BATTERY_MAX17042) += max17042_battery.o
obj-$(CONFIG_BATTERY_Z2) += z2_battery.o
obj-$(CONFIG_BATTERY_RT5033) += rt5033_battery.o
obj-$(CONFIG_CHARGER_RT9455) += rt9455_charger.o
obj-$(CONFIG_BATTERY_S3C_ADC) += s3c_adc_battery.o
obj-$(CONFIG_BATTERY_TWL4030_MADC) += twl4030_madc_battery.o
obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o
Expand All @@ -58,9 +59,12 @@ obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o
obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o
obj-$(CONFIG_CHARGER_BQ2415X) += bq2415x_charger.o
obj-$(CONFIG_CHARGER_BQ24190) += bq24190_charger.o
obj-$(CONFIG_CHARGER_BQ24257) += bq24257_charger.o
obj-$(CONFIG_CHARGER_BQ24735) += bq24735-charger.o
obj-$(CONFIG_CHARGER_BQ25890) += bq25890_charger.o
obj-$(CONFIG_POWER_AVS) += avs/
obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o
obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o
obj-$(CONFIG_POWER_RESET) += reset/
obj-$(CONFIG_AXP288_FUEL_GAUGE) += axp288_fuel_gauge.o
obj-$(CONFIG_AXP288_CHARGER) += axp288_charger.o
Loading

0 comments on commit 36a1624

Please sign in to comment.