OMAP4: MFD: Add resources assignments for the TWL6032

This patch adds definition and initialization of the resources
assignments (LDOs, SYSEN, SMPS, etc) for the TWL6032.

Change-Id: Icdca2129d0ca552fae8f8b0849489d9d1c77f526
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
MFD: TWL6032: fix typo in power resources assignments table

There was an typo in the TWL6032 power resources assignments
table. This patch corrects it.

Change-Id: Ie270bceb62dee4cb67790eb7194eeb52e86b8dea
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
OMAP4: MFD: Modifying operational code to adjust for the compilation issue

Modifying operational code to adjust for the compilation issue:
drivers/mfd/twl6030-poweroff.c:28: warning: "TWL6030_PHOENIX_DEV_ON"
redefined include/linux/i2c/twl.h:473: note: this is the location
of the previous definition drivers/mfd/twl6030-poweroff.c

Change-Id: Ifa344bbdcf1348024c9f06ee83ca802f7de40407
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
MFD: TWL6030: Fix the interrupt mapping for GPADC

The GPADC_SW_EOC interrupt offset was incorrectly specified in
the twl6030 interrupt mapping table. Fix the same.

Change-Id: I4bbfe4f6685da46d3e27f62c3821653505726509
Signed-off-by: Mohan V <mohanv@ti.com>
Signed-off-by: Maulik Mankad <maulik@ti.com>
MFD: TWL6030: Add Support for GPADC

This patch adds support for the General Purpose A/D Convertor in
TWL6030.
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.

Change-Id: I84568c847502e562f7a1656b845f94b00e6aaecf
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>
omap-hsmmc: Increase debounce for SD card insert

Increasing debounce time for SD card insert. Without
this, we are seeing erroneous card insert detect
interrupts coming in even while removal of SD card.

Change-Id: I1e8fcaec22f438708fe40db2871a4ab565bfb9a5
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
TWL6030: GPADC: Add suspend/resume hooks

During OFF mode need to take care of GPADC cntrl module
so that leakage is minimal. Disable/Enable TEMP1 over
suspend/resume.

Change-Id: I09ae8a880a9ef0c95a9905dc3dbe54d1973871ca
Signed-off-by: Girish S G <girishsg@ti.com>
MFD: TWL6030: GPADC: Disable GPADC during suspend.

Currently GPADC is kept enabled through-out, so enable/disable
GPADC during resume/suspend so that VANA can enter lp state.

GPADC_TEMP{1,2}_EN along with thermal monitor features are
handled as part of BCI driver. So removing enabling/disabling
of GPADC_TEMP1_EN from GPADC driver.

Change-Id: I02553c5e324764cc2d8720c2f586871917b31ef7
Signed-off-by: Ambresh K <ambresh@ti.com>
mfd: twl: Register suspend/resume hooks for IRQ wakeup capability.

TWL40XX and TWL60XX devices has an interrupt line which is connected to
application processor like OMAP. Since these devices supports many features
like MMC card detect, USB cable detect, RTC interrupt etc which needs to
wakeup application processor on these events.

So provide the i2c client driver suspend hooks so that wakeup capability
can be enabled on these events using the common IRQ line.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Axel Haslam <axelhaslam@ti.com>
OMAP4: power: Battery driver.

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

Change-Id: Ia076c3f6009c7d064a68153f9193b7f927553ad9
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>
omap4: battery: static notifier list head

Initialise statically allocated blocking_notifier_head
structure at compile time.

It was initialised when driver's probe function was called.
If any other driver registered its notifier_block in notifier_list
before probe was called, then registered notifier_block would be
lost.

Change-Id: I5d611cbdb5b789f55a1e62fbe690039cd33ed287
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
OPMAP4: AC charger: AC power supply disconnect event.

If board is booted with AC power supply connected, then
first disconnect event is not detected and
/sys/class/power_supply/twl6030_ac/online returns '2'
meaning AC charging.

Now, charge state value detected when probe was called
is saved in device info structure.

Change-Id: I5534acc40456d39b4f37f30797b9bcae500cdc3b
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
HACK: OMAP4: set 100% battery level when device is on AC

If device is using the battery simulator set battery level
to 100%.

This is a HACK until the test scripts are updated to handle the
battery < 5% window on Android

Change-Id: Iee8e215e89514274636b745705b79f1ef019511d
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
Acked-by: Akash Choudhari <akashc@ti.com>
Signed-off-by: Huzefa Kankroliwala <huzefank@ti.com>
OMAP4: battery charger: Don't check battery presence in interrupt.

During the battery charging process interrupts can occur and
software must read the reason of the interrupt. One of the reasons
is battery removed/insert event, which is already analyzed in interrupt
service routine.

During AC removal, due to transient reading battery ID resistor may
return low value and absence of battery could be falsely detected.
Checking battery presence in ISR prevents reading the reason of
interrupt, which should be done.

Change-Id: I6e0a13b69d029916f02a46480f1cfd2bdf03296c
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
OMAP4: battery: Update capacity while battery is being charged.

Estimate capacity not only when battery is discharged, but
also when charger is plugged.

Change-Id: I776f65929d5adbc8db06aea214ed502105880682
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
TWL6030: Battery: handle temperature feature during suspend.

Disable/Enable GPADC temperature feature during suspend/resume.
Will ensure that VANA/VRTC are driven to lp state and potentially
save couple of uA.

Change-Id: Iedba0f0c961e623f584a760a71d672a5ced75abe
Signed-off-by: Ambresh K <ambresh@ti.com>
TWL6030: Battery: Handle Fuel Gauge during Suspend.

Set/Reset Fuel Gauge during resume/suspend.

Change-Id: Id799c63c66114fde3803acce05a4498a0458ee15
Signed-off-by: Ambresh K <ambresh@ti.com>
POWER: TWL6030_BCI: Code cleanup

Some code cleanup was made.
Functionality didn't changed.

Change-Id: I57b5f629869dd1e59c30fa7245639347fa858cdc
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
POWER: TWL6030_BCI: Change definitions from uV to mV

This patch corrects the uV/mV confusion in the driver. All
values are stored in mV and returned to userspace in uV to
maintain alignment with the regulator framework voltages.

Change-Id: Id3ebccfb5a83b2f28e4f0795107921efb5cca4a1
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
POWER: TWL6030_BCI: Watchdog timer handling

This patch added handling for charger watchdog during
battery charging process.

Change-Id: Ica69bbf56159501ac14b341b42e39ba066271a81
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>