summaryrefslogtreecommitdiffstats
path: root/drivers/power
AgeCommit message (Collapse)Author
2013-03-31goldfish_battery: Use resource_size()Silviu-Mihai Popescu
This uses the resource_size() function instead of explicit computation. Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com> Signed-off-by: Andrei Epure <epure.andrei@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31lp8788-charger: Use PAGE_SIZE for the sysfs read operationKim, Milo
The sysfs allocates PAGE_SIZE. It is used by each R/W operation method. Use it instead of another buffer size. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31max8925_power: Use devm_kzalloc()Jingoo Han
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>
2013-03-31da9030_battery: Use devm_kzalloc()Jingoo Han
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>
2013-03-31da9052-battery: Use devm_kzalloc()Jingoo Han
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>
2013-03-31ds2760_battery: Use devm_kzalloc()Jingoo Han
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>
2013-03-31ds2780_battery: Use devm_kzalloc()Jingoo Han
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>
2013-03-31gpio-charger: Use devm_kzalloc()Jingoo Han
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>
2013-03-31isp1704_charger: Use devm_kzalloc()Jingoo Han
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>
2013-03-31max8903_charger: Use devm_kzalloc()Jingoo Han
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>
2013-03-31max8997_charger: Use devm_kzalloc()Jingoo Han
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>
2013-03-31max8998_charger: Use devm_kzalloc()Jingoo Han
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>
2013-03-31pcf50633-charger: Use devm_kzalloc()Jingoo Han
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>
2013-03-31rx51_battery: Use devm_kzalloc()Jingoo Han
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>
2013-03-3188pm860x_charger: Drop kfree of devm_kzalloc'd dataJingoo Han
The devm_kzalloc function allocates memory that is released automatically, when a driver detaches. Thus, there is no reason to explicitly call kfree in probe or remove functions. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31wm831x_backup: Use devm_kzalloc()Jingoo Han
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>
2013-03-31tps65090: Setup compatible property for dtRhyland Klein
Setup the compatible property so that when this device is registered through device tree, it can match the expected compatiblity string used in the tps65090 driver. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31twl4030_charger: Use module_platform_driver_probe()Jingoo Han
This patch uses module_platform_driver_probe() macro which makes the code smaller and simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31sbs-battery: Use dev_pm_opsLars-Peter Clausen
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31max17040_battery: Use dev_pm_opsLars-Peter Clausen
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks. Cc: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31ds2782_battery: Use dev_pm_opsLars-Peter Clausen
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks. Cc: Evgeny Romanov <romanov@neurosoft.ru> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-31sbs-battery: Use of_match_ptr() macroSachin Kamat
This eliminates having an #ifdef returning NULL for the case when OF is disabled. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-30Merge branch 'vexpress' of ↵Anton Vorontsov
git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64 From Catalin Marinas <catalin.marinas@arm.com>: "... move the vexpress poweroff/restart code from arch/arm to driver/power/reset so that the code can be reused in arm64."
2013-03-21arm: vexpress: Decouple vexpress-poweroff implementation from machine_descCatalin Marinas
This patch adds the pm_power_off and arm_pm_restart variable settings to the vexpress-poweroff.c driver to decouple it from the machine_desc definition. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Pawel Moll <pawel.moll@arm.com>
2013-03-21arm: vexpress: Move the poweroff/restart code to drivers/power/resetCatalin Marinas
This patch moves the arch/arm/mach-vexpress/reset.c functionality to drivers/platform/reset/ and adds the necessary Kconfig wiring. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Pawel Moll <pawel.moll@arm.com>
2013-03-20treewide: Fix typos in printkMasanari Iida
Correct spelling typo in various drivers. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-18s3c-adc-battery: Fix possible NULL pointer dereferenceSyam Sidhardhan
Check for (bat == NULL) has to be done before accessing bat Signed-off-by: Syam Sidhardhan <s.syam@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-18test_power: Fix a bug in setting module parameter valuesAndrey Gelman
When the kernel loads a module, module params are processed prior to calling module_init. As a result, setting module param value should not have side effects, at least as long as the module has not been initialized. Signed-off-by: Andrey Gelman <andreyg@compulab.co.il> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-03-18power_supply: Add support for tps65090-chargerRhyland Klein
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>
2013-03-18usb: phy: remove CONFIG_USB_OTG_UTILSFelipe Balbi
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>
2013-03-18usb: power: pda_power: check against CONFIG_USB_PHYFelipe Balbi
CONFIG_USB_OTG_UTILS will be removed very soon, so we should check CONFIG_USB_PHY instead. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-07ab8500-charger: Do not use [delayed_]work_pending()Lee Jones
There's no need to test whether a (delayed) work item is pending before queueing, flushing or cancelling it. Most uses are unnecessary and quite a few of them are buggy. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-03-07ab8500-fg: Change current calculationlme00437
This patch updates the gas gauge constant for electric current calculation according to hardware specification. Signed-off-by: Benoit GAUTHIER <benoit.gauthier-xsig@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Tested-by: Benoit GAUTHIER <benoit.gauthier-xsig@stericsson.com>
2013-03-07abx500-chargalg: Add charging current step interfaceLee Jones
To prevent overheating, provide differnt steps of charging current interface to allow thermal mitigation. This will provide possibility to reduce gradually the charging current. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-03-07pm2301-charger: Reference put missing after accessRupesh Kumar
Added missing pm_runtime_put_sync in read & write. Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Sandeep TRIPATHY <sandeep.tripathy@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2013-03-07pm2301-charger: Wake device on register accessRupesh Kumar
When USB Dedicated or Standard host chargers are plugged into the device, chargealg attempts to disable the PM2301 AC charger, However, disabling PM2301 was failing because of it being in runtime suepend mode & LPN pin being low. Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2013-03-07ab8500-bm: Trivially fix up some incorrect and out-of-date commentsMarcus Cooper
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 <marcus.xm.cooper@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com> Tested-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2013-03-07pm2301-charger: Charging LED control for pm2301Rupesh Kumar
The LED Indicator feature allows indicating through a led when the PM2301 battery charging is active. SW shall not disable this LED. Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2013-03-07pm2301-charger: lpn pin used only in C2C boardslme00437
This patch restricts use of LPN pin to C2C boards to avoid conflict on HSI for GPIO 60 use. Signed-off-by: Benoit GAUTHIER <benoit.gauthier-xsig@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Mustapha BEN-ZOUBEIR <mustapha.ben.zoubeir-xsig@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Tested-by: Benoit GAUTHIER <benoit.gauthier-xsig@stericsson.com>
2013-03-07ab8500-charger: Remove duplicate codeLee Jones
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-03-07abx500-chargalg: Use module_platform_driver() rathersrinidhi kasagar
deprecate some boilerplate code by using module_platform_driver helper macro. No functional changes. Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-03-07pm2301-charger: Removed unused code from PM2301 driverRupesh Kumar
Some of the headers and defines accrued over time are no longer in use. Let's take the opportunity to remove a few of them. Signed-off-by: Rupesh Kumar <rupesh.kumar@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2013-03-07ab8500-charger: Run detect workaround only on AB8500Rabin Vincent
Only AB8500 has this hardware bug, so these works only need to be run there. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Martin SJOBLOM <martin.w.sjoblom@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-03-07pm2301-charger: Add pm_runtime_resume & pm_runtime_suspendLee Jones
To optimize the current consumption we use pm_runtime autosuspend functions which execute the pm_runtime_suspend after a delay of inactivity on the other hand we use pm_runtime_resume every time we receive an interruption to wake up the pm2301. Signed-off-by: M BenZoubeir <mustapha.ben.zoubeir-xsig@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2013-03-07pm2301-charger: Adjust interrupt handler behaviorM BenZoubeir
Signed-off-by: M BenZoubeir <mustapha.ben.zoubeir-xsig@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2013-03-07ab8500-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: Lee Jones <lee.jones@linaro.org> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-03-07ab8500-chargalg: Use hrtimerLee Jones
Timers used for charging safety and maintenance must work even when CPU power has collapsed. By using hrtimers with the realtime clock the system is able to trigger an alarm that wakes-up the CPU and makes it possible to handle events. Allow a little slack time of 5 minutes for the hrtimers to allow CPU to be woken-up in a more optimal power saving way. A 5 minute delay to time-out timers relative to hours does not impact on safety. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-03-07abx500-chargalg: Prevent the watchdog from being kicked twiceLee Jones
Charging watchdog kicker work-thread gets started twice causing 'failed to kick watchdog' message after removing charger and when re-inserting charger. This patch removes the superfluous start of watchdog kicker-thread. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-03-07ab8500-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: Lee Jones <lee.jones@linaro.org> Reviewed-by: Hakan BERG <hakan.berg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Yang QU <yang.qu@stericsson.com>
2013-03-07ab8500-bm: Add support for the new ab8540 platformLee Jones
Provide AB8540 platform specific information required to run the Battery Management subsystem on AB8540 based devices. For this to happen we see the introduction of separate platform specific data structures and a means in which to process them. Signed-off-by: Lee Jones <lee.jones@linaro.org>