History log of /linux-master/drivers/power/Kconfig
Revision Date Author Comments
# 785b5bb4 06-Oct-2020 Ulf Hansson <ulf.hansson@linaro.org>

PM: AVS: Drop the avs directory and the corresponding Kconfig

All avs drivers have now been moved to their corresponding soc specific
directories. Additionally, they don't depend on the POWER_AVS Kconfig
anymore. Therefore, let's simply drop the drivers/power/avs directory
altogether.

Cc: Nishanth Menon <nm@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ec8f24b7 19-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Add SPDX license identifier - Makefile/Kconfig

Add SPDX license identifiers to all Make/Kconfig files which:

- Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

GPL-2.0-only

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8c0984e5 17-Jun-2016 Sebastian Reichel <sre@kernel.org>

power: move power supply drivers to power/supply

This moves all power supply drivers from drivers/power/
to drivers/power/supply/. The intention is a cleaner
source tree, since drivers/power/ also contains frameworks
unrelated to power supply, like adaptive voltage scaling.

Signed-off-by: Sebastian Reichel <sre@kernel.org>


# eee1d077 25-Jun-2016 Stephen Boyd <stephen.boyd@linaro.org>

power: qcom_smbb: Make an extcon for usb cable detection

On these PMICs the usb cable connection/disconnection is
indicated by the usb-valid interrupt being high or low
respectively. Let's make an extcon for that, so we can notify usb
drivers of the cable state.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 5a8d651a 31-May-2016 Felipe Balbi <felipe.balbi@linux.intel.com>

usb: gadget: move gadget API functions to udc-core

instead of defining all functions as static inlines,
let's move them to udc-core and export them with
EXPORT_SYMBOL_GPL, that way we can make sure that
only GPL drivers will use them.

As a side effect, it'll be nicer to add tracepoints
to the gadget API.

While at that, also fix Kconfig dependencies to
avoid randconfig build failures.

Acked-By: Sebastian Reichel <sre@kernel.org>
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 5c0e09e0 15-Feb-2016 Wenyou Yang <wenyou.yang@atmel.com>

power: act8945a: add charger driver for ACT8945A

This patch adds new driver for Active-semi ACT8945A ActivePath
charger (part of ACT8945A MFD driver) providing power supply class
information to userspace.

The driver can be configured through DT (such as, total timer,
precondition timer and input over-voltage threshold).

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
[ add "|| COMPILE_TEST" to MFD_ACT8945A dependency ]
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# f96576bd 06-Dec-2015 Krzysztof Kozlowski <krzk@kernel.org>

power: Fix unmet dependency on POWER_SUPPLY by POWER_RESET by uncoupling them

Currently the reset/power off handlers (POWER_RESET) and Adaptive Voltage
Scaling class (POWER_AVS) are not built when POWER_SUPPLY is disabled.
The POWER_RESET is also not visible in drivers main section of config.

However they do not really depend on power supply so they can be built
always. The objects for power supply drivers already depend on
particular Kconfig symbols so there is no need for any changes in
drivers/power/Makefile.

This allows selecting POWER_RESET from main drivers config section and
fixes following build warning (encountered on ARM exynos defconfig when
POWER_SUPPLY is disabled manually):

warning: (ARCH_HISI && ARCH_INTEGRATOR && ARCH_EXYNOS && ARCH_VEXPRESS && REALVIEW_DT) selects POWER_RESET which has unmet direct dependencies (POWER_SUPPLY)
warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON which has unmet direct dependencies (POWER_SUPPLY && POWER_RESET && OF)
warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON_POWEROFF which has unmet direct dependencies (POWER_SUPPLY && POWER_RESET && OF)

Reported-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 703df6c0 23-Nov-2015 Andrew F. Davis <afd@ti.com>

power: bq27xxx_battery: Reorganize I2C into a module

Separate out I2C functionality into a module. This fixes several small
issues and simplifies the driver initialization.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 6bd03ce3 16-Oct-2015 Andrew F. Davis <afd@ti.com>

power: bq27xxx_battery: Remove unneeded dependency in Kconfig

I2C is only required when using the config item BATTERY_BQ27XXX_I2C which
already depends on the I2C subsystem, remove the unneeded dependency from
BATTERY_BQ27XXX.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 0f4998cb 15-Oct-2015 Sebastian Reichel <sre@kernel.org>

twl4030_charger: add missing iio dependency

This driver fails to link without CONFIG_IIO, since
there are no stubs for the iio_channels functions.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Marek Belisko <marek@goldelico.com>
Acked-by: Nikolaus Schaller <hns@goldelico.com>


# a419b4fd 07-Oct-2015 Adam Thomson <Adam.Thomson.Opensource@diasemi.com>

power: Add support for DA9150 Fuel-Gauge

This adds power supply driver support for the Fuel-Gauge part of
the DA9150 combined Charger and Fuel-Gauge device.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Acked-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# bf02dca9 28-Sep-2015 Andreas Dannenberg <dannenberg@ti.com>

power: bq24257: Add basic support for bq24250/bq24251

This patch adds basic support for bq24250 and bq24251 which are very
similar to the bq24257 the driver was originally written for. Basic
support means the ability to select a device through Kconfig, DT and
ACPI, an instance variable allowing to check which chip is active, and
the reporting back of the selected device through the model_name power
supply sysfs property.

This patch by itself is not sufficient to actually use those two added
devices in a real-world setting due to some feature differences which
are addressed by other patches in this series.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 3636859b 24-Sep-2015 Enric Balletbo i Serra <eballetbo@gmail.com>

power_supply: Add support for tps65217-charger.

This patch adds support for the tps65217 charger driver. This driver is
responsible for controlling the charger aspect of the tps65217 mfd.
Currently, this mainly consists of turning on and off the charger, but
some other features of the charger can be supported through this driver.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 081bab21 22-Sep-2015 Andrew F. Davis <afd@ti.com>

power: bq27x00_battery: Renaming for consistency

Rename functions that are used by multiple devices. New devices
have been added and the function names and driver name are no longer
general enough for the functionality they provide.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: GUAN Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 56d7df87 30-Jul-2015 Courtney Cavin <courtney.cavin@sonymobile.com>

power: Add Qualcomm SMBB driver

Add the Qualcomm Switch-Mode Battery Charger and Boost driver, found in
pm8941.

Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 69fb4dca 01-Aug-2015 Hans de Goede <hdegoede@redhat.com>

power: Add an axp20x-usb-power driver

