Skip to content

Commit

Permalink
Merge tag 'for-v3.8-merged' of git://git.infradead.org/battery-2.6
Browse files Browse the repository at this point in the history
Pull battery subsystem updates from Anton Vorontsov:
 "Highlights:

   - Two new drivers from Pali Rohár and N900 hackers: rx51_battery and
     bq2415x_charger.  The drivers are a part of a solution to replace
     the proprietary Nokia BME stack

   - Power supply core now registers devices with a thermal cooling
     subsystem, so we can now automatically throttle charging.  Thanks
     to Ramakrishna Pallala!

   - Device tree support for ab8500 and max8925_power drivers

   - Random fixups and enhancements for a bunch of drivers."

* tag 'for-v3.8-merged' of git://git.infradead.org/battery-2.6: (22 commits)
  max8925_power: Add support for device-tree initialization
  ab8500: Add devicetree support for chargalg
  ab8500: Add devicetree support for charger
  ab8500: Add devicetree support for btemp
  ab8500: Add devicetree support for fuelgauge
  twl4030_charger: Change TWL4030_MODULE_* ids to TWL_MODULE_*
  jz4740-battery: Use devm_request_and_ioremap
  jz4740-battery: Use devm_kzalloc
  bq27x00_battery: Fixup nominal available capacity reporting
  bq2415x_charger: Fix style issues
  bq2415x_charger: Add Kconfig/Makefile entries
  power_supply: Add bq2415x charger driver
  power_supply: Add new Nokia RX-51 (N900) power supply battery driver
  max17042_battery: Fix missing verify_model_lock() return value check
  ds2782_battery: Fix signedness bug in ds278x_read_reg16()
  lp8788-charger: Fix ADC channel names
  lp8788-charger: Fix wrong ADC conversion
  lp8788-charger: Use consumer device name on setting IIO channels
  power_supply: Register power supply for thermal cooling device
  power_supply: Add support for CHARGE_CONTROL_* attributes
  ...
  • Loading branch information
Linus Torvalds committed Dec 14, 2012
2 parents d8c532c + 76d8a23 commit 7313264
Show file tree
Hide file tree
Showing 31 changed files with 3,123 additions and 280 deletions.
27 changes: 26 additions & 1 deletion Documentation/devicetree/bindings/mfd/ab8500.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,32 @@ ab8500-bm : : : Battery Manager
ab8500-btemp : : : Battery Temperature
ab8500-charger : : : Battery Charger
ab8500-codec : : : Audio Codec
ab8500-fg : : : Fuel Gauge
ab8500-fg : : vddadc : Fuel Gauge
: NCONV_ACCU : : Accumulate N Sample Conversion
: BATT_OVV : : Battery Over Voltage
: LOW_BAT_F : : LOW threshold battery voltage
: CC_INT_CALIB : : Coulomb Counter Internal Calibration
: CCEOC : : Coulomb Counter End of Conversion
ab8500-btemp : : vtvout : Battery Temperature
: BAT_CTRL_INDB : : Battery Removal Indicator
: BTEMP_LOW : : Btemp < BtempLow, if battery temperature is lower than -10°C
: BTEMP_LOW_MEDIUM : : BtempLow < Btemp < BtempMedium,if battery temperature is between -10 and 0°C
: BTEMP_MEDIUM_HIGH : : BtempMedium < Btemp < BtempHigh,if battery temperature is between 0°C and“MaxTemp
: BTEMP_HIGH : : Btemp > BtempHigh, if battery temperature is higher than “MaxTemp
ab8500-charger : : vddadc : Charger interface
: MAIN_CH_UNPLUG_DET : : main charger unplug detection management (not in 8505)
: MAIN_CHARGE_PLUG_DET : : main charger plug detection management (not in 8505)
: MAIN_EXT_CH_NOT_OK : : main charger not OK
: MAIN_CH_TH_PROT_R : : Die temp is above main charger
: MAIN_CH_TH_PROT_F : : Die temp is below main charger
: VBUS_DET_F : : VBUS falling detected
: VBUS_DET_R : : VBUS rising detected
: USB_LINK_STATUS : : USB link status has changed
: USB_CH_TH_PROT_R : : Die temp is above usb charger
: USB_CH_TH_PROT_F : : Die temp is below usb charger
: USB_CHARGER_NOT_OKR : : allowed USB charger not ok detection
: VBUS_OVV : : Overvoltage on Vbus ball detected (USB charge is stopped)
: CH_WD_EXP : : Charger watchdog detected
ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter
SW_CONV_END : :
ab8500-gpio : : : GPIO Controller
Expand Down
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/power_supply/ab8500/btemp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== AB8500 Battery Temperature Monitor Driver ===

