msm: spm-v2: Support to reinitalize SPM registers

On certain devices SPM hardware block doesn't retain its state through
certain low power modes. This commit allows for reinitialization of
control and sequence entry registers on resume.

Change-Id: Ib70ab1e090dc69fa2901d183b9a25416ad433ba0
Signed-off-by: Maheshkumar Sivasubramanian <msivasub@codeaurora.org>
diff --git a/arch/arm/mach-msm/spm_devices.c b/arch/arm/mach-msm/spm_devices.c
index 1f85194..2b17fa3 100644
--- a/arch/arm/mach-msm/spm_devices.c
+++ b/arch/arm/mach-msm/spm_devices.c
@@ -126,6 +126,13 @@
 	return ret;
 }
 
+void msm_spm_reinit(void)
+{
+	unsigned int cpu;
+	for_each_possible_cpu(cpu)
+		msm_spm_drv_reinit(&per_cpu(msm_cpu_spm_device.reg_data, cpu));
+}
+
 int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm)
 {
 	struct msm_spm_device *dev = &__get_cpu_var(msm_cpu_spm_device);
@@ -198,4 +205,9 @@
 {
 	return msm_spm_dev_init(&msm_spm_l2_device, data);
 }
+
+void msm_spm_l2_reinit(void)
+{
+	msm_spm_drv_reinit(&msm_spm_l2_device.reg_data);
+}
 #endif