summaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)Author
2012-09-25power: ab8500_charger: Limit USB charger currentux500-battery-managementMartin Bergstrom
The USB charger current is limited according to information comming from the USB driver Signed-off-by: Martin Bergstrom <martin.bergstrom@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: abx500_chargalg: Fix quick re-attach charger issue.Marcus Cooper
The patch for 426250 added a change to check for the quick re-attachment of the charger connection as an error in the AB8500 HW meant that a quick detach/attach wouldn't be detected. This patch isolates the original change so that newer AB's are not affected. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Martin SJOBLOM <martin.w.sjoblom@stericsson.com> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_charger: Add UsbLineCtrl2 referenceMarcus Cooper
When the state of USB Charge detection is changed then the calls use a define for another register in other bank. This change creates a new define for the correct register and removes the magic numbers that are present. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Conflicts: drivers/power/ab8500_charger.c
2012-09-25power: ab8500_charger: Use USBLink1Status RegisterMarcus Cooper
The newer AB's such as the AB8505, AB9540 etc include a USBLink1 Status register which detects a larger range of external devices. This should be used instead of the USBLine Status register. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Yang QU <yang.qu@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_fg: Moving structure definitions to header fileMathieu J. Poirier
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2012-09-25power: abx500_chargalg: Use hrtimerHakan Berg
Timers used for charging safety and maintenance must work even when CPU is power collapsed. By using hrtimers with realtime clock, system is able to trigger an alarm that wakes the CPU up and make it possible to handle the event. Allow a little slack of 5 minutes to the hrtimers to allow CPU to be waked up in a more optimal power saving way. A 5 minute delay to time out timers on hours does not impact on safety. Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
2012-09-25power: ab8500: Re-alignment with internal developement.Mathieu J. Poirier
A lot of developement happened internally since the first mainlining of the battery managmenent driver. Most of the new code can be historically accounted for but some of it can't. This patch is a gathering of the code for which history was lost but still relevant to the well being of the driver. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2012-09-25power: ab8500-chargalg: update battery health on safety timer expHakan Berg
When the charging safety timer is elapsed the battery health is shown as "Good". This is misleading and also hard to distingiush problems reported on "phone discharges although charger is attached". When safety timer elapses that is an indication of a fault in the battery of some kind. Hence report as POWER_SUPPLY_HEALTH_UNSPEC_FAILURE. Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Arun MURTHY <arun.murthy@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2012-09-25power: Cancelling status charging notification.Mathieu J. Poirier
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2012-09-25power: ab8500 : quick re-attach for ext chargerRupesh Kumar
Quick re-attach charging behaviour is not required for external ac charger. Internal AC/USB Charger removal detection problem is due to a bug in AB8500 ASICs. Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2012-09-25power: Harmonising platform data declaration/handlingMathieu J. Poirier
Making platform data declaration and handling similar accross all ab8500_xyc.c battery management files. Also adding gards against NULL platform data. Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2012-09-25power: chargealg: Realign with upstream versionLoic Pallardy
Upstream version of AB charge algo has been reverted during kernel 3.4 port. This patch restore state by: - renaming ab8500_chargal.c in abx500_chargal.c - renaming function from ab8500 to abx500 - moving generic structure in "include/mfd/abx500.h" Goal is to ease next code reversion and realignment with mainline Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2012-09-25power: ab8500: defer btemp filtering while initRupesh Kumar
Due to btemp filtering enabled during init, temp values reported to charge algorithm driver started from 0. As a result,charge algorithm was going into wrong state and charging was stopped. This patch defers btemp filtering till init is done. Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Martin SJOBLOM <martin.w.sjoblom@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2012-09-25power: ab8500: remove unecesary define flagMarcus Cooper
Remove flag that serve no purpose from source code, Kconfig and Makefile. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
2012-09-25power: charging: Add AB8505_USB_LINK_STATUSHakan Berg
The ab8505 does not have the same address for USB link-status as has ab8500. Add AB8505_USB_LINK_STATUS and code to switch to correct constant. Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-09-25power: charging: Allow capacity to raise from 1%Hakan Berg
When battery capacity was going below 1% fg in 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%. That problem is addressed with this patch. Signed-off-by: Hakan BERG <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
2012-09-25power: ab8500_btemp: Filter btemp readingsHakan Berg
Battery tempreature readings sometimes fails and results in a value far from recent values. This patch adds a software filter that disposes such readings, by allowing direct updates on temperature only if two samples result in the same temperature. Else only allow 1 degree change from previous reported value in the direction of the new measurement. Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Martin SJOBLOM <martin.w.sjoblom@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-09-25power: ab8500: ADC for battery thermistorMarcus Cooper
When using ABx500_ADC_THERM_BATCTRL the battery ID resistor is combined with a NTC resistor to both identify the battery and to measure its temperature. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com> Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-09-25power: ab8500_charger: Prevent auto drop of VBUSMartin Sjoblom
Do not set higher current in stepping functionality if VBUS is dropping. After VBUS has dropped try to set current once again. If dropping again then we have found the maximum capability of the charger. Signed-off-by: Martin Sjoblom <martin.w.sjoblom@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Per FORLIN <per.forlin@stericsson.com>
2012-09-25power: l9540: Charge only mode fixesRupesh Kumar
Fix for: charging not getting enabled in charge only mode by external charger. Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2012-09-25power: ab8500_bm: Quick re-attach charging behaviourKalle Komierowski
Due to a bug in some AB8500 ASICs charger removal cannot always be detected if the removal and reinsertion is done to close in time. This patch detects above described case and handles the situation so that charging will be kept turned on. Signed-off-by: Kalle Komierowski <karl.komierowski@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2012-09-25power: add backup battery charge voltages.Yang QU
Add 2.7v, 2.9v, 3.0v, 3.2v and 3.3v charging voltage for backup battery. Before that only 2.5v, 2.6v, 2.8v, 3.1v are available. Signed-off-by: Yang QU <yang.qu@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Maxime COQUELIN <maxime.coquelin@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Xiao Mei ZHANG <xiaomei.zhang@stericsson.com>
2012-09-25power: ab8500_fg: Report unscaled capacityMartin Bergstrom
Unscaled capacity should be reported for POWER_SUPPLY_PROP_CAPACITY. Signed-off-by: Martin Bergstrom <martin.bergstrom@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_fg: add power cut feature for ab8505Rikard Olsson
Add support for a power cut feature which allows user to configure when ab8505 should shut down system due to low battery. Signed-off-by: Rikard Olsson <rikard.p.olsson@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Martin SJOBLOM <martin.w.sjoblom@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: u8500_charger: Delay for USB enumerationPaer-Olof Haakansson
If charging is started before USB enumeration of an Accessory Charger Adapter has finished, the AB8500 will generate a VBUS_ERROR. This in turn results in timeouts and delays the enumeration with around 15 seconds. This patch delays the charging and then ramps currents slowly to avoid VBUS errors. The delay allows the enumeration to have finished before charging is turned on. Signed-off-by: Martin Sjoblom <martin.w.sjoblom@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_charger: Do not touch VBUSOVV bitsJonas Aaberg
Do not touch the VBUSOVV in USBCHTRL2 when running on AB8505. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
2012-09-25power: ab8500_fg: fix to use correct battery charge full designRajkumar Kasirajan
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 <rajkumar.kasirajan@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Vijaya Kumar K-1 <vijay.kilari@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Olivier CLERGEAUD <olivier.clergeaud@stericsson.com> Reviewed-by: Arun MURTHY <arun.murthy@stericsson.com> Reviewed-by: Rupesh KUMAR <rupesh.kumar@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2012-09-25power: ab8500: Flush & sync all worksJonas Aaberg
Flush and sync all workqueues at suspend to avoid that we suspend in the middle of a work. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
2012-09-25power: ab8500_fg: Goto INIT_RECOVERY when charger removedMartin Bergström
When the charger is removed we need to go to INIT_RECOVERY state instead of directly to RECOVERY state. Signed-off-by: Martin Bergstrom <martin.bergstrom@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500 - Accessing Autopower register failsNicolas Guion
The fallback software control register has moved in the ab8505 and ab9540. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Reviewed-by: Nicolas GUION <nicolas.guion@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: sysfs interface updateMichel JAOUEN
Add new sysfs interface to get current charge status Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Olivier CLERGEAUD <olivier.clergeaud@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: charge: update watchdog for pm2xxx supportLoic Pallardy
AB and PMxxx doesn't have same watchdog refresh period Add watchdog to refresh period parameters in x500 charger structure, this should kick watchdog every 30sec. The AC charging should also kick both pm2xxx and the AB charger watchdog. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500: adaptation to ab versionMichel JAOUEN
Add AB9540 and AB8505 support to ab8500_temp driver. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_fg: Adjust for RF bursts voltage drops.Hakan Berg
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 <hakan.berg@stericsson.com> Signed-off-by: Martin Bergstrom <martin.bergstrom@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
2012-09-25power: Add plaform data charger configurablesLoic Pallardy
Allow to indicate wheter AC and USB charge capabilities are supported from platform data. Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/58093 Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Olivier CLERGEAUD <olivier.clergeaud@stericsson.com>
2012-09-25power: AB workaround for invalid chargerHenrik Sölver
AB8500 refuses to start charging when some types of non standard chargers are connected. This change force the AB to start charging. Signed-off-by: Henrik Sölver <henrik.solver@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Yvan FILLION <yvan.fillion@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: Overflow in current calculationPaer-Olof Haakansson
When calculating the average current the nominator will overflow when the charging current is high. Signed-off-by: Henrik Sölver <henrik.solver@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: Adds support for legacy USB chargersMarcus Cooper
A Legacy USB charger should be handled directly by the charger driver. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: remove unused defines.Marcus Cooper
Cleanup of the ab8500_charger driver. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2012-09-25power: Add sysfs interfaces for capacityDaniel WILLERUD
Switchable depending on whether capacity scaling is enabled Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Daniel WILLERUD <daniel.willerud@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_bm: Added support for BATT_OVVHakan Berg
Add support for the battery over-voltage situation Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2012-09-25power: bm remove superfluous BTEMP thermal comp.Hakan Berg
BTEMP thermal compensation factor times 10 is applied in two places, probe and get_property. Removed from probe. Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2012-09-25power: ab8500_fg: Round capacity outputpender01
Round the capacity values for better enduser experience. Signed-off-by: pender01 <peter.enderborg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: Adds support for Car/Travel AdaptersHakan Berg
The Travel and Carkit adapter should be handled directly by the charger driver. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_bm: Ignore false btemp low interruptHakan Berg
Ignore the low btemp interrupts for ab8500 3.0 and 3.3 Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_fg: balance IRQ enableRickard Andersson
In case of time out error IRQ needs to be disabled otherwise we will get unbalanced enable/disable pairs. Signed-off-by: Rickard Andersson <rickard.andersson@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: Recharge condition not optimal for batteryMarcus Cooper
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: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-09-25power: ab8500_charger: Handle gpadc errorsJonas Aaberg
Gracefully handle gpadc conversion errors. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Johan BJORNSTEDT <johan.bjornstedt@stericsson.com>
2012-09-25power: ab8500_fg: usleep_range instead of short msleepJonas Aaberg
Signed-off-by: Jonas ABERG <jonas.aberg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Johan BJORNSTEDT <johan.bjornstedt@stericsson.com>
2012-09-25power: ab8500_fg: flush sync on suspendJonas Aaberg
Do flush sync on the fg workqueue at suspend instead of just flushing it. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Johan BJORNSTEDT <johan.bjornstedt@stericsson.com>