aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/bq2415x_charger.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-12-23bq2415x_charger: Add DT supportSebastian Reichel1-20/+52
This adds DT support to the bq2415x driver. Signed-off-by: Sebastian Reichel <sre@debian.org> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-12-23bq2415x_charger: Use power_supply notifier for automodePali Rohár1-17/+60
This patch removing set_mode_hook function from board data and replacing it with new string variable of notifier power supply device. After this change it is possible to add DT support because driver does not need specific board function anymore. Only static data and name of power supply device is required. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-10-25bq2415x_charger: Fix max battery regulation voltageAlexandre Belloni1-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>
2013-02-27power: convert to idr_alloc()Tejun Heo1-8/+3
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-16bq2415x_charger: Add support for offline and 100mA modePali Rohár1-7/+18
* 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-01-05bq2415x_charger: Use devm_kzalloc()Sachin Kamat1-9/+6
devm_kzalloc is device managed and makes error handling and code cleanup a bit simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05bq2415x_charger: Use module_i2c_driverSachin Kamat1-12/+1
module_i2c_driver() makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05bq2415x_charger: Remove unneeded version.h inclusionSachin Kamat1-1/+0
<linux/version.h> is not required here. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2012-11-18bq2415x_charger: Fix style issuesAnton Vorontsov1-121/+147
I hate doing these style fixups myself, but I also hate inconsitent code. Normally I just ask to resubmit the patch with the issues fixed, but N900 is special: I have a selfish interest in it. :) Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-11-18power_supply: Add bq2415x charger driverPali Rohár1-0/+1644
The bq2415x charger driver is needed for example on Nokia N900 for charging battery. Driver is part of open source project to replace proprietary battery management. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>