msm: pm-8x60: Move target independent data into the driver
pm-8x60 and cpuidle has target independent driver configuration data
that need not be in boards file. Move these data into the driver
itself.
Change-Id: I4c744dd006945bed709a393cde2b0de2414e9fce
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
diff --git a/arch/arm/mach-msm/cpuidle.c b/arch/arm/mach-msm/cpuidle.c
index cccba2d..4ba3f95 100644
--- a/arch/arm/mach-msm/cpuidle.c
+++ b/arch/arm/mach-msm/cpuidle.c
@@ -26,6 +26,36 @@
.owner = THIS_MODULE,
};
+static struct msm_cpuidle_state msm_cstates[] = {
+ {0, 0, "C0", "WFI",
+ MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
+
+ {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
+ MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
+
+ {0, 2, "C2", "POWER_COLLAPSE",
+ MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
+
+ {1, 0, "C0", "WFI",
+ MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
+
+ {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
+ MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
+
+ {2, 0, "C0", "WFI",
+ MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
+
+ {2, 1, "C1", "STANDALONE_POWER_COLLAPSE",
+ MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
+
+ {3, 0, "C0", "WFI",
+ MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
+
+ {3, 1, "C1", "STANDALONE_POWER_COLLAPSE",
+ MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
+};
+
+
#ifdef CONFIG_MSM_SLEEP_STATS
static DEFINE_PER_CPU(struct atomic_notifier_head, msm_cpuidle_notifiers);
@@ -81,8 +111,7 @@
return ret;
}
-void __init msm_cpuidle_set_states(struct msm_cpuidle_state *states,
- int nr_states, struct msm_pm_platform_data *pm_data)
+static void __init msm_cpuidle_set_states(void)
{
unsigned int cpu;
@@ -93,8 +122,8 @@
dev->cpu = cpu;
dev->prepare = msm_pm_idle_prepare;
- for (i = 0; i < nr_states; i++) {
- struct msm_cpuidle_state *cstate = &states[i];
+ for (i = 0; i < ARRAY_SIZE(msm_cstates); i++) {
+ struct msm_cpuidle_state *cstate = &msm_cstates[i];
struct cpuidle_state *state;
struct msm_pm_platform_data *pm_mode;
@@ -102,7 +131,8 @@
continue;
state = &dev->states[cstate->state_nr];
- pm_mode = &pm_data[MSM_PM_MODE(cpu, cstate->mode_nr)];
+ pm_mode = &msm_pm_sleep_modes[
+ MSM_PM_MODE(cpu, cstate->mode_nr)];
snprintf(state->name, CPUIDLE_NAME_LEN, cstate->name);
snprintf(state->desc, CPUIDLE_DESC_LEN, cstate->desc);
@@ -127,6 +157,7 @@
unsigned int cpu;
int ret;
+ msm_cpuidle_set_states();
ret = cpuidle_register_driver(&msm_cpuidle_driver);
if (ret)
pr_err("%s: failed to register cpuidle driver: %d\n",