This adds a driver for the usb power_supply bits of the axp20x PMICs.

I initially started writing my own driver, before coming aware of
Bruno Prémont's excellent earlier RFC with a driver for this.

My driver was lacking CURRENT_MAX and VOLTAGE_MIN support Bruno's
drvier has, so I've copied the code for those from his driver.

Note that the AC-power-supply and battery charger bits will need separate
drivers. Each one needs its own devictree child-node so that other
devicetree nodes can reference the right power-supply, and thus each one
will get its own mfd-cell / platform_device and platform-driver.

Cc: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 1e8b82c1 02-Aug-2015 Geert Uytterhoeven <geert@linux-m68k.org>

power: Allow compile test of GPIO consumers if !GPIOLIB

The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# e86d69dd 29-May-2015 Anda-Maria Nicolae <anda-maria.nicolae@intel.com>

power_supply: Add support for Richtek RT9455 battery charger

Based on the datasheet found here:
http://www.richtek.com/download_ds.jsp?p=RT9455

Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 843735b7 04-May-2015 Ramakrishna Pallala <ramakrishna.pallala@intel.com>

power: axp288_charger: axp288 charger driver

This patch adds new power supply charger driver support
for X-Power AXP288 PMIC integrated charger.

This driver interfaces with the axp20x mfd driver as a cell
and listens to extcon cable events for setting up charging.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 4aeae9cb 19-May-2015 Laurentiu Palcu <laurentiu.palcu@intel.com>

power_supply: Add support for TI BQ25890 charger chip

More details about the chip can be found here:
http://www.ti.com/product/bq25890

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 2219a935 15-Apr-2015 Laurentiu Palcu <laurentiu.palcu@intel.com>

power_supply: Add TI BQ24257 charger driver

Based on the datasheet found here:
http://www.ti.com/lit/ds/symlink/bq24257.pdf

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 5a5bf490 04-Feb-2015 Todd Brandt <todd.e.brandt@linux.intel.com>

X-Power AXP288 PMIC Fuel Gauge Driver

New power_supply driver at driver/power which interfaces with the
axp20x mfd driver as a cell. Provides battery info, monitors for
changes, and generates alerts on temperature and capacity issues

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# c1a281e3 18-Feb-2015 Adam Thomson <Adam.Thomson.Opensource@diasemi.com>

power: Add support for DA9150 Charger

This patch adds support for DA9150 Charger & Fuel-Gauge IC Charger.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 085bc24d 28-Oct-2014 Mike Looijmans <mike.looijmans@topic.nl>

Add LTC2941/LTC2943 Battery Gauge Driver

Both the LTC2941 and LTC2943 measure battery capacity.
The LTC2943 is compatible with the LTC2941, it adds voltage and
temperature monitoring, and uses a slightly different conversion
formula for the charge counter.

To avoid confusion with e.g. the LTC2945, the driver is called
LTC2941 instead of LTC294X.

v2: Fix units of measurement: uV, uA and centidegrees.
v3: Correctly set configuration register. Allow negative values
for the sense resistor.
v4: Run checkpatch.pl and fix all errors and warnings.
v5: Prefix "lltc," to devicetree properties.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
[ removed .owner field ]
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# c1155c64 19-Dec-2014 Jonghwa Lee <jonghwa3.lee@samsung.com>

power: charger-manager: Use alarmtimer for battery monitoring in suspend.

To guerantee proper charing and managing batteries even in suspend,
charger-manager has used rtc device with rtc framework interface.
However, it is better to use alarmtimer for cleaner and more appropriate
operation.
This patch makes driver to use alarmtimer for polling work in suspend and
removes all deprecated codes related with using rtc interface.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 19fb8b2d 28-Nov-2014 Karol Wrona <k.wrona@samsung.com>

power: max14577: Remove SYSFS dependency from Kconfig

This is only a small clean-up. The driver can be built without SYSFS
as there exist stubs for used functions.

Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 87c2d906 20-Jan-2015 Krzysztof Kozlowski <krzk@kernel.org>

power: max77693: Add charger driver for Maxim 77693

Add new driver for Maxim 77693 switch-mode charger (part of max77693
MFD driver) providing power supply class information to userspace.

The charger has +20V tolerant input. Current input can be set from 0 to
2.58 A. The charger can deliver up to 2.1 A to the battery or 3.5 A to
the system (when supplying additional current from battery to system).

The driver is configured through DTS (battery and system related
settings) and sysfs entries (timers and top-off charging threshold).

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# b847dd96 09-Jan-2015 Beomho Seo <beomho.seo@samsung.com>

power: rt5033_battery: Add RT5033 Fuel gauge device driver

This patch adds device driver of Richtek PMIC.
The driver support battery fuel gauge. Fuel gauge calculates and determines the
battery state of charge (SOC) according to battery open circuit voltage (OCV).
Also, this driver provides battery average voltage, voltage and battery present
property.

Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 6a91e854 25-Sep-2014 Krzysztof Kozlowski <krzk@kernel.org>

power: max14577: Fix circular config SYSFS dependency

Make the max14577 charger driver depending on SYSFS instead selecting
it. This fixes warning on x86_64 with allmodconfig:

scripts/kconfig/conf --allmodconfig Kconfig
fs/sysfs/Kconfig:1:error: recursive dependency detected!
fs/sysfs/Kconfig:1: symbol SYSFS is selected by CHARGER_MAX14577
drivers/power/Kconfig:327: symbol CHARGER_MAX14577 depends on POWER_SUPPLY
drivers/power/Kconfig:1: symbol POWER_SUPPLY is selected by HID_SONY
drivers/hid/Kconfig:638: symbol HID_SONY depends on NEW_LEDS
drivers/leds/Kconfig:8: symbol NEW_LEDS is selected by SENSORS_APPLESMC
drivers/hwmon/Kconfig:299: symbol SENSORS_APPLESMC depends on HWMON
drivers/hwmon/Kconfig:5: symbol HWMON is selected by EEEPC_LAPTOP
drivers/platform/x86/Kconfig:496: symbol EEEPC_LAPTOP depends on HOTPLUG_PCI
drivers/pci/hotplug/Kconfig:5: symbol HOTPLUG_PCI depends on SYSFS

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# e30110e9 12-Sep-2014 Krzysztof Kozlowski <krzk@kernel.org>

charger: max14577: Configure battery-dependent settings from DTS and sysfs

