mfd: twl6030-gpadc add driver for GPADC block

This patch adds support for the General Purpose A/D Convertor in
twl6030/twl6032 chips.

This driver is based on the twl4030-madc driver written by Mikko Ylinen
and Filipe Balbi, and currently has a 'misc' device interface. It needs
to be moved to drivers/hwmon as per comments from the community on the
twl4030-madc driver.

The GPADC blocks in the two chips have some small differences, twl6030
can measure X number of 10 bit channels. twl6032 can only measure one
channel at a time but has 12 bits of resolution. The driver hides the
differences in number of channel handling but not resolution from the
caller.

Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
Signed-off-by: Girish S G <girishsg@ti.com>
Signed-off-by: Ambresh K <ambresh@ti.com>
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
Signed-off-by: Sergii Postulga <x0153364@ti.com>
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: x0169938 <vasyl.yushchyshen@ti.com>
mfd: twl6030-gpadc add Kconfig and Makefile

Add the Kconfig/Makefile changes to add this driver to the build.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
mfd: twl-core add child creation for gpadc

Add the child creation for the GPADC and the GPADC IRQ definition.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
mfd: twl-core move features flag before use

features flag is needed by IRQ initialisation and DT child creation
so move it earlier in the function.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
mfd: twl6030-irq handle 6032 irqs

The twl6032 changed meaning of a couple of IRQ bits so add handling for
this difference.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
mfd: twl-core add errata handling

This patch adds for the kernel code ability to the errata
implementation for the TWL6030/TWL6032 chips.

Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
power: twl6030_bci_battery add new charger driver

This patch adds support for the battery charging component of the
Phoenix IC. It enables charging via USB.

It handles the software driven driver of the twl6030 and the hardware
controlled driver of the twl6032. The modes are automatically detected
from the OTP data of the chip.

Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
Signed-off-by: Huzefa Kankroliwala <huzefank@ti.com>
Signed-off-by: Ambresh K <ambresh@ti.com>
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
Signed-off-by: Sergii Postulga <x0153364@ti.com>
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Mykola Oleksiienko <x0174904@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Sivakumar Pothireddy <sivakumar.pothireddy@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
power: Kconfig and Makefile for twl6030_bci_battery

Add the Kconfig and Makefile entries for the new driver.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
mfd: twl-core add child creation for battery charger

Add the child creation for 6030/6032 battery charger.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
TI Fuel Gauge module for TWL6030 PMIC

FG module takes voltage, current and coulomb counter
readings from the PMIC, executes fuel gauging algorithms,
and outputs estimated battery state of charge to the
sysfs interface.

Change-Id: Ifcf0f69f68c722e5c3fea2c20334b83b21ea07a0
Signed-off-by: Max Herman <mherman@fsisys.com>
power: twl6030_bci_battery fix compile errors

The fuelguage patch has a couple of minor merge errors, these are fixed
here.

Change-Id: Id80000f1eddf6a1a72ba4ba1a93ab47833280f00
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Documentaion: phoenix lite board file

Add a document to detail the values for the Phoenix Lite board data.

Specifically the charger/fuelguage values for initialistion.

Change-Id: Ia1fa3e245e581e459b6db155ce5960350cdce593
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
power: twl6030_bci_battery fix init order

Fix the initialiasion order to not oops on boot. Need to initialise
the WORK and the fg before registering the power supplies.

Also fix the case there the cell_cfg is not in platform data.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>