regulator: Introduce TI Adaptive Body Bias(ABB) on-chip LDO driver

Adaptive Body Biasing (ABB) modulates transistor bias voltages
dynamically in order to optimize switching speed versus leakage.

Texas Instruments' SmartReflex 2 technology provides support for this
power management technique with Forward Body Biasing (FBB) and Reverse
Body Biasing (RBB). These modulate the body voltage of transistor
cells or blocks dynamically to gain performance and reduce leakage.
TI's SmartReflex white paper[1] has further information for usage in
conjunction with other power management techniques.

The application of FBB/RBB technique is determined for each unique
device in some process nodes, whereas, they are mandated on other
process nodes.

In a nutshell, ABB technique is implemented on TI SoC as an on-chip
LDO which has ABB module controlling the bias voltage. However, the
voltage is unique per device. These vary per SoC family and the manner
in which these techniques are used may vary depending on the Operating
Performance Point (OPP) voltage targeted. For example:
OMAP3630/OMAP4430: certain OPPs mandate usage of FBB independent of
	devices.
OMAP4460/OMAP4470: certain OPPs mandate usage of FBB, while others may
	optionally use FBB or optimization with RBB.
OMAP5: ALL OPPs may optionally use ABB, and ABB biasing voltage is
	influenced by vset fused in s/w and requiring s/w override of
	default values.

Further, two generations of ABB module are used in various TI SoCs.
They have remained mostly register field compatible, however the
register offset had switched between versions.

We introduce ABB LDO support in the form of a regulator which is
controlled by voltages denoting the desired Operating Performance
Point which is targeted. However, since ABB transition is part of OPP
change sequence, the sequencing required to ensure sane operation
w.r.t OPP change is left to the controlling driver (example: cpufreq
SoC driver) using standard regulator operations.

The driver supports all ABB modes and ability to override ABB LDO vset
control efuse based ABB mode detection etc.

Current implementation is heavily influenced by the original patch
series [2][3] from Mike Turquette. However, the current implementation
supports only device tree based information.

[1] http://www.ti.com/pdfs/wtbu/smartreflex_whitepaper.pdf
[2] http://marc.info/?l=linux-omap&m=134931341818379&w=2
[3] http://marc.info/?l=linux-arm-kernel&m=134931402406853&w=2

[nm@ti.com: co-developer]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: dts: OMAP36xx: Add device node for ABB

Add ABB device node for OMAP36xx family of devices. Data is based on
OMAP36XX Techincal Reference Manual revison AB (Dec 2012).

[nm@ti.com: co-developer]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: dts: OMAP443x: Add device nodes for ABB

Add ABB device nodes for OMAP443x family of devices. abb_iva is
populated, but disabled as it is not used on current OMAP443x family,
but the node is used on OMAP446x family. Data is based on OMAP443x
Techincal Reference Manual revison AN (April 2013).

[nm@ti.com: co-developer]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: dts: OMAP4460: Add device nodes for ABB

Add ABB device nodes for OMAP4460 device Data is based on OMAP4460
Techincal Reference Manual revison Z (April 2013)

[nm@ti.com: co-developer]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: dts: OMAP5: Add device nodes for ABB

Add ABB device nodes for OMAP5 family of devices. Data is based on
OMAP543x Techincal Reference Manual revison U (April 2013).

[nm@ti.com: co-developer]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
TESTING HACKHACK: add dummy virt-consumer for OMAP3/4/5

Set CONFIG_REGULATOR_VIRTUAL_CONSUMER=y to use

OMAP3630(beagle-XM):
MPU :
REG=/sys/class/regulator/regulator.9
CONS=/sys/devices/platform/reg-virt-consumer.0

for V in 1012500 1200000 1325000 1375000
do
	echo -n "$V">$CONS/min_microvolts
	echo -n "$V">$CONS/max_microvolts
	echo "Tried $V, Voltage =" `cat $REG/microvolts`
done

OMAP4460(Panda-ES): MPU: http://pastebin.com/TKPPZDQ1
REG=/sys/class/regulator/regulator.1
CONS=/sys/devices/platform/reg-virt-consumer.0

for V in 1025000 1200000 1313000 1375000 1389000
do
	echo -n "$V">$CONS/min_microvolts
	echo -n "$V">$CONS/max_microvolts
	echo "Tried $V, Voltage =" `cat $REG/microvolts`
done

IVA:
REG=/sys/class/regulator/regulator.2
CONS=/sys/devices/platform/reg-virt-consumer.1

for V in 950000 1140000 1291000 1375000 1376000

do
	echo -n "$V">$CONS/min_microvolts
	echo -n "$V">$CONS/max_microvolts
	echo "Tried $V, Voltage =" `cat $REG/microvolts`
done

OMAP5: dont have clock data to be able to test at the moment.
code introduced.

Signed-off-by: Nishanth Menon <nm@ti.com>