Remove hard-coded values for:
- Fast Charge current,
- End Of Charge current,
- Fast Charge timer,
- Overvoltage Protection Threshold,
- Battery Constant Voltage,
and use DTS or sysfs to configure them. This allows using the max14577 charger
driver with different batteries.

Now the charger driver requires valid configuration data from DTS. In
case of wrong configuration data it fails during probe.

The fast charge timer is configured through sysfs entry.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 3682a8ee 12-Sep-2014 Krzysztof Kozlowski <krzk@kernel.org>

charger: max14577: Add support for MAX77836 charger

Add support for MAX77836 charger to the max14577 driver. The MAX77836
charger is almost the same as 14577 model except:
- No dead-battery detection;
- Support for special charger (like in MAX77693);
- Support for DX over-voltage protection (like in MAX77693);
- Lower values of charging current (two times lower current for
slow/fast charge, much lower EOC current);
- Slightly different values in ChgTyp field of STATUS2 register. On
MAX14577 0x6 is reserved and 0x7 dead battery. On the MAX77836 the
0x6 means special charger and 0x7 is reserved. Regardless of these
differences the driver maps them to one enum max14577_muic_charger_type.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 00a588f9 24-Jul-2014 Dmitry Artamonow <mad_soft@inbox.ru>

power: add driver for battery reading on iPaq h3xxx

This adds a driver for reading the battery status of the
battery connected to the Atmel microcontroller on the
iPAQ h3xxx series.

Based on a driver from handhelds.org 2.6.21 kernel, written
by Alessandro GARDICH.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>


# 850bc4d5 14-Jan-2014 Richard Weinberger <richard@nod.at>

power,goldfish: Add dependency on HAS_IOMEM

On archs like S390 or um this driver cannot build nor work.
Make it depend on HAS_IOMEM to bypass build failures.

drivers/built-in.o: In function `goldfish_battery_probe':
drivers/power/goldfish_battery.c:181: undefined reference to `devm_ioremap'

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 55e64701 05-Dec-2013 Krzysztof Kozlowski <krzk@kernel.org>

power_supply: Add charger support for Maxim 14577

MAX14577 chip is a multi-function device which includes MUIC, charger and
voltage regulator. The driver is located in drivers/mfd.

This patch supports battery charging control of MAX14577 chip and provides
power supply class information to userspace.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# 93353e80 24-Nov-2013 Austin Boyle <boyle.austin@gmail.com>

max17042_battery: Fix build errors caused by missing REGMAP_I2C config

max17042 now uses regmap interface but does not enable config option. This
patch fixes the following build errors:

drivers/power/max17042_battery.c:661:15: error: variable ‘max17042_regmap_config’ has initializer but incomplete type
drivers/power/max17042_battery.c:662:2: error: unknown field ‘reg_bits’ specified in initializer
drivers/power/max17042_battery.c:662:2: warning: excess elements in struct initializer
drivers/power/max17042_battery.c:662:2: warning: (near initialization for ‘max17042_regmap_config’)
drivers/power/max17042_battery.c:663:2: error: unknown field ‘val_bits’ specified in initializer
drivers/power/max17042_battery.c:663:2: warning: excess elements in struct initializer
drivers/power/max17042_battery.c:663:2: warning: (near initialization for ‘max17042_regmap_config’)
drivers/power/max17042_battery.c:664:2: error: unknown field ‘val_format_endian’ specified in initializer
drivers/power/max17042_battery.c:664:23: error: ‘REGMAP_ENDIAN_NATIVE’ undeclared here (not in a function)
drivers/power/max17042_battery.c:664:2: warning: excess elements in struct initializer
drivers/power/max17042_battery.c:664:2: warning: (near initialization for ‘max17042_regmap_config’)
drivers/power/max17042_battery.c: In function ‘max17042_probe’:
drivers/power/max17042_battery.c:684:2: error: implicit declaration of function ‘devm_regmap_init_i2c’

Signed-off-by: Austin Boyle <boyle.austin@gmail.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# ce773992 11-Oct-2013 Darbha Sriharsha <dsriharsha@nvidia.com>

power_supply: Add support for bq24735 charger

Adds support for the bq24735 charger chipset. The bq24735 is a
high-efficiency, synchronous battery charger.

It allows control of the charging current, input current, and the charger
voltage DAC's through SMBus.

Signed-off-by: Darbha Sriharsha <dsriharsha@nvidia.com>
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Thanks-to: Stephen Warren <swarren@wwwdotorg.org>
Thanks-to: Thierry Reding <thierry.reding@gmail.com>
Thanks-to: Manish Badarkhe <badarkhe.manish@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# 0244ad00 30-Aug-2013 Martin Schwidefsky <schwidefsky@de.ibm.com>

Remove GENERIC_HARDIRQ config option

After the last architecture switched to generic hard irqs the config
options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
for !CONFIG_GENERIC_HARDIRQS can be removed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>


# da0a00eb 29-Aug-2013 Marek Belisko <marek@goldelico.com>

power: Add twl4030_madc battery driver.

This driver is used and tested on gta04 phone. It's using twl4030_madc
(similar to rx51 existing driver). Driver also implement charging and
discharging calibration data so user can define ranges and level.

Signed-off-by: Marek Belisko <marek@goldelico.com>
Signed-off-by: Lukas Märdian <lukas@goldelico.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# d7bf353f 23-Aug-2013 Mark A. Greer <mgreer@animalcreek.com>

bq24190_charger: Add support for TI BQ24190 Battery Charger

Add driver support for the Texas Instruments BQ24190 battery charger.
Some of the information provided by the device is about the charger and
other information is about the battery so create two power_supply objects
(one for each) and provide the appropriate information for each one.

The device has many fields that go beyond what is reasonable to report or
modify using the existing 'POWER_SUPPLY_PROP_*' properties so the driver
exports the register fields via sysfs. They are prefixed by 'f_' (for
'field') to make it easier to distinguish between a register field and a
"normal" sysfs file exported by the power_supply infrastructure.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# e2e077cd 03-Jul-2013 Paul Gortmaker <paul.gortmaker@windriver.com>

power_supply: Make goldfish_battery depend on GOLDFISH || COMPILE_TEST

Nearly all the other goldfish peripherals (mtd, keyboard, etc) have a
dependency on the main platform's GOLDFISH Kconfig item, but this one got
skipped. Even with consistency as a justification, there was initial
resistance[1] from some people to adding it however, as they wanted the
extra compile coverage.

Now, with CONFIG_COMPILE_TEST, we have the middle ground that will give
people the coverage who want it, and let those who don't want it to skip
ever seeing the option presented.

