msm: krait-regulator: turn off mdd when ldo is not used

The MDD (master droop detector) unit consumes around 300uA per core.
It is required only when the LDO is being used by the cpu. It can
be safely turned off while in BHS mode. This will save upto 1.2mA
of rock bottom current.

Note that if the cpu is entering retention mode, we turn on the MDD
so the spm can turn on LDO safely when retention is activated. Since
we have to call a out of band api to turn on/off MDD for a given core
associate a cpu number with a krait regulator node. This helps us to get
the necessary data structure quickly and access that core's registers
to turn its MDD on/off.

Change-Id: I03ab80bd979bef05c6c3d39f43788e6ec9f02510
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
5 files changed