bq2415x-charger: Add BQ2415x charger driver

Added support for BQ2415x charger.
It enables battery charging via AC.

Change-Id: I3b2cf70328781521c1172722a7ce2e61a5de7378
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
[oleg.kosheliev@ti.com: ported from K3.0,
added suspend and resume functions]
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
twl603x_battery: Add twl603x Battery driver

Added support for twl6030/32 battery charger.
It enables battery charging via USB and
interacts with BQ2415x AC charger.

Change-Id: I67d45d4c9d8817a23eebdde866bb246d56930c6a
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>
[oleg.kosheliev@ti.com: ported from K3.0
Watchdog reset moved to dedicated non-deferrable
delayed work. Added wakeup from suspend if charging from
USB DCP. Added Errata field in device_info.
Fixed mem leak in probe (caused by kmemdup of
platform_data).
Added unregistration of the USB notifier in suspend.
Removed self-rescheduling of the bci_monitor_work.
Removed interrupts masking at suspend.
Removed BQ2415x suspend/resume actions because they
are implemented in BQ2415x driver now. Removed
disabling of the thermal monitoring in suspend
if the battery is charging. Removed android
wake-locks. Omap_dm_timer replaced with
generic alarmtimer. Alarmtimer is based on RTC timer.
Initialized di->dev in probe (it was not assigned
in k3.0 and NULL was indicated in all info msgs).]
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
ARM: OMAP4: twl603x: Add platform data for twl603x_bci_battery

Add platform data to initialize twl603x battery
charger driver.

Change-Id: Ie8a309f8ee2db1f0fb17d8e22f8d0c65ae23447d
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
ARM: OMAP4: Tablet/SDP: Add twl603x/BQ2415x battery charger support to board file

Enable twl603x charger and BQ2415x AC charger support in
board files for 44xx tablet and 4430sdp.

Change-Id: I09dc3e5cf897074f6845f3beabdc60948bae3f4b
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>

Conflicts:

	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-44xx-tablet.c
ARM: MFD: TWL6032: Implementation of the ProDB00119490 errata

Residual voltage may be present on VBUS when USB cable is unplugged.
Workaround: Increase the VBUS anticollapse loop threshold to 4.44 V.

This errata affects only TWL6032 ES1.1

Change-Id: I7533fa7e3caa98e9e326f0c30cfb31d813303be8
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
ARM: MFD: TWL6030: Implementation of the ProDB00112620 errata

This errata affects only TWL6030 ES2.1. The usage of the CIN_LIMIT
codes above 600mA (CHARGERUSB_CINLIMIT Register, codes
650mA/700mA/750mA) may lead to an unlimited input current in
case VBUS < 4.1V.

Workaround: The anti-collapse feature needs to be enabled before
usage of the CIN_LIMIT. All CIN_LIMIT codes will be functional at
all anti-collapse levels.

Change-Id: I4fc0eb64cc96b692f4761a27098df307e1f5cd54
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
ARM: MFD: TWL6030: Implementation of the ProDB00110684 errata

This errata affects only TWL6030 ES2.1. Each time a charge is
enabled via SW, a THMREG interrupt triggers (Internal USB charger
fault interrupt line).

Workaround: Interrupt (the bit #1 of CHARGERUSB_INT_MASK) has to be
masked before enabling the charge, and unmasked after charge is
enabled.

Change-Id: I14074e384a863c82ba61af9ea9434afe75cc2bc8
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>