[1] https://lkml.org/lkml/2013/2/27/333

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# a2d0dbb4 06-May-2013 Xiong Zhou <jencce.kernel@gmail.com>

bq27x00: Fix I2C dependency in KConfig

This patch fixes build failure(randconfig) of next-20130501. When config
I2C as m, BATTERY_BQ27x00 as y, here comes the failure. The driver depends
on I2C only if I2C is not disabled, as Lars commented. Last version of
this patch make the driver depend on I2C unconditionally.

Failure message:
drivers/built-in.o: In function `bq27x00_read_i2c':
bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer'
drivers/built-in.o: In function `bq27x00_battery_init':
bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver'
bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver'
drivers/built-in.o: In function `bq27x00_battery_exit':
bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1

Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# 237a1b01 01-May-2013 Randy Dunlap <rdunlap@infradead.org>

lp8788-charger: Fix kconfig dependency

Fix build errors in lp8788-charger by making it depend on IIO.
Fixes errors when CONFIG_IIO=m and CHARGER_LP8788=y.

lp8788-charger.c:(.text+0x2146b5): undefined reference to `iio_channel_get'
lp8788-charger.c:(.text+0x2146ce): undefined reference to `iio_channel_get'
lp8788-charger.c:(.text+0x214a86): undefined reference to `iio_read_channel_processed'
lp8788-charger.c:(.text+0x214b51): undefined reference to `iio_read_channel_processed'
lp8788-charger.c:(.text+0x214c30): undefined reference to `iio_read_channel_processed'
lp8788-charger.c:(.text+0x214d93): undefined reference to `iio_channel_release'
lp8788-charger.c:(.text+0x214dac): undefined reference to `iio_channel_release'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# 6f8da5df 12-Mar-2013 Rhyland Klein <rklein@nvidia.com>

power_supply: Add support for tps65090-charger

This patch adds support for the tps65090 charger driver. This driver is
responsible for controlling the charger aspect of the tps65090 mfd.
Currently, this mainly consists of turning on and off the charger, but
some features of the charger can be supported through this driver
including:

- Enable Auto Recharge based on Battery voltage
- Fast Charge Safety Timer
- Maximum battery discharge current
- Maximum battery adapter current
- Enable External Charge
- Disable charging termination based on low charger current (supported)

Once the driver is accepted, later patches can add support for the
features above which are not yet supported.

Based on work by:

Syed Rafiuddin <srafiuddin@nvidia.com>
Laxman Dewangan <ldewangan@nvidia.com>

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# fd891498 07-Mar-2013 Felipe Balbi <balbi@ti.com>

usb: phy: remove CONFIG_USB_OTG_UTILS

there are no more users of CONFIG_USB_OTG_UTILS
left in tree, we can remove it just fine.

[ kishon@ti.com : fixed a linking error due
to original patch forgetting to change
drivers/usb/Makefile ]

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 405fea1c 09-Aug-2012 Marcus Cooper <marcus.xm.cooper@stericsson.com>

pm2301-charger: Always compile the PM2301 Charger driver with AB8500 Battery Mgnt

The PM2301 Charger should always be available when using the AB8500
Battery Management system, we're ensuring this will be the case.

Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Hakan BERG <hakan.berg@stericsson.com>
Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>


# 049645d7 06-Feb-2013 Heiko Carstens <hca@linux.ibm.com>

goldfish_battery: Add missing GENERIC_HARDIRQS dependency

Fix this link error on s390:

ERROR: "devm_request_threaded_irq" [drivers/power/goldfish_battery.ko] undefined!

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# 84d7b768 25-Jan-2013 Mike Lockwood <lockwood@android.com>

power: Add battery driver for goldfish emulator

Add the emulated power driver for the Goldfish platform.

This folds together the code from the Google tree, Jun Nakajima's cleanups
and x86 porting work, and then a tidy up to pass checkpatch.

Signed-off-by: Mike A. Chan <mikechan@google.com>
[cleanup and x86 support]
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
[ported to 3.4]
Signed-off-by: Tom Keel <thomas.keel@intel.com>
[ported to 3.7 and final tidy]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>


# 01ec8c54 26-Apr-2012 Michel JAOUEN <michel.jaouen@stericsson.com>

pm2301: Provide u9540 support for the pm2301 charger

AC charger driver for the DB9540 based platforms.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>


# 96ff0f5c 17-Nov-2012 Jamie Lentin <jm@lentin.co.uk>

power: Add simple poweroff-gpio driver

Given appropriate devicetree bindings, this driver registers a
pm_power_off function to set a GPIO line high/low to power down
your board.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by:Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>


# bd9e8ab2 18-Nov-2012 Rajanikanth H.V <rajanikanth.hv@stericsson.com>

ab8500: Add devicetree support for btemp

This patch adds device tree support for battery-temperature-monitor driver

Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# 7ad85830 18-Nov-2012 Anton Vorontsov <cbouatmailru@gmail.com>

bq2415x_charger: Add Kconfig/Makefile entries

This commit adds Kconfig and Makefile entries so that we could actually
build the driver.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 04930baf 31-Oct-2012 Pali Rohár <pali@kernel.org>

power_supply: Add new Nokia RX-51 (N900) power supply battery driver

This driver exporting battery design capacity, temperature and voltage for
battery in Nokia RX-51. This driver is needed for open source battery
management on Nokia RX-51 (N900).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# e60fea79 21-Sep-2012 anish kumar <anish198519851985@gmail.com>

power: battery: Generic battery driver using IIO

Driver to allow use of the ADC drivers supported by the IIO
subsystem for battery status monitoring. Connecting this
driver to the relevant IIO device requires registration of
the appropriate iio_map structure array by the IIO device
driver (usually from platform data). If specified the driver
will also make use of a gpio to provide interrupt driven
notification that the battery is fully charged.

In last version:
Addressed concerns raised by lars:
a. made the adc_bat per device.
b. get the IIO channel using hardcoded channel names.
c. Minor issues related to gpio_is_valid and some code
refactoring.

In V1:
Addressed concerns raised by Anton:
a. changed the struct name to gab(generic adc battery).
b. Added some functions to neaten the code.
c. Some minor coding guidelines changes.
d. Used the latest function introduce by lars:
iio_read_channel_processed to streamline the code.

In V2:
Addressed concerns by lars:
a. No need of allocating memory for channels.Make it array.
b. Code restructring, coding style and following kernel guidelines changes
suggested by him.