The properties below describes the node for btemp driver.

Required Properties:
- compatible = Shall be: "stericsson,ab8500-btemp"
- battery = Shall be battery specific information

Example:
ab8500_btemp {
compatible = "stericsson,ab8500-btemp";
battery = <&ab8500_battery>;
};

For information on battery specific node, Ref:
Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/power_supply/ab8500/chargalg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== AB8500 Charging Algorithm Driver ===

The properties below describes the node for chargalg driver.

Required Properties:
- compatible = Shall be: "stericsson,ab8500-chargalg"
- battery = Shall be battery specific information

Example:
ab8500_chargalg {
compatible = "stericsson,ab8500-chargalg";
battery = <&ab8500_battery>;
};

For information on battery specific node, Ref:
Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
25 changes: 25 additions & 0 deletions Documentation/devicetree/bindings/power_supply/ab8500/charger.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
=== AB8500 Charger Driver ===

Required Properties:
- compatible = Shall be "stericsson,ab8500-charger"
- battery = Shall be battery specific information
Example:
ab8500_charger {
compatible = "stericsson,ab8500-charger";
battery = <&ab8500_battery>;
};

- vddadc-supply: Supply for USB and Main charger
Example:
ab8500-charger {
vddadc-supply = <&ab8500_ldo_tvout_reg>;
}
- autopower_cfg:
Boolean value depicting the presence of 'automatic poweron after powerloss'
Example:
ab8500-charger {
autopower_cfg;
};

For information on battery specific node, Ref:
Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
58 changes: 58 additions & 0 deletions Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
=== AB8500 Fuel Gauge Driver ===

AB8500 is a mixed signal multimedia and power management
device comprising: power and energy-management-module,
wall-charger, usb-charger, audio codec, general purpose adc,
tvout, clock management and sim card interface.

Fuelgauge support is part of energy-management-modules, other
components of this module are:
main-charger, usb-combo-charger and battery-temperature-monitoring.

The properties below describes the node for fuelgauge driver.

Required Properties:
- compatible = This shall be: "stericsson,ab8500-fg"
- battery = Shall be battery specific information
Example:
ab8500_fg {
compatible = "stericsson,ab8500-fg";
battery = <&ab8500_battery>;
};

dependent node:
ab8500_battery: ab8500_battery {
};
This node will provide information on 'thermistor interface' and
'battery technology type' used.

Properties of this node are:
thermistor-on-batctrl:
A boolean value indicating thermistor interface to battery

Note:
'btemp' and 'batctrl' are the pins interfaced for battery temperature
measurement, 'btemp' signal is used when NTC(negative temperature
coefficient) resister is interfaced external to battery whereas
'batctrl' pin is used when NTC resister is internal to battery.

Example:
ab8500_battery: ab8500_battery {
thermistor-on-batctrl;
};
indicates: NTC resister is internal to battery, 'batctrl' is used
for thermal measurement.

The absence of property 'thermal-on-batctrl' indicates
NTC resister is external to battery and 'btemp' signal is used
for thermal measurement.

battery-type:
This shall be the battery manufacturing technology type,
allowed types are:
"UNKNOWN" "NiMH" "LION" "LIPO" "LiFe" "NiCd" "LiMn"
Example:
ab8500_battery: ab8500_battery {
stericsson,battery-type = "LIPO";
}

3 changes: 3 additions & 0 deletions Documentation/power/power_supply_class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger.
CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the
power supply object.

CHARGE_CONTROL_LIMIT - current charge control limit setting
CHARGE_CONTROL_LIMIT_MAX - maximum charge control limit setting

ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.

CAPACITY - capacity in percents.
Expand Down
28 changes: 27 additions & 1 deletion arch/arm/boot/dts/dbx5x0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,33 @@
vddadc-supply = <&ab8500_ldo_tvout_reg>;
};

