@@ -216,3 +216,39 @@ bool msm_cpu_pm_enter_sleep(enum msm_pm_sleep_mode mode, bool from_idle)
return exit_stat;
}
EXPORT_SYMBOL(msm_cpu_pm_enter_sleep);
+
+/**
+ * msm_pm_cpu_hotplug_enter - Entry point for SoC hotplug interface
+ * Set up cores to enter deeper sleep modes than just clock gating
+ * Find the best deepest low power mode that can enter
+ *
+ * @cpu - The cpu that is being hotplugged off
+ */
+int msm_pm_cpu_hotplug_enter(unsigned int cpu)
+{
+ enum msm_pm_sleep_mode mode = MSM_PM_SLEEP_MODE_NR;
+ int ret;
+
+ if (msm_spm_is_mode_avail(MSM_SPM_MODE_POWER_COLLAPSE))
+ mode = MSM_PM_SLEEP_MODE_POWER_COLLAPSE;
+ else if (msm_spm_is_mode_avail( MSM_SPM_MODE_RETENTION))
+ mode = MSM_PM_SLEEP_MODE_RETENTION;
+ else
+ mode = MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT;
+
+ ret = msm_cpu_pm_enter_sleep(mode, false) ? 0 : -EFAULT;
+
+ return ret;
+}
+EXPORT_SYMBOL(msm_pm_cpu_hotplug_enter);
+
+/**
+ * msm_pm_secondary_startup() - Restore after hotplug resume
+ *
+ * @ cpu: the cpu thats coming up.
+ */
+int msm_pm_secondary_startup(unsigned int cpu)
+{
+ return msm_spm_set_low_power_mode(MSM_SPM_MODE_CLOCK_GATING, false);
+}
+EXPORT_SYMBOL(msm_pm_secondary_startup);
@@ -30,10 +30,14 @@ enum msm_pm_l2_scm_flag {
#ifdef CONFIG_QCOM_PM
bool msm_cpu_pm_enter_sleep(enum msm_pm_sleep_mode mode, bool from_idle);
+int msm_pm_cpu_hotplug_enter(unsigned int cpu);
+int msm_pm_secondary_startup(unsigned int cpu);
#else
static inline bool msm_cpu_pm_enter_sleep(enum msm_pm_sleep_mode mode,
bool from_idle)
{ return true; }
+static inline int msm_pm_cpu_hotplug_enter(unsigned int cpu) { return 0; }
+static inline int msm_pm_secondary_startup(unsigned int cpu) { return 0; }
#endif
#endif /* __QCOM_PM_H */