History log of /drivers/power/da9030_battery.c
Revision Date Author Comments
bc67ea8e92d45d1237e289fd1c1ec004a8383ccc 11-Mar-2013 Jingoo Han <jg1.han@samsung.com> da9030_battery: Use devm_kzalloc()

Use devm_kzalloc() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
7e6c647ed9994428643e7e740b2d8241ee13da5c 06-Feb-2013 Michal Hocko <mhocko@suse.cz> da9030_battery: Include notifier.h

randconfig complains about:
drivers/power/da9030_battery.c:113: error: field ‘nb’ has incomplete type

because there is no direct include for notifier.h which defines
struct notifier_block.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
c084e092e47ca2435673702c6cf6e87a731ecc6f 23-Aug-2012 Anton Vorontsov <anton.vorontsov@linaro.org> da9030_battery: Don't use 0 as NULL

Noticed the new warning:

CHECK drivers/power/da9030_battery.c
drivers/power/da9030_battery.c:190:68: warning: Using plain integer as NULL pointer

This commit fixes the issue.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
300bac7fb85a20b2704dc3645419057992f78565 25-Nov-2011 Axel Lin <axel.lin@gmail.com> power_supply: Convert drivers/power/* to use module_platform_driver()

This patch converts the drivers in drivers/power/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Nithish Mahalingam <nithish.mahalingam@intel.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Balaji Rao <balajirrao@openmoko.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Clifton Barnes <cabarnes@indesign-llc.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
5324dc0e3872324ed0bf372bce7bc437436910b6 02-Feb-2010 Stefan Weil <weil@mail.berlios.de> da9030_battery: fix spelling in comment

platfrom -> platform
monotor -> monitor

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
a35d01a5d2ac533edab94a8e3b6749ab213c91c5 08-Jun-2009 Mike Rapoport <mike@compulab.co.il> da9030_battery: Fix race between event handler and monitor

There are cases when charging monitor and the event handler try to
change the charger state simultaneously. For instance, a charger is
connected to the system, there's the detection event and the event
handler tries to enable charging. It is possible that the periodic
charging monitor runs at the same time and it still thinks there's
no external charger. So it tries to disable the charging. As the
result, even if the conditions necessary to charge the battery hold,
there will be no actual charging.

The patch changes the event handler so that instead of enabling/
disabling the charger immediately it would rather make the monitor
run. The monitor code then decides what should be the charger state.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
342d765e011f9cbe4292119a9164f76ccf0b922a 30-Dec-2008 Mike Rapoport <mike@compulab.co.il> 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>