ab8500-usb {
ab8500_battery: ab8500_battery {
stericsson,battery-type = "LIPO";
thermistor-on-batctrl;
};

ab8500_fg {
compatible = "stericsson,ab8500-fg";
battery = <&ab8500_battery>;
};

ab8500_btemp {
compatible = "stericsson,ab8500-btemp";
battery = <&ab8500_battery>;
};

ab8500_charger {
compatible = "stericsson,ab8500-charger";
battery = <&ab8500_battery>;
vddadc-supply = <&ab8500_ldo_tvout_reg>;
};

ab8500_chargalg {
compatible = "stericsson,ab8500-chargalg";
battery = <&ab8500_battery>;
};

ab8500_usb {
compatible = "stericsson,ab8500-usb";
interrupts = < 90 0x4
96 0x4
Expand Down
20 changes: 20 additions & 0 deletions drivers/mfd/ab8500-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,23 +1036,43 @@ static struct mfd_cell abx500_common_devs[] = {
static struct mfd_cell ab8500_bm_devs[] = {
{
.name = "ab8500-charger",
.of_compatible = "stericsson,ab8500-charger",
.num_resources = ARRAY_SIZE(ab8500_charger_resources),
.resources = ab8500_charger_resources,
#ifndef CONFIG_OF
.platform_data = &ab8500_bm_data,
.pdata_size = sizeof(ab8500_bm_data),
#endif
},
{
.name = "ab8500-btemp",
.of_compatible = "stericsson,ab8500-btemp",
.num_resources = ARRAY_SIZE(ab8500_btemp_resources),
.resources = ab8500_btemp_resources,
#ifndef CONFIG_OF
.platform_data = &ab8500_bm_data,
.pdata_size = sizeof(ab8500_bm_data),
#endif
},
{
.name = "ab8500-fg",
.of_compatible = "stericsson,ab8500-fg",
.num_resources = ARRAY_SIZE(ab8500_fg_resources),
.resources = ab8500_fg_resources,
#ifndef CONFIG_OF
.platform_data = &ab8500_bm_data,
.pdata_size = sizeof(ab8500_bm_data),
#endif
},
{
.name = "ab8500-chargalg",
.of_compatible = "stericsson,ab8500-chargalg",
.num_resources = ARRAY_SIZE(ab8500_chargalg_resources),
.resources = ab8500_chargalg_resources,
#ifndef CONFIG_OF
.platform_data = &ab8500_bm_data,
.pdata_size = sizeof(ab8500_bm_data),
#endif
},
};

Expand Down
24 changes: 17 additions & 7 deletions drivers/power/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ config BATTERY_INTEL_MID
Say Y here to enable the battery driver on Intel MID
platforms.

config BATTERY_RX51
tristate "Nokia RX-51 (N900) battery driver"
depends on TWL4030_MADC
help
Say Y here to enable support for battery information on Nokia
RX-51, also known as N900 tablet.

config CHARGER_ISP1704
tristate "ISP1704 USB Charger Detection"
depends on USB_OTG_UTILS
Expand Down Expand Up @@ -315,6 +322,16 @@ config CHARGER_MAX8998
Say Y to enable support for the battery charger control sysfs and
platform data of MAX8998/LP3974 PMICs.

config CHARGER_BQ2415X
tristate "TI BQ2415x battery charger driver"
depends on I2C
help
Say Y to enable support for the TI BQ2415x battery charger
PMICs.

You'll need this driver to charge batteries on e.g. Nokia
RX-51/N900.

config CHARGER_SMB347
tristate "Summit Microelectronics SMB347 Battery Charger"
depends on I2C
Expand All @@ -329,13 +346,6 @@ config AB8500_BM
help
Say Y to include support for AB8500 battery management.

config AB8500_BATTERY_THERM_ON_BATCTRL
bool "Thermistor connected on BATCTRL ADC"
depends on AB8500_BM
help
Say Y to enable battery temperature measurements using
thermistor connected on BATCTRL ADC.

source "drivers/power/reset/Kconfig"

endif # POWER_SUPPLY
Expand Down
4 changes: 3 additions & 1 deletion drivers/power/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o
obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o
obj-$(CONFIG_BATTERY_INTEL_MID) += intel_mid_battery.o
obj-$(CONFIG_AB8500_BM) += ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o
obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o
obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o
Expand All @@ -47,6 +48,7 @@ obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o
obj-$(CONFIG_CHARGER_MANAGER) += charger-manager.o
obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o
obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o
obj-$(CONFIG_CHARGER_BQ2415X) += bq2415x_charger.o
obj-$(CONFIG_POWER_AVS) += avs/
obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o
obj-$(CONFIG_POWER_RESET) += reset/
Loading

0 comments on commit 7313264

Please sign in to comment.