Power: DA9052 Battery module V6
PATCH 5/6 Power: DA9052 Battery module V6
Driver for DA9052 battery charger. This driver depends on DA9052 MFD core dirver for definitions and methods.
This patch is functionally tested on Samsung SMDKV6410.
---
As per the thread https://lkml.org/lkml/2011/11/9/42 a transceiver notifications will be added in the usb gadget driver to support setting of USB charge current limit in the battery driver. This patch adds logic to support that notification. Later when usb gadget driver gets modified this driver needs modification only for registration with event notification.
---
Changes since v5
- Added notifier callback for setting USB charging current limit Changes since v4
- Remove unnecessary type cast
- Improve code readability
Changes since v3
- Included power_supply.h file
- Corrected the definition of DA9052_BAT_THRESHOLD macro
- Changed definition of charger_type_enum
- Added API da9052_battery_read_end_current
- Added API da9052_battery_check_status
- Changed the way of handling the interrupts in da9052_bat_irq Changes since v2
- Correct code styling for inline functions
- Remove averaging algorithm
- Set use_for_apm thru board specific parameter
--- drivers/power/Kconfig | 7 + drivers/power/Makefile | 1 + drivers/power/da9052-battery.c | 665 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 673 insertions(+), 0 deletions(-) create mode 100644 drivers/power/da9052-battery.c
drivers/power/Kconfig +7 -0
@@ -150,6 +150,13 @@ config BATTERY_DA9030 Say Y here to enable support for batteries charger integrated into DA9030 PMIC. +config BATTERY_DA9052 + tristate "Dialog DA9052 Battery" + depends on PMIC_DA9052 + help + Say Y here to enable support for batteries charger integrated into + DA9052 PMIC. + config BATTERY_MAX17040 tristate "Maxim MAX17040 Fuel Gauge" depends on I2C
drivers/power/Makefile +1 -0
@@ -25,6 +25,7 @@ obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o obj-$(CONFIG_BATTERY_BQ20Z75) += bq20z75.o obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o +obj-$(CONFIG_BATTERY_DA9052) += da9052-battery.o obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o obj-$(CONFIG_BATTERY_MAX17042) += max17042_battery.o obj-$(CONFIG_BATTERY_Z2) += z2_battery.o
drivers/power/da9052-battery.c new file +665 -0
665 lines not on this page · raw message
Quoted 2 lines · Ashish Jangam
+static u32 const vc_tbl[3][68][2] = {
+ /* For temperature 10 degree celisus*/
s/celisus/Celsius
Same on other places.
Regards,
Fabio Estevam
Quoted 9 lines · Fabio Estevam
Quoted 2 lines · Ashish Jangam
+static u32 const vc_tbl[3][68][2] = {
+ /* For temperature 10 degree celisus*/s/celisus/Celsius
Same on other places.
I fixed this and applied the patch.
Thanks!
Signature · 2 lines
Anton Vorontsov Email: [email protected]
Quoted 7 lines · Ashish Jangam
Driver for DA9052 battery charger. This driver depends on DA9052 MFD core dirver for definitions and methods.
This patch is functionally tested on Samsung SMDKV6410.
Signed-off-by David Dajun Chen <[email protected]>Signed-off-by Ashish Jangam <[email protected]>
I presume this depends on other patches, so I'm fine if this goes via non-battery tree,
If you want me to merge it into battery git tree, I can do it as well.
Thanks!
Signature · 2 lines
Anton Vorontsov Email: [email protected]
Quoted 2 lines · Anton Vorontsov
I presume this depends on other patches, so I'm fine if this goes via non-battery tree,
There should be no direct dependencies for new MFDs - the Kconfig required to depend on the MFD core means that the drivers can't be selected until the core appears.