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/pm-8x60.c b/arch/arm/mach-msm/pm-8x60.c
index 40ddf8e..2b0cc18 100644
--- a/arch/arm/mach-msm/pm-8x60.c
+++ b/arch/arm/mach-msm/pm-8x60.c
@@ -55,7 +55,6 @@
* Debug Definitions
*****************************************************************************/
-
enum {
MSM_PM_DEBUG_SUSPEND = BIT(0),
MSM_PM_DEBUG_POWER_COLLAPSE = BIT(1),
@@ -77,16 +76,6 @@
/******************************************************************************
* Sleep Modes and Parameters
*****************************************************************************/
-
-static struct msm_pm_platform_data *msm_pm_modes;
-
-void __init msm_pm_set_platform_data(
- struct msm_pm_platform_data *data, int count)
-{
- BUG_ON(MSM_PM_SLEEP_MODE_NR * num_possible_cpus() > count);
- msm_pm_modes = data;
-}
-
enum {
MSM_PM_MODE_ATTR_SUSPEND,
MSM_PM_MODE_ATTR_IDLE,
@@ -141,7 +130,7 @@
continue;
cpu = GET_CPU_OF_ATTR(attr);
- mode = &msm_pm_modes[MSM_PM_MODE(cpu, i)];
+ mode = &msm_pm_sleep_modes[MSM_PM_MODE(cpu, i)];
if (!strcmp(attr->attr.name,
msm_pm_mode_attr_labels[MSM_PM_MODE_ATTR_SUSPEND])) {
@@ -187,7 +176,7 @@
continue;
cpu = GET_CPU_OF_ATTR(attr);
- mode = &msm_pm_modes[MSM_PM_MODE(cpu, i)];
+ mode = &msm_pm_sleep_modes[MSM_PM_MODE(cpu, i)];
if (!strcmp(attr->attr.name,
msm_pm_mode_attr_labels[MSM_PM_MODE_ATTR_SUSPEND])) {
@@ -228,8 +217,12 @@
for (i = 0; i < MSM_PM_SLEEP_MODE_NR; i++) {
int idx = MSM_PM_MODE(cpu, i);
- if ((!msm_pm_modes[idx].suspend_supported)
- && (!msm_pm_modes[idx].idle_supported))
+ if ((!msm_pm_sleep_modes[idx].suspend_supported)
+ && (!msm_pm_sleep_modes[idx].idle_supported))
+ continue;
+
+ if (!msm_pm_sleep_mode_labels[i] ||
+ !msm_pm_sleep_mode_labels[i][0])
continue;
mode = kzalloc(sizeof(*mode), GFP_KERNEL);
@@ -250,10 +243,10 @@
for (k = 0, j = 0; k < MSM_PM_MODE_ATTR_NR; k++) {
if ((k == MSM_PM_MODE_ATTR_IDLE) &&
- !msm_pm_modes[idx].idle_supported)
+ !msm_pm_sleep_modes[idx].idle_supported)
continue;
if ((k == MSM_PM_MODE_ATTR_SUSPEND) &&
- !msm_pm_modes[idx].suspend_supported)
+ !msm_pm_sleep_modes[idx].suspend_supported)
continue;
mode->kas[j].cpu = cpu;
mode->kas[j].ka.attr.mode = 0644;
@@ -786,8 +779,8 @@
mode = (enum msm_pm_sleep_mode) state->driver_data;
idx = MSM_PM_MODE(dev->cpu, mode);
- allow = msm_pm_modes[idx].idle_enabled &&
- msm_pm_modes[idx].idle_supported;
+ allow = msm_pm_sleep_modes[idx].idle_enabled &&
+ msm_pm_sleep_modes[idx].idle_supported;
switch (mode) {
case MSM_PM_SLEEP_MODE_POWER_COLLAPSE:
@@ -974,7 +967,7 @@
for (i = 0; i < MSM_PM_SLEEP_MODE_NR; i++) {
struct msm_pm_platform_data *mode;
- mode = &msm_pm_modes[MSM_PM_MODE(cpu, i)];
+ mode = &msm_pm_sleep_modes[MSM_PM_MODE(cpu, i)];
allow[i] = mode->suspend_supported && mode->suspend_enabled;
}
@@ -1049,7 +1042,7 @@
for (i = 0; i < MSM_PM_SLEEP_MODE_NR; i++) {
struct msm_pm_platform_data *mode;
- mode = &msm_pm_modes[MSM_PM_MODE(0, i)];
+ mode = &msm_pm_sleep_modes[MSM_PM_MODE(0, i)];
allow[i] = mode->suspend_supported && mode->suspend_enabled;
}