15 Nov, 2013
1 commit
-
Use this new function to make code more comprehensible, since we are
reinitialzing the completion, not initializing.[akpm@linux-foundation.org: linux-next resyncs]
Signed-off-by: Wolfram Sang
Acked-by: Linus Walleij (personally at LCE13)
Cc: Ingo Molnar
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Jun, 2013
2 commits
-
The usage of strict_strtoul() is not preferred, because strict_strtoul()
is obsolete. Thus, kstrtoul() should be used.Signed-off-by: Jingoo Han
Reviewed-by: Andy Shevchenko
Signed-off-by: Anton Vorontsov -
The driver core clears the driver data to NULL after device_release or on
probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is
not needed to manually clear the device driver data to NULL.Signed-off-by: Jingoo Han
Acked-by: Lee Jones
Signed-off-by: Anton Vorontsov
17 Apr, 2013
1 commit
-
This patch adds const attributes to AB8500 power and temperature related
read-only data arrays.Signed-off-by: Hongbo Zhang
Signed-off-by: Anton Vorontsov
07 Mar, 2013
6 commits
-
This patch updates the gas gauge constant for electric current
calculation according to hardware specification.Signed-off-by: Benoit GAUTHIER
Signed-off-by: Lee Jones
Reviewed-by: Marcus COOPER
Reviewed-by: Philippe LANGLAIS
Tested-by: Benoit GAUTHIER -
Some of the comments in the ab8500 drivers reflect the behaviour
of the original device. As this driver now supports newer devices
then these comments are now redundant. Also some IRQ comments are
incorrect.Signed-off-by: Marcus Cooper
Signed-off-by: Lee Jones
Reviewed-by: Rabin VINCENT
Tested-by: Rabin VINCENT -
Signed-off-by: Lee Jones
-
When battery capacity was going below 1% fg is not supposed
to report 0% unless we've got the LOW_BAT IRQ, no matter
what the FG-algorithm says. This made fg get stuck at 1% if
charger is connected when capacity is 1%.Signed-off-by: Hakan BERG
Signed-off-by: Lee Jones
Reviewed-by: Marcus COOPER
Reviewed-by: Srinidhi KASAGAR -
Unscaled capacity should be reported for POWER_SUPPLY_PROP_CAPACITY.
Signed-off-by: Martin Bergstrom
Signed-off-by: Lee Jones
Reviewed-by: Marcus COOPER
Tested-by: Jonas ABERG -
Add support for a power cut feature which allows user to
configure when ab8505 and ab8540 based platforms should shut
down system due to low battery.Signed-off-by: Lee Jones
23 Jan, 2013
4 commits
-
If battery is not identified while fg probe, mah_max_design gets
initialized with unknown battery's charge full design. Reinitialize
mah_max_design if battery is identified after fg probe.Signed-off-by: Rajkumar Kasirajan
Signed-off-by: Lee Jones
Reviewed-by: Vijaya Kumar K-1
Reviewed-by: Marcus COOPER
Reviewed-by: Olivier CLERGEAUD
Reviewed-by: Arun MURTHY
Reviewed-by: Rabin VINCENT
Tested-by: Rupesh KUMAR
Tested-by: Jonas ABERG -
Flush all workqueues at suspend time to avoid suspending during work.
Signed-off-by: Jonas Aaberg
Signed-off-by: Lee Jones
Reviewed-by: Marcus COOPER -
When the charger is removed we need to go to INIT_RECOVERY
state instead of directly to RECOVERY state.Signed-off-by: Martin Bergstrom
Signed-off-by: Lee Jones
Reviewed-by: Marcus COOPER
Reviewed-by: Jonas ABERG
Tested-by: Jonas ABERG -
Changed conditions for restarting low battery measurements counter
and adjusted the interval between measurements to avoid RF burst
induced voltage drops, and to shorten time to decide to shut down.Signed-off-by: Hakan Berg
Signed-off-by: Martin Bergstrom
Signed-off-by: Lee Jones
Reviewed-by: Jonas ABERG
Reviewed-by: Marcus COOPER
16 Jan, 2013
8 commits
-
As HZ is a full-second, there is little point in rounding it.
Let's save a few cycles by using HZ directly.Signed-off-by: Lee Jones
Signed-off-by: Anton Vorontsov -
When calculating the average current the nominator will
overflow when the charging current is high.Signed-off-by: Lee Jones
Signed-off-by: Henrik Sölver
Reviewed-by: Par-Olof HAKANSSON
Reviewed-by: Jonas ABERG
Tested-by: Par-Olof HAKANSSON
Signed-off-by: Anton Vorontsov -
Add support for the battery over-voltage situation
Signed-off-by: Lee Jones
Signed-off-by: Hakan Berg
Reviewed-by: Karl KOMIEROWSKI
Signed-off-by: Anton Vorontsov -
Round the capacity values for better enduser experience.
Signed-off-by: Lee Jones
Signed-off-by: pender01
Reviewed-by: Jonas ABERG
Tested-by: Marcus COOPER
Signed-off-by: Anton Vorontsov -
In case of time out error IRQ needs to be disabled
otherwise we will get unbalanced enable/disable pairs.Signed-off-by: Lee Jones
Signed-off-by: Rickard Andersson
Reviewed-by: Jonas ABERG
Signed-off-by: Anton Vorontsov -
Today the battery recharge is determined with a voltage threshold. This
voltage threshold is only valid when the battery is relaxed. In charging
algorithm the voltage read is the loaded battery voltage and no
compensation is done to get the relaxed voltage. When maintenance
charging is not selected, this makes the recharging condition to almost
immediately activate when there is a discharge present on the battery.Depending on which vendor the battery comes from this behavior can wear
out the battery much faster than normal.The fuelgauge driver is responsible to monitor the actual battery
capacity and is able to estimate the remaining capacity. It is better to
use the remaining capacity as a limit to determine when battery should
be recharged.Signed-off-by: Lee Jones
Signed-off-by: Marcus Cooper
Reviewed-by: Hakan BERG
Reviewed-by: Jonas ABERG
Signed-off-by: Anton Vorontsov -
Doing so provides a greater degree of accuracy when dealing with
time-frames between 1us and 20ms. msleep() is only accurate for
wake-ups greater than 20ms.Signed-off-by: Lee Jones
Signed-off-by: Jonas ABERG
Reviewed-by: Johan BJORNSTEDT
Signed-off-by: Anton Vorontsov -
When enabling the CCEOC irq we might get false interrupt
from ab8500-driver due to the latched value will be saved
and interpreted as an IRQ when enabledSigned-off-by: Lee Jones
Signed-off-by: Johan Bjornstedt
Signed-off-by: Henrik Solver
Reviewed-by: Karl KOMIEROWSKI
Signed-off-by: Anton Vorontsov
06 Jan, 2013
1 commit
12 Dec, 2012
1 commit
-
The merge is merely to fix conflicts before sending a pull request.
Conflicts:
drivers/power/ab8500_btemp.c
drivers/power/ab8500_charger.c
drivers/power/ab8500_fg.c
drivers/power/abx500_chargalg.c
drivers/power/max8925_power.cSigned-off-by: Anton Vorontsov
11 Dec, 2012
4 commits
-
Now that we always pass platform specific battery management data
through platform_data instead of obtaining it via different means
depending the way be boot the system (DT or ATAGs); we need to
re-jiggle the way we acquire it in the driver start-up functions.
Now it is wrong for it to be missing, but we still allow Device
Tree code to fiddle with it once we've confirmed it's there.Signed-off-by: Lee Jones
-
Currently the AB8500 battery management subsystem receives platform
specific information via two different means depending on how the
platform is booted. If DT is not enabled, a reference to a *_bm_data
data structure containing each platform specific attribute is passed
though platform_data. However, if DT is enabled, then platform_data
is empty and the reference is gained though a DT specific probe
function. There are two issues here 1) the same reference is
being collected each time and 2) the DT way doesn't allow any
provisions to select different platform specific attributes, which
kind of defeats the object.Cc: Samuel Ortiz
Signed-off-by: Lee Jones -
The platform specific battery management configuration data structure
is currently called 'bat' short for 'battery'; however, it contains
information for all components of the battery management group, rather
than information pertaining to the battery itself - there are other
structures for that. So, in keeping with its structure namesake
'abx500_bm_data', we rename it to 'bm' here. Using similar logic,
we're also renaming 'bmdevs_of_probe' to the more device specific
'ab8500_bm_of_probe'.Signed-off-by: Lee Jones
-
The CCMuxOffset bit is not kept set. This will force the
columb counter of the AB8500 to use the measure offset
calibration. This should increase the accuracy of the fuel
gauge.Signed-off-by: Kalle Komierowski
Signed-off-by: Marcus Cooper
Signed-off-by: Lee Jones
Reviewed-by: Jonas ABERG
29 Nov, 2012
3 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Cc: Anton Vorontsov
Cc: David Woodhouse
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Anton Vorontsov
Cc: David Woodhouse
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Anton Vorontsov
Cc: David Woodhouse
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
19 Nov, 2012
1 commit
-
- This patch adds device tree support for fuelgauge driver
- optimize bm devices platform_data usage and of_probe(...)
Note: of_probe() routine for battery managed devices is made
common across all bm drivers.
- test status:
- interrupt numbers assigned differs between legacy and FDT mode.Signed-off-by: Rajanikanth H.V
Signed-off-by: Anton Vorontsov
07 Oct, 2012
1 commit
-
Pull battery updates from Anton Vorontsov:
"1. New drivers:
- Marvell 88pm860x charger and battery drivers;
- Texas Instruments LP8788 charger driver;
2. Two new power supply properties: whether a battery is authentic,
and chargers' maximal currents and voltages;
3. A lot of TI LP8727 Charger cleanups;
4. New features for Charger Manager, mainly now we can disable
specific regulators;
5. Random fixes and cleanups for other drivers."Fix up trivial conflicts in
* tag 'for-v3.7' of git://git.infradead.org/battery-2.6: (52 commits)
pda_power: Remove ac_draw_failed goto and label
charger-manager: Add support sysfs entry for charger
charger-manager: Support limit of maximum possible
charger-manager: Check fully charged state of battery periodically
lp8727_charger: More pure cosmetic improvements
lp8727_charger: Fix checkpatch warning
lp8727_charger: Add description in the private data
lp8727_charger: Fix a typo - chg_parm to chg_param
lp8727_charger: Make some cosmetic changes in lp8727_delayed_func()
lp8727_charger: Clean up lp8727_charger_changed()
lp8727_charger: Return if the battery is discharging
lp8727_charger: Make lp8727_charger_get_propery() simpler
lp8727_charger: Make lp8727_ctrl_switch() inline
lp8727_charger: Make lp8727_init_device() shorter
lp8727_charger: Clean up lp8727_is_charger_attached()
lp8727_charger: Use specific definition
lp8727_charger: Clean up lp8727 definitions
lp8727_charger: Use the definition rather than enum
lp8727_charger: Fix code for getting battery temp
lp8727_charger: Clear interrrupts at inital time
...
23 Aug, 2012
1 commit
-
Initialize return variable before exiting on an error path.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)//
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}//
Signed-off-by: Julia Lawall
Signed-off-by: Anton Vorontsov
22 Aug, 2012
1 commit
-
Initalizers for deferrable delayed_work are confused.
* __DEFERRED_WORK_INITIALIZER()
* DECLARE_DEFERRED_WORK()
* INIT_DELAYED_WORK_DEFERRABLE()Rename them to
* __DEFERRABLE_WORK_INITIALIZER()
* DECLARE_DEFERRABLE_WORK()
* INIT_DEFERRABLE_WORK()This patch doesn't cause any functional changes.
Signed-off-by: Tejun Heo
05 May, 2012
2 commits
-
These patches clean up some ugliness and brings the variable
initialisation formatting more into line with other drivers.Signed-off-by: Lee Jones
Signed-off-by: Anton Vorontsov -
If no platform data at all is supplied the driver crashes,
extend the checks to be more careful so we can compile in the
driver and boot also without platform data present.Acked-by: Arun Murthy
Signed-off-by: Linus Walleij
Signed-off-by: Anton Vorontsov
27 Mar, 2012
3 commits
-
Noticed the following warnings:
CC drivers/power/ab8500_fg.o
drivers/power/ab8500_fg.c: In function 'charge_full_store':
drivers/power/ab8500_fg.c:2258:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' [-Wformat]
drivers/power/ab8500_fg.c: In function ‘charge_now_store’:
drivers/power/ab8500_fg.c:2280:2: warning: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' [-Wformat]This patch fixes the issues.
Signed-off-by: Anton Vorontsov
-
The patch fixes the following sparse warning:
drivers/power/ab8500_charger.c:1619:6: warning: symbol 'ab8500_charger_detect_usb_type_work' was not declared. Should it be static?
drivers/power/abx500_chargalg.c:1709:24: warning: symbol 'abx500_chargalg_sysfs_ops' was not declared. Should it be static?
drivers/power/ab8500_fg.c:2328:24: warning: symbol 'ab8500_fg_sysfs_ops' was not declared. Should it be static?Signed-off-by: Anton Vorontsov
-
ab8500_fg_discharge_state_to() function should accept
'enum ab8500_fg_discharge_state' argument, not
'enum ab8500_fg_charge_state'.Signed-off-by: Anton Vorontsov