summaryrefslogtreecommitdiffstats
path: root/drivers/power
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'for-v3.13' of git://git.infradead.org/battery-2.6Linus Torvalds2013-11-1811-351/+751
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull battery updates from Anton Vorontsov: "Highlights: - A new driver for TI BQ24735 Battery Chargers, courtesy of NVidia. - Device tree bindings for TWL4030 chips. - Random fixes and cleanups" * tag 'for-v3.13' of git://git.infradead.org/battery-2.6: pm2301-charger: Remove unneeded NULL checks twl4030_charger: Add devicetree support power_supply: Fix documentation for TEMP_*ALERT* properties max17042_battery: Support regmap to access device's registers max17042_battery: Use SIMPLE_DEV_PM_OPS charger-manager : Replace kzalloc to devm_kzalloc and remove uneccessary code bq2415x_charger: Fix max battery regulation voltage tps65090-charger: Use "IS_ENABLED(CONFIG_OF)" for DT code tps65090-charger: Drop devm_free_irq of devm_ allocated irq power_supply: Add support for bq24735 charger pm2301-charger: Staticize pm2xxx_charger_die_therm_mngt pm2301-charger: Check return value of regulator_enable ab8500-charger: Remove redundant break ab8500-charger: Check return value of regulator_enable isp1704_charger: Fix driver to work with changes introduced in v3.5
| * pm2301-charger: Remove unneeded NULL checksDan Carpenter2013-11-121-15/+2
| | | | | | | | | | | | | | | | If "pm2" were NULL we would oops printing the error message. Fortunately, that's not possible so I have removed the NULL checks. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * twl4030_charger: Add devicetree supportNeilBrown2013-11-121-3/+44
| | | | | | | | | | | | | | | | | | | | This allows the charger to be enabled with devicetree, and allows the parameters for charging the backup battery to be set. Signed-off-by: NeilBrown <neilb@suse.de> Acked-by: Kumar Gala <galak@codeaurora.org> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * max17042_battery: Support regmap to access device's registersJonghwa Lee2013-10-251-183/+174
| | | | | | | | | | | | | | | | | | This patch makes max17042 fuelguage driver uses regmap API to access its device's registers. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * max17042_battery: Use SIMPLE_DEV_PM_OPSManish Badarkhe2013-10-251-11/+5
| | | | | | | | | | | | | | Use the SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. Signed-off-by: Manish Badarkhe <badarkhe.manish@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * charger-manager : Replace kzalloc to devm_kzalloc and remove uneccessary codeJonghwa Lee2013-10-251-58/+27
| | | | | | | | | | | | | | | | Use devm function for dynamic memory allocation. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * bq2415x_charger: Fix max battery regulation voltageAlexandre Belloni2013-10-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | As per the datasheets, maximum battery regulation voltage is 4440mV. The formula is (voltage - offset) / step, so the maximum value is: (4440 - 3500) / 20 = 47 Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Thanks-to: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * tps65090-charger: Use "IS_ENABLED(CONFIG_OF)" for DT codeManish Badarkhe2013-10-251-14/+5
| | | | | | | | | | | | | | | | | | | | | | Instead of "#if defined(CONFIG_OF)" use "IS_ENABLED(CONFIG_OF)" option for DT code to avoid if-deffery in code. Also, arranged header files in alphabetically. Signed-off-by: Manish Badarkhe <badarkhe.manish@gmail.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * tps65090-charger: Drop devm_free_irq of devm_ allocated irqWei Yongjun2013-10-251-7/+4
| | | | | | | | | | | | | | | | | | The devm_request_irq function allocates irq that is released when a driver detaches. Thus, there is no reason to explicitly call devm_free_irq in probe or remove functions. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power_supply: Add support for bq24735 chargerDarbha Sriharsha2013-10-253-0/+426
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for the bq24735 charger chipset. The bq24735 is a high-efficiency, synchronous battery charger. It allows control of the charging current, input current, and the charger voltage DAC's through SMBus. Signed-off-by: Darbha Sriharsha <dsriharsha@nvidia.com> Signed-off-by: Rhyland Klein <rklein@nvidia.com> Thanks-to: Stephen Warren <swarren@wwwdotorg.org> Thanks-to: Thierry Reding <thierry.reding@gmail.com> Thanks-to: Manish Badarkhe <badarkhe.manish@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * pm2301-charger: Staticize pm2xxx_charger_die_therm_mngtSachin Kamat2013-10-251-1/+1
| | | | | | | | | | | | | | | | pm2xxx_charger_die_therm_mngt is used only in this file. Make it static. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * pm2301-charger: Check return value of regulator_enableSachin Kamat2013-10-251-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Check the return value of regulator_enable to silence the following warning: drivers/power/pm2301_charger.c:725:20: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * ab8500-charger: Remove redundant breakSachin Kamat2013-10-251-1/+0
| | | | | | | | | | | | | | | | | | Each of the if-else blocks has a break statement. Remove the additional one which is unreachable. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * ab8500-charger: Check return value of regulator_enableSachin Kamat2013-10-251-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | Check the return value of regulator_enable to silence the following type of warnings: drivers/power/ab8500_charger.c:1390:20: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * isp1704_charger: Fix driver to work with changes introduced in v3.5Pali Rohár2013-10-221-51/+40
| | | | | | | | | | | | | | | | | | | | * omap musb driver does not report USB_EVENT_ENUMERATED event anymore * omap musb driver reporting USB_EVENT_VBUS when charger is connected * read last event from phy->last_event (instead from ulpi register) * do not call wall charger detection more times Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
* | tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang2013-11-152-3/+3
|/ | | | | | | | | | | | 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 <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Remove GENERIC_HARDIRQ config optionMartin Schwidefsky2013-09-131-2/+1
| | | | | | | | After the last architecture switched to generic hard irqs the config options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code for !CONFIG_GENERIC_HARDIRQS can be removed. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* Merge tag 'for-v3.12' of git://git.infradead.org/battery-2.6Linus Torvalds2013-09-1016-17/+2054
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull battery/power supply driver updates from Anton Vorontsov: "New drivers: - APM X-Gene system reboot driver by Feng Kan and Loc Ho (APM). - Qualcomm MSM reboot/poweroff driver by Abhimanyu Kapur (Codeaurora). - Texas Instruments BQ24190 charger driver by Mark A. Greer (Animal Creek Technologies). - Texas Instruments TWL4030 MADC battery driver by Lukas Märdian and Marek Belisko (Golden Delicious Computers). The driver is used on Freerunner GTA04 phones. Highlighted fixes and improvements: - Suspend/wakeup logic improvements: power supply objects will block system suspend until all power supply events are processed. Thanks to Zoran Markovic (Linaro), Arve Hjonnevag and Todd Poynor (Google)" * tag 'for-v3.12' of git://git.infradead.org/battery-2.6: rx51_battery: Fix channel number when reading adc value power: Add twl4030_madc battery driver. bq24190_charger: Workaround SS definition problem on i386 builds power_supply: Prevent suspend until power supply events are processed vexpress-poweroff: Should depend on the required infrastructure twl4030-charger: Fix compiler warning with regulator_enable() rx51_battery: Replace hardcoded channels values. bq24190_charger: Add support for TI BQ24190 Battery Charger ab8500-charger: We print an unintended error message max8925_power: Fix missing of_node_put power_supply: Replace strict_strtol() with kstrtol() power: Add APM X-Gene system reboot driver power_supply: tosa_battery: Get rid of irq_to_gpio usage power supply: collie_battery: Convert to use dev_pm_ops power_supply: Make goldfish_battery depend on GOLDFISH || COMPILE_TEST power: reset: Add msm restart support MAINTAINERS: drivers/power: add entry for SmartReflex AVS drivers
| * rx51_battery: Fix channel number when reading adc valueMarek Belisko2013-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This issue was introduced in commit 8e2747f031bd "power: rx51_battery: Replace hardcoded channels values." Original code use channel as argument which was shifted by one in function. After mentioned commit argument is already shifted so we need to get index back. Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power: Add twl4030_madc battery driver.Marek Belisko2013-08-303-0/+253
| | | | | | | | | | | | | | | | | | | | This driver is used and tested on gta04 phone. It's using twl4030_madc (similar to rx51 existing driver). Driver also implement charging and discharging calibration data so user can define ranges and level. Signed-off-by: Marek Belisko <marek@goldelico.com> Signed-off-by: Lukas Märdian <lukas@goldelico.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * bq24190_charger: Workaround SS definition problem on i386 buildsAnton Vorontsov2013-08-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For __i386__ builds we have: arch/x86/include/uapi/asm/ptrace-abi.h:#define SS 16 And in the driver: BQ24190_SYSFS_FIELD_RO(vbus_stat, SS, VBUS_STAT) That breaks the build like this: drivers/power/bq24190_charger.c:375:138: error: ‘BQ24190_REG_16’ undeclared here (not in a function) drivers/power/bq24190_charger.c:375:162: error: ‘BQ24190_REG_16_THERM_STAT_MASK’ undeclared here (not in a function) drivers/power/bq24190_charger.c:375:203: error: ‘BQ24190_REG_16_THERM_STAT_SHIFT’ undeclared here (not in a function) With this commit we workaround the problem by undefining 'SS'. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power_supply: Prevent suspend until power supply events are processedZoran Markovic2013-08-271-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch, originally authored by Arve Hjonnevag and Todd Poynor, prevents the system from entering suspend mode until the power supply plug, unplug, or any other change of state event is fully processed. This guarantees that the screen lights up and displays the battery charging state. The implementation uses the power supply wakeup_source object. Cc: David Woodhouse <dwmw2@infradead.org> Cc: Arve Hjonnevag <arve@android.com> Cc: Todd Poynor <toddpoynor@google.com> Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * vexpress-poweroff: Should depend on the required infrastructurePawel Moll2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARM Versatile Express reset driver requires platform-specific config infrastructure to be present in the kernel. When VEXPRESS_CONFIG is not selected, the build will fail like this: drivers/built-in.o: In function `vexpress_reset_do.clone.0': iio-trig-interrupt.c:(.text+0x1aff38): undefined reference to `__vexpress_config_func_get' iio-trig-interrupt.c:(.text+0x1aff4c): undefined reference to `vexpress_config_write' Added required dependency to the Kconfig entry. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * twl4030-charger: Fix compiler warning with regulator_enable()Peter Ujfalusi2013-08-271-1/+6
| | | | | | | | | | | | | | | | | | | | The return value of regulator_enable need to be checked. This patch fixes the following warning: drivers/power/twl4030_charger.c: In function ‘twl4030_charger_enable_usb’: drivers/power/twl4030_charger.c:192:20: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * rx51_battery: Replace hardcoded channels values.Marek Belisko2013-08-271-4/+8
| | | | | | | | | | | | | | | | In twl4030_madc header exist defines for fixed channels + add rx51 specific channels and replace all hardcoded channels values. Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * bq24190_charger: Add support for TI BQ24190 Battery ChargerMark A. Greer2013-08-273-0/+1553
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add driver support for the Texas Instruments BQ24190 battery charger. Some of the information provided by the device is about the charger and other information is about the battery so create two power_supply objects (one for each) and provide the appropriate information for each one. The device has many fields that go beyond what is reasonable to report or modify using the existing 'POWER_SUPPLY_PROP_*' properties so the driver exports the register fields via sysfs. They are prefixed by 'f_' (for 'field') to make it easier to distinguish between a register field and a "normal" sysfs file exported by the power_supply infrastructure. Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * ab8500-charger: We print an unintended error messageDan Carpenter2013-08-271-0/+1
| | | | | | | | | | | | | | | | | | There is a missing break statement here, so we print an error message that the USB type is invalid. The original code still works fine though except for the error message. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * max8925_power: Fix missing of_node_putLibo Chen2013-08-271-0/+1
| | | | | | | | | | | | | | Decrease np device_node refcount after we are done with the node. Signed-off-by: Libo Chen <libo.chen@huawei.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power_supply: Replace strict_strtol() with kstrtol()Jingoo Han2013-08-091-1/+1
| | | | | | | | | | | | | | | | The usage of strict_strtol() is not preferred, because strict_strtol() is obsolete. Thus, kstrtol() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power: Add APM X-Gene system reboot driverLoc Ho2013-08-093-0/+111
| | | | | | | | | | | | | | | | | | | | | | Add APM X-Gene SoC system reboot driver. This driver handles only system reboot. System shutdown is board specific and can be handled by board driver or GPIO based shutdown driver. Signed-off-by: Loc Ho <lho@apm.com> Signed-off-by: Feng Kan <fkan@apm.com> Signed-off-by: Kumar Sankaran <ksankaran@apm.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power_supply: tosa_battery: Get rid of irq_to_gpio usageAndrea Adami2013-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the following error: linux/drivers/power/tosa_battery.c:153:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration] Since 9d08d5d77a355510c2f5657c86b0a4b25acfe72c, irq_to_gpio() is no longer available but still in use by collie_battery.c. As it's just for a debug message, just get rid of this call. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power supply: collie_battery: Convert to use dev_pm_opsAndrea Adami2013-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the following warnings: linux/drivers/power/collie_battery.c:372:2: warning: initialization from incompatible pointer type [enabled by default] linux/drivers/power/collie_battery.c:372:2: warning: (near initialization for 'collie_bat_driver.suspend') [enabled by default] Referencess: MFD: ucb1x00-core: convert to use dev_pm_ops https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/mfd?id=5a09b7120a965a7d7e8494d0ed509135bbce0118 MFD: mcp-core: remove legacy driver suspend/resume methods https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/mfd?id=cf4abfcc0df2985ff6061f74e63b8353f2a1d0bc Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power_supply: Make goldfish_battery depend on GOLDFISH || COMPILE_TESTPaul Gortmaker2013-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nearly all the other goldfish peripherals (mtd, keyboard, etc) have a dependency on the main platform's GOLDFISH Kconfig item, but this one got skipped. Even with consistency as a justification, there was initial resistance[1] from some people to adding it however, as they wanted the extra compile coverage. Now, with CONFIG_COMPILE_TEST, we have the middle ground that will give people the coverage who want it, and let those who don't want it to skip ever seeing the option presented. [1] https://lkml.org/lkml/2013/2/27/333 Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power: reset: Add msm restart supportAbhimanyu Kapur2013-08-093-0/+80
| | | | | | | | | | | | | | | | | | | | Add support for restart and poweroff functionality present on MSM chipsets with the MPM2 ps-hold hardware. Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org> Tested-by: Ivan T. Ivanov <iivanov@mm-sol.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
* | treewide: Fix typo in printkMasanari Iida2013-08-202-3/+3
|/ | | | | | | | Correct spelling typo in printk Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge tag 'for-v3.11' of git://git.infradead.org/battery-2.6Linus Torvalds2013-07-1021-124/+191
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull battery subsystem update from Anton Vorontsov: "Nothing exciting this time, just assorted fixes and cleanups" * tag 'for-v3.11' of git://git.infradead.org/battery-2.6: (25 commits) charger-manager: Fix regulator_get() return check charger-manager: Fix a bug when it unregisters notifier block of extcon tps65090-charger: Add dt node to power_supply sbs-battery: Add dt to power_supply struct power_supply: Add of_node_put to fix refcount power_supply: Move of_node out of the #ifdef CONFIG_OF power/reset: Make the vexpress driver optional on arm and arm64 charger-manager: Add missing newlines, fix a couple of typos, add pr_fmt tps65090-charger: Fix AC detect MAINTAINERS: Update email address for Anton Vorontsov charger-manager: Ensure event is not used as format string power_supply: Replace strict_strtoul() with kstrtoul() generic-adc-battery: Fix checking if none of the channels are supported power: Use platform_{get,set}_drvdata() pm2301_charger: Return error if create_singlethread_workqueue fails pm2301_charger: Fix NULL pointer dereference lp8727_charger: Support the device tree feature twl4030_charger: Remove unnecessary platform_set_drvdata() rx51_battery: Remove unnecessary platform_set_drvdata() jz4740-battery: Remove unnecessary platform_set_drvdata() ...
| * charger-manager: Fix regulator_get() return checkJonghwa Lee2013-06-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | This patch fixes return value checking of regulator_get() in charger-manager driver. The API, regulator_get(), returns ERR_PTR() when it fails to get regulator with given name, not NULL. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * charger-manager: Fix a bug when it unregisters notifier block of extconJonghwa Lee2013-06-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch prevents NULL pointer error cauesed by unregistering unregistered exton notifier block. At the probing time of charger manager, it tries to remove extcon notifier block when it fails to initialize them. It has to be applied for only registered one. Otherwise, it'd make kernel panic. To make it work right, it checks extcon_specific_cable_nb's extcon_dev node. If extcon cable notifier block was registered successfully, it has proper extcon_dev pointer if not so it has NULL pointer. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * tps65090-charger: Add dt node to power_supplyRhyland Klein2013-06-281-0/+1
| | | | | | | | | | | | | | | | | | Passing in the dt node for this charger enables the logic in the core to lookup this device, to see if it is supplying another power_supply, through dt. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * sbs-battery: Add dt to power_supply structRhyland Klein2013-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | By passing in the dt node of this device, we enable the logic for linking power_supplies together from dt. This is specified by adding a "power-supplies" property with a phandle to the charger for a given supply. Enable this logic now for the sbs-battery driver. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power_supply: Add of_node_put to fix refcountRhyland Klein2013-06-281-0/+4
| | | | | | | | | | | | | | | | | | of_parse_phandle increments the refcount for a dt node before returning it. Add of_node_put where needed to properly decrement the refcount when we are done using a given node. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power/reset: Make the vexpress driver optional on arm and arm64Pawel Moll2013-06-211-1/+2
| | | | | | | | | | | | | | | | | | | | The driver can be used on either arm or arm64 platforms, but the latter doesn't have any platform-specific configuration options, so it must be possible to manually enable the driver. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * charger-manager: Add missing newlines, fix a couple of typos, add pr_fmtJoe Perches2013-06-091-80/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that dev_<level> calls are newline terminated. Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt to prefix all pr_<level> calls with "charger-manager: " Fix a couple of typos. Fix formats with terminating n that should be \n. Coalesce formats for easier grep. Align arguments to open parenthesis for these dev_<level> calls. Add missing spaces after coalescing multiple string segments. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * tps65090-charger: Fix AC detectAndrew Chew2013-06-091-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VACG interrupt was not being enabled. Thus, interrupts were never generated when AC status changes. In addition, interrupts were never cleared after taking and processing the interrupt. Added the register offset for the INTR_MASK register, since this is needed to unmask the VACG interrupt. Enabled the VACG interrupt in tps65090_config_charger(). Cleared interrupts after processing, in tps65090_charger_isr(). Also removed unused variable "enable" in tps65090_enable_charging(), and fixed a typo in one of the dev_err() prints. Signed-off-by: Andrew Chew <achew@nvidia.com> Tested-by: Rhyland Klein <rklein@nvidia.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * charger-manager: Ensure event is not used as format stringKees Cook2013-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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: stable@vger.kernel.org Cc: Anton Vorontsov <cbou@mail.ru> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power_supply: Replace strict_strtoul() with kstrtoul()Jingoo Han2013-06-062-7/+7
| | | | | | | | | | | | | | | | | | The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * generic-adc-battery: Fix checking if none of the channels are supportedAxel Lin2013-06-061-1/+3
| | | | | | | | | | | | | | | | | | If none of the channels are supported, index is 0. Also ensure to return error code instead of 0 in goto second_mem_fail path. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: anish kumar <anish198519851985@gmail.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * power: Use platform_{get,set}_drvdata()Jingoo Han2013-06-062-3/+3
| | | | | | | | | | | | | | | | | | Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * pm2301_charger: Return error if create_singlethread_workqueue failsAxel Lin2013-06-061-2/+2
| | | | | | | | | | | | | | | | Return error instead of 0 if create_singlethread_workqueue call fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
| * pm2301_charger: Fix NULL pointer dereferenceAxel Lin2013-06-061-1/+6
| | | | | | | | | | | | | | | | | | | | Add checking pl_data in probe, this prevent possible NULL pointer dereference. Also fix NULL pointer deference in dev_err when allocate memory for pm2 fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>