regulator: pm8xxx-regulator: Add OCP control functionality for switches

Add the ability to selectively enable over current protection
(OCP) for LVS and MVS type PMIC voltage switches.  OCP is used to
automatically disable the output of a PMIC switch in hardware when
the load on the switch becomes too large.

The sequence used when enabling a switch when OCP is desired is as
follows:
1. Disable OCP.
2. Enable the switch.
3. Wait for ocp_enable_time microseconds.
4. Enable OCP.

This sequence is used to ensure that sufficient time is allowed
for inrush current to subside so that a false OCP event is not
triggered.  The delay time is board specific.

Change-Id: I0ea73d3bddd3280ff25f232ece0f1175a52d36cc
Signed-off-by: David Collins <collinsd@codeaurora.org>
2 files changed