summaryrefslogtreecommitdiffstats
path: root/drivers/power
AgeCommit message (Collapse)Author
2013-02-27power: convert to idr_alloc()Tejun Heo
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Anton Vorontsov <cbou@mail.ru> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-21Merge tag 'staging-3.9-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging tree update from Greg Kroah-Hartman: "Here's the big staging tree merge for 3.9-rc1 Lots of cleanups and updates for drivers all through the staging tree. We are pretty much "code neutral" here, adding just about as many lines as we removed. All of these have been in linux-next for a while." * tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits) staging: comedi: vmk80xx: wait for URBs to complete staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon staging: et131x: Update TODO list staging: et131x: Remove assignment of skb->dev staging: wlan-ng: hfa384x.h: fix for error reported by smatch staging/zache checkpatch ERROR: spaces prohibited around that staging/ozwpan: Mark read only parameters and structs as const staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat staging/ozwpan: Mark local functions as static (fix sparse warnings) staging/ozwpan: Add missing header includes staging/usbip: Mark local functions as static (fix sparse warnings) staging/xgifb: Remove duplicated code in loops. staging/xgifb: Consolidate return paths staging/xgifb: Remove code without effect staging/xgifb: Remove unnecessary casts staging/xgifb: Consolidate if/else if with identical code branches staging: vt6656: replaced custom TRUE definition with true staging: vt6656: replaced custom FALSE definition with false staging: vt6656: replace custom BOOL definition with bool staging/rtl8187se: Mark functions as static to silence sparse ...
2013-02-21Merge tag 'driver-core-3.9-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core patches from Greg Kroah-Hartman: "Here is the big driver core merge for 3.9-rc1 There are two major series here, both of which touch lots of drivers all over the kernel, and will cause you some merge conflicts: - add a new function called devm_ioremap_resource() to properly be able to check return values. - remove CONFIG_EXPERIMENTAL Other than those patches, there's not much here, some minor fixes and updates" Fix up trivial conflicts * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits) base: memory: fix soft/hard_offline_page permissions drivercore: Fix ordering between deferred_probe and exiting initcalls backlight: fix class_find_device() arguments TTY: mark tty_get_device call with the proper const values driver-core: constify data for class_find_device() firmware: Ignore abort check when no user-helper is used firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER firmware: Make user-mode helper optional firmware: Refactoring for splitting user-mode helper code Driver core: treat unregistered bus_types as having no devices watchdog: Convert to devm_ioremap_resource() thermal: Convert to devm_ioremap_resource() spi: Convert to devm_ioremap_resource() power: Convert to devm_ioremap_resource() mtd: Convert to devm_ioremap_resource() mmc: Convert to devm_ioremap_resource() mfd: Convert to devm_ioremap_resource() media: Convert to devm_ioremap_resource() iommu: Convert to devm_ioremap_resource() drm: Convert to devm_ioremap_resource() ...
2013-02-20Merge tag 'for-v3.9' of git://git.infradead.org/battery-2.6Linus Torvalds
Pull battery updates from Anton Vorontsov: "Four new drivers: - goldfish_battery: This is Android Emulator battery driver. Originally from Google, but Intel folks reshaped it for mainline - pm2301_charger: A new driver for ST-Ericsson 2301 Power Management chip, uses AB8500 battery management core - qnap-poweroff: The driver adds poweroff functionality for QNAP NAS boxes - restart-poweroff: A generic driver that implements 'power off by restarting'. The actual poweroff functionality is implemented through a bootloader, so Linux' task is just to restart the box. The driver is useful on Buffalo Linkstation LS-XHL and LS-CHLv2 boards. Andrew Lunn worked on submitting the driver (as well as qnap-poweroff above). Additionally: - A lot of fixes for ab8500 drivers. This is a part of efforts of syncing internal ST-Ericsson development tree with the mainline. Lee Jones @ Linaro worked on compilation and reshaping these series. - New health properties for the power supplies: "Watchdog timer expire" and "Safety timer expire" - As usual, a bunch of fixes/cleanups here and there" * tag 'for-v3.9' of git://git.infradead.org/battery-2.6: (81 commits) bq2415x_charger: Add support for offline and 100mA mode generic-adc-battery: Fix forever loop in gab_remove() goldfish_battery: Add missing GENERIC_HARDIRQS dependency da9030_battery: Include notifier.h bq27x00_battery: Fix reporting battery temperature power/reset: Remove newly introduced __dev* annotations lp8727_charger: Small cleanup in naming ab8500_btemp: Demote initcall sequence ds2782_battery: Add power_supply_changed() calls for proper uevent support power: Add battery driver for goldfish emulator u8500-charger: Delay for USB enumeration ab8500-bm: Remove individual [charger|btemp|fg|chargalg] pdata structures ab8500-charger: Do not touch VBUSOVV bits ab8500-fg: Use correct battery charge full design pm2301: LPN mode control support pm2301: Enable vbat low monitoring ab8500-bm: Flush all work queues before suspending ab8500-fg: Go to INIT_RECOVERY when charger removed ab8500-charger: Add support for autopower on AB8505 and AB9540 abx500-chargalg: Add new sysfs interface to get current charge status ... Fix up fairly straightforward conflicts in the ab8500 driver. But since it seems to be ARM-specific, I can't even compile-test the result..
2013-02-16bq2415x_charger: Add support for offline and 100mA modePali Rohár
* Renamed mode BQ2415X_MODE_NONE to BQ2415X_MODE_OFF because this mode turning chaging completly off * Added new mode BQ2415X_MODE_NONE which enable charging with maximal current limit 100mA (this is minimal safe value for bq2415x chips) Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-02-16generic-adc-battery: Fix forever loop in gab_remove()Dan Carpenter
There is a forever loop calling iio_channel_release() because the "chan < " part of the "chan < ARRAY_SIZE()" is missing. This is in both the error handling on probe and also in the remove function. The other thing is that it's possible for some of the elements of the adc_bat->channel[chan] array to be an ERR_PTR(). I've changed them to be NULL instead. We're still not allowed to pass NULLs to iio_channel_release() so I've added a check. Finally, I removed an unused "chan = ARRAY_SIZE(gab_chan_name);" statement as a small cleanup. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-02-16goldfish_battery: Add missing GENERIC_HARDIRQS dependencyHeiko Carstens
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>
2013-02-08da9030_battery: Include notifier.hMichal Hocko
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>
2013-02-06driver-core: constify data for class_find_device()Michał Mirosław
All in-kernel users of class_find_device() don't really need mutable data for match callback. In two places (kernel/power/suspend_test.c, drivers/scsi/osd/osd_uld.c) this patch changes match callbacks to use const search data. The const is propagated to rtc_class_open() and power_supply_get_by_name() parameters. Note that there's a dev reference leak in suspend_test.c that's not touched in this patch. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-06iio: Update iio_channel_get API to use consumer device pointer as argumentGuenter Roeck
For iio_channel_get to work with OF based configurations, it needs the consumer device pointer instead of the consumer device name as argument. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Anton Vorontsov <anton@enomsg.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02bq27x00_battery: Fix reporting battery temperaturePali Rohár
Reported temperature can be also negative, so cache value in non negative Kelvin degree. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-02-02power/reset: Remove newly introduced __dev* annotationsThierry Reding
__devinit, __devexit and __devexit_p have recently been removed and should no longer be used. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Jason Cooper <jason@lakedaemon.net> Acked-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-02-02lp8727_charger: Small cleanup in namingDan Carpenter
"pdata" and "pchg->pdata" are the same. Changing the function call to pdata->get_batt_present() makes it match the check and it's a little cleaner. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-02-02Merge branch 'tb-power-2' of git://git.linaro.org/people/ljones/linux-3.0-ux500Anton Vorontsov
Pull a huge ab8500/pm2301 pile of changes from Lee Jones. Lee did an awesome job cleaning this stuff up and thus brought ab8500 Stericsson's development tree much closer to the mainline. Even more changes to come, though. Conflicts: drivers/power/Kconfig
2013-02-02ab8500_btemp: Demote initcall sequenceRajanikanth H.V
Power supply subsystem creates thermal zone device for the property 'POWER_SUPPLY_PROP_TEMP' which requires thermal subsystem to be ready before 'ab8500 battery temperature monitor' driver is initialized. ab8500 btemp driver is initialized with subsys_initcall whereas thermal subsystem is initialized with fs_initcall which causes thermal_zone_device_register(...) to crash since the required structure 'thermal_class' is not initialized yet: Unable to handle kernel NULL pointer dereference at virtual address 000000a4 pgd = c0004000 [000000a4] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 Tainted: G W (3.8.0-rc4-00001-g632fda8-dirty #1) PC is at _raw_spin_lock+0x18/0x54 LR is at get_device_parent+0x50/0x1b8 pc : [<c02f1dd0>] lr : [<c01cb248>] psr: 60000013 sp : ef04bdc8 ip : 00000000 fp : c0446180 r10: ef216e38 r9 : c03af5d0 r8 : ef275c18 r7 : 00000000 r6 : c0476c14 r5 : ef275c18 r4 : ef095840 r3 : ef04a000 r2 : 00000001 r1 : 00000000 r0 : 000000a4 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5787d Table: 0000404a DAC: 00000015 Process swapper/0 (pid: 1, stack limit = 0xef04a238) Stack: (0xef04bdc8 to 0xef04c000) [...] [<c02f1dd0>] (_raw_spin_lock+0x18/0x54) from [<c01cb248>] (get_device_parent+0x50/0x1b8) [<c01cb248>] (get_device_parent+0x50/0x1b8) from [<c01cb8d8>] (device_add+0xa4/0x574) [<c01cb8d8>] (device_add+0xa4/0x574) from [<c020b91c>] (thermal_zone_device_register+0x118/0x938) [<c020b91c>] (thermal_zone_device_register+0x118/0x938) from [<c0202030>] (power_supply_register+0x170/0x1f8) [<c0202030>] (power_supply_register+0x170/0x1f8) from [<c02055ec>] (ab8500_btemp_probe+0x208/0x47c) [<c02055ec>] (ab8500_btemp_probe+0x208/0x47c) from [<c01cf0dc>] (platform_drv_probe+0x14/0x18) [<c01cf0dc>] (platform_drv_probe+0x14/0x18) from [<c01cde70>] (driver_probe_device+0x74/0x20c) [<c01cde70>] (driver_probe_device+0x74/0x20c) from [<c01ce094>] (__driver_attach+0x8c/0x90) [<c01ce094>] (__driver_attach+0x8c/0x90) from [<c01cc640>] (bus_for_each_dev+0x4c/0x80) [<c01cc640>] (bus_for_each_dev+0x4c/0x80) from [<c01cd6b4>] (bus_add_driver+0x16c/0x23c) [<c01cd6b4>] (bus_add_driver+0x16c/0x23c) from [<c01ce54c>] (driver_register+0x78/0x14c) [<c01ce54c>] (driver_register+0x78/0x14c) from [<c00086ac>] (do_one_initcall+0xfc/0x164) [<c00086ac>] (do_one_initcall+0xfc/0x164) from [<c02e89c8>] (kernel_init+0x120/0x2b8) [<c02e89c8>] (kernel_init+0x120/0x2b8) from [<c000e358>] (ret_from_fork+0x14/0x3c) Code: e3c3303f e5932004 e2822001 e5832004 (e1903f9f) ---[ end trace ed9df72941b5bada ]--- Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com> Cc: stable@vger.kernel.org Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-02-02ds2782_battery: Add power_supply_changed() calls for proper uevent supportEvgeny Romanov
This patch affects on Android battery indicator. Battery driver should send uevent message when battery status changes in order to get Android battery level dynamically updated. Delayed work was added to periodically check battery status and capacity. Signed-off-by: Evgeny Romanov <romanov@neurosoft.ru> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-02-02power: Add battery driver for goldfish emulatorMike Lockwood
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>
2013-01-25power: Convert to devm_ioremap_resource()Thierry Reding
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Cc: Anton Vorontsov <cbou@mail.ru> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-23u8500-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: Lee Jones <lee.jones@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23ab8500-bm: Remove individual [charger|btemp|fg|chargalg] pdata structuresLee Jones
None of the aforementioned components have their own dedicated platform data structures anymore. Instead they have all been merged into one big Battery Management container. Let's remove them and place all the nice newly added attributes into the core container. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23ab8500-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: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Tested-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
2013-01-23ab8500-fg: 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: Lee Jones <lee.jones@linaro.org> 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: Rabin VINCENT <rabin.vincent@stericsson.com> Tested-by: Rupesh KUMAR <rupesh.kumar@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23pm2301: LPN mode control supportLee Jones
The AC charger plug-in detection while booting causes I2C read failure if AC charger is not connected. Now the LPN pin is enabled for every PM2301 register access, which solves the issue. 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: Vijaya Kumar K-1 <vijay.kilari@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23pm2301: Enable vbat low monitoringRajkumar Kasirajan
Enable support for low battery checking. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23ab8500-bm: Flush all work queues before suspendingJonas Aaberg
Flush all workqueues at suspend time to avoid suspending during work. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
2013-01-23ab8500-fg: Go to 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: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23ab8500-charger: Add support for autopower on AB8505 and AB9540Nicolas Guion
Accessing autopower register fails on the AB8505 and ab9540 as the fallback software control register has moved. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Lee Jones <lee.jones@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> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23abx500-chargalg: Add new sysfs interface to get current charge statusLee Jones
Allow a user to check on AB8500 charging status from debugfs. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23pm2301: 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: Lee Jones <lee.jones@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> Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23ab8500-chargalg: Only root should have write permission on sysfs fileLee Jones
Only root should have write permission on sysfs file ab8500_chargalg/chargalg. Cc: stable@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23pm2301: Remove volt_now & curr_now propertiesLoic Pallardy
There is no support to measure the main charger voltage and current using AB9540 gpadc. Therefore this has been removed from the driver. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com> Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
2013-01-23pm2301: Clean-up PM2301 interrupt managementOlivier Clergeaud
Fix the way interrupts are handled within the PM2301 charging driver. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Olivier CLERGEAUD <olivier.clergeaud@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
2013-01-23pm2301: Move all configuration and emum structs out to a header fileLee Jones
Also shift the file description to a more suitable location. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23ab8500-chargalg: Update battery health on safety timer expLee Jones
When the charging safety timer elapses, the battery health is shown as "Good". This is misleading and also makes it difficult to distinguish issues relating to discharging despite the fact that the charger is still connected. When in actual fact a safety timer elapse is an indication of a fault in the battery. Here we make this clearer by reporting POWER_SUPPLY_HEALTH_UNSPEC_FAILURE instead. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23ab8500-charger: Kick watchdogLee Jones
Kicks the watchdog so charging will not stop. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23ab8500-btemp: Adaptation to AB8505 and AB9540 platformsMichel JAOUEN
Add AB9540 and AB8505 support to ABx500 BTEMP driver. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Lee Jones <lee.jones@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> Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23ab8500-fg: Adjust for RF bursts voltage dropsHakan 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: Lee Jones <lee.jones@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
2013-01-23ab8500-charger: 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: Lee Jones <lee.jones@linaro.org> Reviewed-by: Yvan FILLION <yvan.fillion@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Yvan FILLION <yvan.fillion@stericsson.com>
2013-01-23pm2301: Provide u9540 support for the pm2301 chargerMichel JAOUEN
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>
2013-01-19qnap-poweroff: Fix license stringAndrew Lunn
GPLv2+ is not a valid license string. Replace it with one that is. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_fg: Remove pointless round_jiffies() callLee Jones
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 <lee.jones@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_fg: Overflow in current calculationPaer-Olof Haakansson
When calculating the average current the nominator will overflow when the charging current is high. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Henrik Sölver <henrik.solver@stericsson.com> Reviewed-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_charger: Adds support for legacy USB chargersMarcus Cooper
A Legacy USB charger should be handled directly by the charger driver. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_charger: Remove unused definesMarcus Cooper
Cleanup of the ab8500_charger driver. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_fg: Added support for BATT_OVVHakan Berg
Add support for the battery over-voltage situation Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_btemp: Remove superfluous BTEMP thermal compHakan Berg
BTEMP thermal compensation factor times 10 is applied in two places, probe and get_property. Removed from probe. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_fg: Round capacity outputpender01
Round the capacity values for better enduser experience. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: pender01 <peter.enderborg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_bm: Adds support for Car/Travel AdaptersHakan Berg
The Travel and Carkit adapter should be handled directly by the charger driver. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_btemp: Ignore false btemp low interruptHakan Berg
Ignore the low btemp interrupts for ab8500 3.0 and 3.3 Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15ab8500_btemp: Allign battery temperature resolution with the frameworkLee Jones
The Linux Power Supply framework expects battery temperatures to have a resolution of 0.1 degree Celsius; however, the AB8500 btemp driver supplies a battery temperature resolution of 1 degree Celsius. We therefore have to use a factor 10 on the measured values. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>