aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)Author
2013-07-13charger-manager: Ensure event is not used as format stringKees Cook
commit 3594f4c0d7bc51e3a7e6d73c44e368ae079e42f3 upstream. The exposed interface for cm_notify_event() could result in the event msg string being parsed as a format string. Make sure it is only used as a literal string. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Anton Vorontsov <cbou@mail.ru> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-25Merge tag 'for-v3.10-fixes' of git://git.infradead.org/battery-2.6Linus Torvalds
Pull bettery fixes from Anton Vorontsov: "Last minute one-liners: wrong kfree usage fix, module alias fixup and kconfig adjustments" * tag 'for-v3.10-fixes' of git://git.infradead.org/battery-2.6: pm2301_charger: Fix module alias prefix wm831x_backup: Fix wrong kfree call for devdata->backup.name bq27x00: Fix I2C dependency in KConfig lp8788-charger: Fix kconfig dependency
2013-05-10pm2301_charger: Fix module alias prefixAxel Lin
This driver is a i2c driver, use "i2c" rather than "platform" prefix for module alias. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-05-10wm831x_backup: Fix wrong kfree call for devdata->backup.nameAxel Lin
devdata->backup.name points to devdata->name, the memory for devdata->name is part of struct wm831x_backup. Thus remove kfree call for devdata->backup.name. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-05-10bq27x00: Fix I2C dependency in KConfigXiong Zhou
This patch fixes build failure(randconfig) of next-20130501. When config I2C as m, BATTERY_BQ27x00 as y, here comes the failure. The driver depends on I2C only if I2C is not disabled, as Lars commented. Last version of this patch make the driver depend on I2C unconditionally. Failure message: drivers/built-in.o: In function `bq27x00_read_i2c': bq27x00_battery.c:(.text+0x1082a7): undefined reference to `i2c_transfer' drivers/built-in.o: In function `bq27x00_battery_init': bq27x00_battery.c:(.init.text+0x6085): undefined reference to `i2c_register_driver' bq27x00_battery.c:(.init.text+0x60c7): undefined reference to `i2c_del_driver' drivers/built-in.o: In function `bq27x00_battery_exit': bq27x00_battery.c:(.exit.text+0xbf0): undefined reference to `i2c_del_driver' make: *** [vmlinux] Error 1 Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-05-05Merge tag 'mfd-3.10-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next Pull MFD update from Samuel Ortiz: "For 3.10 we have a few new MFD drivers for: - The ChromeOS embedded controller which provides keyboard, battery and power management services. This controller is accessible through i2c or SPI. - Silicon Laboratories 476x controller, providing access to their FM chipset and their audio codec. - Realtek's RTS5249, a memory stick, MMC and SD/SDIO PCI based reader. - Nokia's Tahvo power button and watchdog device. This device is very similar to Retu and is thus supported by the same code base. - STMicroelectronics STMPE1801, a keyboard and GPIO controller supported by the stmpe driver. - ST-Ericsson AB8540 and AB8505 power management and voltage converter controllers through the existing ab8500 code. Some other drivers got cleaned up or improved. In particular: - The Linaro/STE guys got the ab8500 driver in sync with their internal code through a series of optimizations, fixes and improvements. - The AS3711 and OMAP USB drivers now have DT support. - The arizona clock and interrupt handling code got improved. - The wm5102 register patch and boot mechanism also got improved." * tag 'mfd-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (104 commits) mfd: si476x: Don't use 0bNNN mfd: vexpress: Handle pending config transactions mfd: ab8500: Export ab8500_gpadc_sw_hw_convert properly mfd: si476x: Fix i2c warning mfd: si476x: Add header files and Kbuild plumbing mfd: si476x: Add chip properties handling code mfd: si476x: Add the bulk of the core driver mfd: si476x: Add commands abstraction layer mfd: rtsx: Support RTS5249 mfd: retu: Add Tahvo support mfd: ucb1400: Pass ucb1400-gpio data through ac97 bus mfd: wm8994: Add some OF properties mfd: wm8994: Add device ID data to WM8994 OF device IDs input: Export matrix_keypad_parse_of_params() mfd: tps65090: Add compatible string for charger subnode mfd: db8500-prcmu: Support platform dependant device selection mfd: syscon: Fix warnings when printing resource_size_t of: Add stub of_get_parent for non-OF builds mfd: omap-usb-tll: Convert to devm_ioremap_resource() mfd: omap-usb-host: Convert to devm_ioremap_resource() ...
2013-05-02lp8788-charger: Fix kconfig dependencyRandy Dunlap
Fix build errors in lp8788-charger by making it depend on IIO. Fixes errors when CONFIG_IIO=m and CHARGER_LP8788=y. lp8788-charger.c:(.text+0x2146b5): undefined reference to `iio_channel_get' lp8788-charger.c:(.text+0x2146ce): undefined reference to `iio_channel_get' lp8788-charger.c:(.text+0x214a86): undefined reference to `iio_read_channel_processed' lp8788-charger.c:(.text+0x214b51): undefined reference to `iio_read_channel_processed' lp8788-charger.c:(.text+0x214c30): undefined reference to `iio_read_channel_processed' lp8788-charger.c:(.text+0x214d93): undefined reference to `iio_channel_release' lp8788-charger.c:(.text+0x214dac): undefined reference to `iio_channel_release' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-30Merge tag 'for-v3.10' of git://git.infradead.org/battery-2.6Linus Torvalds
Pull battery updates from Anton Vorontsov: "Highlights: - OpenFirmware/DeviceTree support for the Power Supply core: the core now automatically populates supplied_from hierarchy from the device tree. With these patches chargers and batteries can now lookup each other without the board files support shim. Rhyland Klein at NVIDIA did the work - New ST-Ericsson ABX500 hwmon driver. The driver is heavily using the AB85xx core and depends on some recent changes to it, so that is why the driver comes through the battery tree. It has an appropriate ack from the hwmon maintainer (i.e. Guenter Roeck). Martin Persson at ST-Ericsson and Hongbo Zhang at Linaro authored the driver - Final bits to sync AB85xx ST-Ericsson changes into mainline. The changes touch mfd parts, but these were acked by the appropriate MFD maintainer (ie Samuel Ortiz). Lee Jones at Linaro did most of the work and lead the submission process. Minor changes, but still worth mentioning: - Battery temperature reporting fix for Nokia N900 phones - Versatile Express poweroff driver moved into drivers/power/reset/ - Tree-wide: use devm_kzalloc() where appropriate - Tree-wide: dev_pm_ops cleanups/fixes" * tag 'for-v3.10' of git://git.infradead.org/battery-2.6: (112 commits) pm2301-charger: Fix suspend/resume charger-manager: Use kmemdup instead of kzalloc + memcpy power_supply: Populate supplied_from hierarchy from the device tree power_supply: Add core support for supplied_from power_supply: Define Binding for power-supplies rx51_battery: Fix reporting temperature hwmon: Add ST-Ericsson ABX500 hwmon driver ab8500_bmdata: Export abx500_res_to_temp tables for hwmon ab8500_{bmdata,fg}: Add const attributes to some data arrays ab8500_bmdata: Eliminate CamelCase warning of some variables ab8500_btemp: Make ab8500_btemp_get* interfaces public goldfish_battery: Use resource_size() lp8788-charger: Use PAGE_SIZE for the sysfs read operation max8925_power: Use devm_kzalloc() da9030_battery: Use devm_kzalloc() da9052-battery: Use devm_kzalloc() ds2760_battery: Use devm_kzalloc() ds2780_battery: Use devm_kzalloc() gpio-charger: Use devm_kzalloc() isp1704_charger: Use devm_kzalloc() ...
2013-04-30Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "Usual stuff, mostly comment fixes, typo fixes, printk fixes and small code cleanups" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (45 commits) mm: Convert print_symbol to %pSR gfs2: Convert print_symbol to %pSR m32r: Convert print_symbol to %pSR iostats.txt: add easy-to-find description for field 6 x86 cmpxchg.h: fix wrong comment treewide: Fix typo in printk and comments doc: devicetree: Fix various typos docbook: fix 8250 naming in device-drivers pata_pdc2027x: Fix compiler warning treewide: Fix typo in printks mei: Fix comments in drivers/misc/mei treewide: Fix typos in kernel messages pm44xx: Fix comment for "CONFIG_CPU_IDLE" doc: Fix typo "CONFIG_CGROUP_CGROUP_MEMCG_SWAP" mmzone: correct "pags" to "pages" in comment. kernel-parameters: remove outdated 'noresidual' parameter Remove spurious _H suffixes from ifdef comments sound: Remove stray pluses from Kconfig file radio-shark: Fix printk "CONFIG_LED_CLASS" doc: put proper reference to CONFIG_MODULE_SIG_ENFORCE ...
2013-04-16pm2301-charger: Fix suspend/resumeLars-Peter Clausen
The pm2301-charger driver implements runtime pm and at the same time uses the legacy pm callbacks for suspend and resume. This does not work since the I2C core wont look at the legacy pm callbacks if a driver has the 'pm' field set. This patch fixes it by moving over to dev_pm_ops for suspend/resume as well. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16charger-manager: Use kmemdup instead of kzalloc + memcpyAndrei Epure
Patch found using coccinelle. Signed-off-by: Andrei Epure <epure.andrei@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16power_supply: Populate supplied_from hierarchy from the device treeRhyland Klein
With this patch the power_supply_core will try to populate supplied_from hierarchy from the device tree. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16power_supply: Add core support for supplied_fromRhyland Klein
This patch adds support for supplies to register a list of char *'s which represent the list of supplies which supply them. This is the opposite as the supplied_to list. This change maintains support for supplied_to until all drivers which make use of it already are converted. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16rx51_battery: Fix reporting temperaturePali Rohár
This patch fixing units (1/10 °C) in which is temperature reported. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16ab8500_bmdata: Export abx500_res_to_temp tables for hwmonHongbo Zhang
This patch exports the thermistor resistance-to-temperature tables, so that the hwmon driver can access them, and also adds the corresponding table size variables. Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16ab8500_{bmdata,fg}: Add const attributes to some data arraysHongbo Zhang
This patch adds const attributes to AB8500 power and temperature related read-only data arrays. Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16ab8500_bmdata: Eliminate CamelCase warning of some variablesHongbo Zhang
Some AB8500 power related variable names don't comply with kernel coding rules, any new patch using these variables will result in CamelCase warnings from checkpatch.pl, this patch re-name these variables. Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16ab8500_btemp: Make ab8500_btemp_get* interfaces publicHongbo Zhang
Make ab8500_btemp_get_temp interface public, export it and also export the ab8500_btemp_get, ab8500_btemp_get_batctrl_temp interfaces, so that the ab8500 hwmon driver can use them. Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-08power: rx51_battery: Fix reporting correct valuesPali Rohár
Tell twl4030_madc_conversion that this driver needs raw values. Driver twl4030_madc has some hardcoded values and conversation functions which are incorrect for Nokia RX-51 board. This driver rx51_battery expects raw values which convert itself. This patch fixing values reported by power supply interface. Before this patch driver reported always incorrect values on 3.8 kernel (sometimes design capacity was negative). Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Anton Vorontsov <anton@enomsg.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
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>