In V3:
Addressed conerns by Anton:
a. Added the copyright.
b. Coding guidelines changes suggested by him.
c. Added Makefile and Kconfig

Signed-off-by: anish kumar <anish198519851985@gmail.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# a830d28b 27-Jul-2012 Jett.Zhou <jtzhou@marvell.com>

power_supply: Enable battery-charger for 88pm860x

There are charger and battery measurement feature for 88pm860x PMIC.

For charger, it can support pre-charge with small current when battery is
nearly exausted and then changed into fast-charge with CC&CV mode.

For battery monitor, it can support battery measurement such as
vbat,vsys,vchg and ibat etc,it can aslo accumulating the Coulomb value
charged or discharged from battery based on Conlomb Counter, we use it
to estimate battery capacity.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# 98a27664 05-Sep-2012 Kim, Milo <Milo.Kim@ti.com>

power_supply: Add new lp8788 charger driver

TI LP8788 PMU supports regulators, battery charger, RTC, ADC, backlight
driver and current sinks.

This patch supports the charger operations including the charger
interrupt handling.

The LP8788 charger driver provides configurable platform data. The
charger platform data includes ADC input ID, maximum battery voltage,
charging parameters and etc.

The ADC input is used for getting the battery voltage and temperature.
Charging parameters are used for updating the charger operations such
like setting charging current and setting End-of-charge conditions.

When the charging interrupt occurs, power supply uevents are generated
in order to update the user-space information. For platform specific
charger action, the charger_event() function can be used in the
platform side.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# 4ac64d51 08-Aug-2012 Axel Lin <axel.lin@gmail.com>

power_supply: Remove broken mark for da9052-battery

The fix for MFD part is already merged so we can remove the broken mark
for da9052-battery.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# c4727555 15-Jul-2012 Chanwoo Choi <cw00.choi@samsung.com>

charger-manager: Fix build break related to EXTCON

This patch select CONFIG_EXTCON to resolve below build break of
charger-manager because charger-manager use API of EXTCON subsystem.

drivers/built-in.o: In function `charger_manager_probe':
charger-manager.c:(.text+0x11d61a): undefined reference to `extcon_register_interest'
charger-manager.c:(.text+0x11d7b6): undefined reference to `extcon_unregister_interest'
drivers/built-in.o: In function `charger_manager_remove':
charger-manager.c:(.devexit.text+0x8f3): undefined reference to `extcon_unregister_interest'

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# 8b7d133c 06-Jun-2012 Paul Bolle <pebolle@tiscali.nl>

ab8500-btemp: Fix typo 'AB5500'

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 21ff63ad 25-Apr-2012 Jean Pihet <j-pihet@ti.com>

ARM: OMAP: SmartReflex: Move smartreflex driver to drivers/

After a clean-up of the interfaces the OMAP Smartreflex IP driver is now a
generic driver. Move it to drivers/power/avs/.

The build is controlled by the following Kconfig options:
. CONFIG_POWER_AVS: general knob for Adaptive Voltage Scaling support,
. CONFIG_POWER_AVS_OMAP: AVS(Adaptive Voltage Scaling)
support on OMAP containing the version 1 or version 2 of the SmartReflex IP,
. CONFIG_POWER_AVS_OMAP_CLASS3: Class 3 implementation of Smartreflex.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>


# 9a8422d2 05-May-2012 Ramakrishna Pallala <ramakrishna.pallala@intel.com>

max17042_battery: Add support for max17047/50 chip

max17047 is improved version of max17042 chip. It has few HW bug
fixes with minor changes in register set.

max17050 is same as max17047 chip except its silicon packging. So from
driver's point of view there is no difference btw max1047 and max1050.

This patch adds the support to dynamically detect the chip type and
adds steps to initialize the max17047 chip.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# 840b91bd 17-Mar-2012 Axel Lin <axel.lin@gmail.com>

power_supply: Fix a typo in BATTERY_DS2781 Kconfig entry

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# 34298d40 16-Apr-2012 Mika Westerberg <mika.westerberg@linux.intel.com>

smb347-charger: Convert to regmap API

The smb347-charger driver does a lot of read-modify-write to the device
registers. Instead of open-coding everything we can take advantage of
regmap API which provides nice functions to do this kind of things.

In addition there is no need for custom debugfs file for dumping
registers as this is already provided by the regmap API.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# 0d4ed4e2 04-May-2012 Anton Vorontsov <cbouatmailru@gmail.com>

power_supply: Make the core a boolean instead of a tristate

On Mon, Apr 02, 2012 at 01:53:23PM +1000, Benjamin Herrenschmidt wrote:
> > drivers/built-in.o: In function `.nouveau_pm_trigger':
> > (.text+0xa56e8): undefined reference to `.power_supply_is_system_supplied'
> >
> > nouveau probably needs to depends on CONFIG_POWER_SUPPLY to force a module
> > build with the latter is =m
>
> Ok, not that trivial...
>
> The problem is more like POWER_SUPPLY should be a bool, not a tristate.
>
> If you think about it: you don't want things like nouveau to depend on a
> random subsystem like that, people will never get it. In fact,
> POWER_SUPPLY provides empty inline stubs when not enabled, so that's
> really designed to not have depends...
>
> However that -cannot- work if POWER_SUPPLY is modular and the drivers
> who use it are not.
>
> The only fixes here that make sense I can think of
> that don't also involve Kconfig horrors are:
>
> - Ugly: in power_supply.h, use the extern variant if
>
> defined(CONFIG_POWER_SUPPLY) ||
> (defined(CONFIG_POWER_SUPPLY_MODULE) && defined(MODULE))
>
> IE. use the stub if power supply is a module and what is being built is
> built-in. Of course that's not only ugly, it somewhat sucks from a user
> perspective as the subsystem now exists but can't be used by some
> drivers...
>
> - Better: Just make the bloody thing a bool :-) The power supply
> framework itself is small enough, just make it a boolean option and
> avoid the problem entirely. The actual power supply sub drivers can
> remain modular of course.

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 1f855824 29-Feb-2012 Arun Murthy <arun.murthy@stericsson.com>

ab8500-btemp: AB8500 battery temperature driver

This driver is responsible for battery detection, obtaining battery
temperature and monitor the battery temperature by taking precautionary
measurements when battery temperature goes beyond or below the thresholds.

Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# ed1a230f 06-Feb-2012 Bruce E. Robertson <bruce.e.robertson@intel.com>

Add I2C driver for Summit Microelectronics SMB347 Battery Charger.

Driver support for the Summit I²C battery charger. This is used in some
Intel devices.

Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# e39b828f 29-Jan-2012 Kim, Milo <Milo.Kim@ti.com>

lp8727_charger: Add company name and description

Add 'Texas Instruments' because TI acquired National semiconductor at 2011.
And the driver information is added in the header file.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>


# fef37e9a 29-Feb-2012 Renata Sayakhova <rsayakhova@gmail.com>

DS2781 Maxim Stand-Alone Fuel Gauge battery and w1 slave drivers

Signed-off-by: Renata Sayakhova <rsayakhova@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6cfc2a23 09-Jan-2012 Anton Vorontsov <cbouatmailru@gmail.com>

power_supply: Mark da9052 driver as broken

There are some problems with MFD part of this driver, so the
driver fails to build:

drivers/power/da9052-battery.c: In function 'da9052_bat_read_volt':
drivers/power/da9052-battery.c:293:2: error: implicit declaration of function 'da9052_adc_manual_read' [-Werror=implicit-function-declaration]
drivers/power/da9052-battery.c: In function 'da9052_bat_check_presence':
drivers/power/da9052-battery.c:306:2: error: implicit declaration of function 'da9052_adc_read_temp' [-Werror=implicit-function-declaration]
drivers/power/da9052-battery.c: In function 'da9052_determine_vc_tbl_index':
drivers/power/da9052-battery.c:348:1: warning: control reaches end of non-void function [-Wreturn-type]
cc1: some warnings being treated as errors

The fix for MFD part will probably go post -rc1 (or in the next merge
window), so let's disable the driver for now.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# ded7fc7b 14-Dec-2011 Ashish Jangam <ashish.jangam@kpitcummins.com>

power_supply: Add DA9052 battery driver

Driver for DA9052 battery charger. This driver depends on DA9052 MFD core
dirver for definitions and methods.

This patch is functionally tested on Samsung SMDKV6410.

Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# c78f2b64 05-Dec-2011 Rhyland Klein <rklein@nvidia.com>

bq20z75: Rename to sbs-battery

This driver for the bq20z75 implemented the register spec defined
by the SBS standard. As this is not unique to this the TI part this
was originally written for, we can generalize this driver to
show its support for any SBS compliant battery.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 2165c8a4 03-Jan-2012 Woogyom Kim <milo.kim@nsc.com>

power_supply: Add LP8727 charger driver

National Semiconductor LP8727 is the battery charger with Micro/Mini
USB interface. This IC includes below functions:

- I2C interface for accessing user registers
- Single input Li-Ion battery charger
- Charger input ID detection from Micro/Mini USB
- Multiplexing switches on USB, UART

Signed-off-by: Woogyom Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 3bb3dbbd 27-Dec-2011 Donggeun Kim <dg77.kim@samsung.com>

power_supply: Add initial Charger-Manager driver

Because battery health monitoring should be done even when suspended,
it needs to wake up and suspend periodically. Thus, userspace battery
monitoring may incur too much overhead; every device and task is woken
up periodically. Charger Manager uses suspend-again to provide
in-suspend monitoring.

This patch allows to monitor battery health in-suspend state.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 3369465e 18-Aug-2011 Al Viro <viro@ftp.linux.org.uk>

um: switch to use of drivers/Kconfig

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>


# bb4ce970 24-Jun-2011 Donggeun Kim <dg77.kim@samsung.com>

power_supply: Add charger driver for MAX8998/LP3974

This patch supports power supply APIs for MAX8998/LP3974.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: KyungMin Park <kyungmin.park@samsung.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 149c077b 22-Jun-2011 Donggeun Kim <dg77.kim@samsung.com>

power_supply: Add charger driver for MAX8997/8966

MAX8997/8966 chip is a multi-function device which includes
PMIC, RTC, Fuel Gauge, MUIC, Haptic, Flash control, and
Battery charging control.
The driver for it is located at drivers/mfd.

This patch supports battery charging control of MAX8997/8966 chip and
provides power supply class information to userspace.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: KyungMin Park <kyungmin.park@samsung.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 275ac746 26-May-2011 Clifton Barnes <cabarnes@indesign-llc.com>

w1: add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support

Add support for the Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC.

It was suggested to combine this functionality with the current ds2782
driver. Unfortunately, I'm unable to commit the time to refactoring this
driver to that extent and I don't have a platform with the ds2782 part to
validate that there are no regression issues by adding this functionality.

[akpm@linux-foundation.org: use min_t()]
Signed-off-by: Clifton Barnes <cabarnes@indesign-llc.com>
Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 6f9efe76 21-Apr-2011 Anton Vorontsov <cbouatmailru@gmail.com>

max8903_charger: Add GENERIC_HARDIRQS as a dependency (fixes S390 build)

S390 is special as it doesn't have IRQ lines, so these errors pop up:

drivers/built-in.o: In function 'max8903_remove':
drivers/power/max8903_charger.c:355: undefined reference to 'free_irq'
drivers/power/max8903_charger.c:357: undefined reference to 'free_irq'
drivers/power/max8903_charger.c:359: undefined reference to 'free_irq'

This commit fixes the issue by making the driver depend on
GENERIC_HARDIRQS feature.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# b14a9ccc 28-Mar-2011 MyungJoo Ham <myungjoo.ham@samsung.com>

power_supply: Add driver for MAX8903 charger

MAX8903 is an integrated battery charger and selector with two
power inputs (USB and AC adapter). This driver enables the charger,
handles interrupts, and provides power-supply-class information to
userland.

Tested on Exynos4 NURI / S5PC210 SLP7 boards.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 7fb7ba58 24-May-2010 Lars-Peter Clausen <lars@metafoo.de>

bq27x00: Add bq27000 support

This patch adds support for the bq27000 battery to the bq27x00 driver.
The bq27000 is similar to the bq27200 except that it uses the HDQ bus
instead of I2C to communicate with the host system.

The driver is implemented as a platform driver. The driver expects to be
provided with a read callback function through its platform data. The read
function is assumed to do the lowlevel HDQ handling and read out the value
of a certain register.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>


# 359ab9f5 13-Jan-2011 MyungJoo Ham <myungjoo.ham@samsung.com>

power_supply: Add MAX17042 Fuel Gauge Driver

The MAX17042 is a fuel gauge with an I2C interface for lithium-ion
betteries. Unlike its predecessor MAX17040, MAX17042 uses 16bit
registers. Besides, MAX17042 has much more features than MAX17040; e.g.,
a thermistor, current and current accumulation measurement, battery
internal resistance estimate, average values of measurement, and others.

This patch implements a driver for MAX17042.
In this initial release, we have implemented the most basic features of
a fuel gauge: measure the battery capacity and voltage.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 5070437c 21-Oct-2010 Lars-Peter Clausen <lars@metafoo.de>

power_supply: Add gpio charger driver

This patch adds a simple driver for chargers indicating their online
status through a GPIO pin.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 0f482857 28-Oct-2010 Samuel Ortiz <sameo@linux.intel.com>

power: Revert "power_supply: Mark twl4030_charger as broken"

The missing definitions are now in.

This reverts commit 23886839a752401aba66517bff8a8b91549279ce.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 23886839 27-Oct-2010 Anton Vorontsov <cbouatmailru@gmail.com>

power_supply: Mark twl4030_charger as broken

The driver is not buildable without MFD changes. For now, let's
disable the driver as it breaks build for major platforms (i.e. x86).

CC [M] drivers/power/twl4030_charger.o
drivers/power/twl4030_charger.c: In function 'twl4030_clear_set_boot_bci':
drivers/power/twl4030_charger.c:105: error: 'TWL4030_PM_MASTER_BOOT_BCI' undeclared (first use in this function)
drivers/power/twl4030_charger.c:105: error: (Each undeclared identifier is reported only once
drivers/power/twl4030_charger.c:105: error: for each function it appears in.)
drivers/power/twl4030_charger.c: In function 'twl4030_bci_have_vbus':
drivers/power/twl4030_charger.c:137: error: 'TWL4030_PM_MASTER_STS_HW_CONDITIONS' undeclared (first use in this function)
drivers/power/twl4030_charger.c: In function 'twl4030_bci_probe':
drivers/power/twl4030_charger.c:477: warning: overflow in implicit constant conversion
drivers/power/twl4030_charger.c:485: warning: overflow in implicit constant conversion
make[2]: *** [drivers/power/twl4030_charger.o] Error 1

We can re-enable it if MFD tree will finally merge into 2.6.37.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 2e727f17 27-Sep-2010 Grazvydas Ignotas <notasas@gmail.com>

power_supply: Add driver for TWL4030/TPS65950 BCI charger

TWL4030/TPS65950 is a multi-function device with integrated charger,
which allows charging from AC or USB. This driver enables the charger
and provides several monitoring functions.

Tested on OMAP3 Pandora board.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# f6127b86 23-Sep-2010 Martin Schwidefsky <schwidefsky@de.ibm.com>

ds2760_battery: Fix W1 and W1_SLAVE_DS2760 dependency

Fix this Kconfig warning on allmodconfig for s390:

warning: (BATTERY_DS2760 && POWER_SUPPLY) selects W1 which has unmet
direct dependencies (HAS_IOMEM)

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# a7640bfa 05-Sep-2010 Rhyland Klein <rklein@nvidia.com>

power_supply: Add driver for TI BQ20Z75 gas gauge IC

This driver depends on I2C and uses SMBUS for communication with
the host.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# ec46475f 19-Aug-2010 Heikki Krogerus <ext-heikki.krogerus@nokia.com>

power_supply: Add isp1704 charger detection driver

NXP ISP1704 is Battery Charging Specification 1.0 compliant USB
transceiver. This adds a power supply driver for ISP1704 and
ISP1707 USB transceivers.

Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# f6a21388 18-Jun-2010 Lars-Peter Clausen <lars@metafoo.de>

POWER: Add JZ4740 battery driver.

Add support for the battery voltage measurement part of the JZ4740 ADC unit.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1416/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>


# 808be4b2 17-Jul-2010 Vasily Khoruzhick <anarsoul@gmail.com>

Add s3c-adc-battery driver

s3c-adc-battery is driver for monitoring and charging battery on
iPAQ H1930/H1940/RX1950.

It depends on s3c-adc driver to get battery voltage and current.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 6721081b 17-Jun-2010 Nithish Mahalingam <nithish.mahalingam@intel.com>

Intel MID platform battery driver

The PMIC Battery driver provides battery charging and battery gauge
functionality on Intel MID platforms. This provides the basic functions.
There are some USB drivers to merge before the selection of charging
between the different USB power levels can be enabled.

Moved to a platform device by Alek Du.

Signed-off-by: Nithish Mahalingam <nithish.mahalingam@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# a1e50fd4 17-May-2010 Anton Vorontsov <cbouatmailru@gmail.com>

power_supply: Add test_power driver

Just a handy driver that is used for testing purposes.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 9b9ade6b 26-Apr-2010 Yulia Vilensky <vilensky@compulab.co.il>

ds2782_battery: Add support for ds2786 battery gas gauge

Signed-off-by: Yulia Vilensky <vilensky@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# e3e8d1c9 27-Feb-2010 Marek Vasut <marek.vasut@gmail.com>

Driver for Zipit Z2 battery chip

This patch adds driver for Zipit Z2 battery chip called AER915. No
details are known about the chip. The chip is available through I2C bus
at address 0x55 and it's register 0x02 contains battery voltage.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 28db3888 25-Jan-2010 Haojian Zhuang <haojian.zhuang@marvell.com>

power_supply: Enable power supply of max8925

MAX8925 is a PMIC that contains charger component

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# e20908d9 12-Feb-2010 Grazvydas Ignotas <notasas@gmail.com>

power_supply: bq27x00: add BQ27500 support

BQ27500 is newer fuel gauge chip from TI with slightly changed
register layout and some different register semantics. Add new i2c
ID for it and handle differences where needed. Also rename bq27200
functions to bq27x00, as they are no longer bq27200 specific.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# f1fce597 10-Feb-2009 Thomas Kunze <thommycheck@gmx.de>

collie: add battery driver

This driver is based on tosa_battery.c.


# c26964ea 01-Oct-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

wm831x: Factor out WM831x backup battery charger

The backup battery on WM831x is a separate IP block to the main PMU
and is largely unrelated to the main supply functionality. Factor it
out into a separate driver in order to reflect this and better support
future hardware versions.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# 3961f7c3 10-Aug-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

power_supply: Add driver for the PMU on WM831x PMICs

The WM831x PMICs provide power path management from three sources:
a wall supply, USB and a battery with integrated charger. They also
provide an additional backup supply with integrated for maintaining
always on functionality such as the RTC and monitoring of power
switches.

After some initial configuration at startup the device operates
autonomously, the driver simply provides reporting of the current
state.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>


# bfdb46ce 17-Jun-2009 Ryan Mallon <ryan@bluewatersys.com>

Add ds2782 battery gas gauge driver

This patch adds a driver for ds2782 battery devices.

Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# c6f4a42d 05-Jun-2009 Minkyu Kang <mk7.kang@samsung.com>

Add MAX17040 Fuel Gauge driver

The MAX17040 is a I2C interfaced Fuel Gauge systems for lithium-ion
batteries This patch adds support the MAX17040 Fuel Gauge

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# f5714dc9 08-Jan-2009 Balaji Rao <balajirrao@openmoko.org>

power_supply: PCF50633 battery charger driver

Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
Cc: Andy Green <andy@openmoko.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>


# 342d765e 30-Dec-2008 Mike Rapoport <rppt@kernel.org>

power_supply: Add Dialog DA9030 battery charger driver

Driver for battery charger integrated into Dialog Semiconductor DA9030 PMIC

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>


# 14431aa0 16-Nov-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

power_supply: Add support for WM8350 PMU

This patch adds support for the PMU provided by the WM8350 which
implements battery, line and USB supplies including a battery charger.
The hardware functions largely autonomously, with minimal software
control required to initiate fast charging.

Support for configuration of the USB supply is not yet implemented.
This means that the hardware will remain in the mode configured at
startup, by default limiting the current drawn from USB to 100mA.

This driver was originally written by Liam Girdwood with subsequent
updates for submission by Mark Brown.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>


# 5e4c5f4c 12-Oct-2008 Linus Torvalds <torvalds@linux-foundation.org>

Fix Kconfig dependency for WM97xx battery driver

It needs the WM97xx touchscreen driver to be compiled in, not as a
module. And it cannot itself be a module, due to some unfortunate
interactions with platform data.

Reported-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 4e9687d9 11-Sep-2008 Marek Vašut <marek.vasut@gmail.com>

[ARM] 5248/1: wm97xx generic battery driver

This patch adds generic battery driver for wm97xx chips.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# 6a903788 22-Sep-2008 Dmitry Baryshkov <dbaryshkov@gmail.com>

power_supply: fix dependency of tosa_battery

tosa_battery should also depend on wm97xx_ts as it uses dac-accessing
functions from that module.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# b996ad0e 20-Aug-2008 Rodolfo Giometti <giometti@linux.it>

power_supply: Support for Texas Instruments BQ27200 battery managers

These battery managers came in two different packages: one for I2C
busses (BQ27200) and one for HDQ busses (BQ27000).

This driver currently supports only the I2C chip version but the code
is designed in order to easily allow the HDQ chip version integration.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: make things static, use kasprintf()]
Signed-off-by: Rodolfo Giometti <giometti@linux.it>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# d4b19c42 07-Jul-2008 Marek Vašut <marek.vasut@gmail.com>

[ARM] 5155/1: PalmTX battery monitor

This patch adds battery monitoring driver for PalmTX.
It can read voltage from the battery and temperature.
It also monitors charging/discharging status.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>


# fece4184 24-Jun-2008 Dmitry Baryshkov <dbaryshkov@gmail.com>

power_supply: Sharp SL-6000 (tosa) batteries support

This patch adds common battery interface support for Sharp SL-6000 (tosa).

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>


# a1da5f4f 21-Jul-2007 Paul Mackerras <paulus@samba.org>

Don't compile the PMU power driver on 64-bit PowerPC

As reported by Stephen Rothwell, an allmodconfig build on 64-bit
PowerPC reports these errors:

ERROR: "pmu_batteries" [drivers/power/pmu_battery.ko] undefined!
ERROR: "pmu_battery_count" [drivers/power/pmu_battery.ko] undefined!
ERROR: "pmu_power_flags" [drivers/power/pmu_battery.ko] undefined!

This fixes the problem by not building pmu_battery.ko on ppc64. There
are no battery-powered ppc64 machines with an Apple PMU, and we can be
reasonably confident there never will be.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>


# 5f17c70f 15-Jul-2007 Al Viro <viro@ftp.linux.org.uk>

PDA_POWER depends on having request_irq()

... so all proud owners of s390-based PDAs will have to live without that one

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# fb972873 03-May-2007 David Woodhouse <dwmw2@infradead.org>

[BATTERY] One Laptop Per Child power/battery driver

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>


# efea58e3 03-May-2007 David Woodhouse <dwmw2@infradead.org>

[BATTERY] Apple PMU driver

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>


# fe0e3153 03-May-2007 Anton Vorontsov <cbou@mail.ru>

[BATTERY] 1-Wire ds2760 chip battery driver

This is driver for batteries with ds2760 chip inside, found inside
almost every HP iPaq and HTC PDAs/phones.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>


# 3788ec93 03-May-2007 Anton Vorontsov <cbou@mail.ru>

[BATTERY] APM emulation driver for class batteries

Signed-off-by: Eugeny Boger <eugenyboger@dgap.mipt.ru>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>


# b2998049 03-May-2007 Anton Vorontsov <cbou@mail.ru>

[BATTERY] pda_power platform driver

Common power driver for PDAs and phones with one or two external
power supplies (AC/USB) connected to main and backup batteries,
and optional builtin charger.

It's used to stop logic duplication through different embedded
devices. So, power supply *logic* is here. pda_power register
power supplies, and will take care about notifying batteries
about power changes through external power interface.

Currently, power consumption legal limits (including USB power
consumption) should be handled by platform code, inside set_charge
function.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: Roman Moravcik <roman.moravcik@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>


# 4a11b59d 03-May-2007 Anton Vorontsov <cbou@mail.ru>

[BATTERY] Universal power supply class (was: battery class)

This class is result of "external power" and "battery" classes merge,
as suggested by David Woodhouse. He also implemented uevent support.

Here how userspace seeing it now:

# ls /sys/class/power\ supply/
ac main-battery usb

# cat /sys/class/power\ supply/ac/type
AC

# cat /sys/class/power\ supply/usb/type
USB

# cat /sys/class/power\ supply/main-battery/type
Battery

# cat /sys/class/power\ supply/ac/online
1

# cat /sys/class/power\ supply/usb/online
0

# cat /sys/class/power\ supply/main-battery/status
Charging

# cat /sys/class/leds/h5400\:red-left/trigger
none h5400-radio timer hwtimer ac-online usb-online
main-battery-charging-or-full [main-battery-charging]
main-battery-full

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>