ARM: tegra: cpuidle: move the init function behind the suspend init function

One of the state of CPUidle on Tegra can power gate the CPU and the
vdd_cpu rail. But it depends on some configurations from DT and a common
hook function for different Tegra SoCs to power gate the CPU rail. And
these stuffs are initialized after common Tegra suspend init function. So
we move the CPUidle init behind the suspend init function. And making the
CPUidle driver more generic.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
Joseph Lo 2013-06-04 18:47:32 +08:00 коммит произвёл Stephen Warren
Родитель af7f322ea8
Коммит e22dc2b256
3 изменённых файлов: 12 добавлений и 10 удалений

Просмотреть файл

@ -29,6 +29,7 @@
#include "board.h" #include "board.h"
#include "common.h" #include "common.h"
#include "cpuidle.h"
#include "fuse.h" #include "fuse.h"
#include "iomap.h" #include "iomap.h"
#include "irq.h" #include "irq.h"
@ -108,5 +109,6 @@ void __init tegra_init_early(void)
void __init tegra_init_late(void) void __init tegra_init_late(void)
{ {
tegra_init_suspend(); tegra_init_suspend();
tegra_cpuidle_init();
tegra_powergate_debugfs_init(); tegra_powergate_debugfs_init();
} }

Просмотреть файл

@ -27,25 +27,19 @@
#include "fuse.h" #include "fuse.h"
#include "cpuidle.h" #include "cpuidle.h"
static int __init tegra_cpuidle_init(void) void __init tegra_cpuidle_init(void)
{ {
int ret;
switch (tegra_chip_id) { switch (tegra_chip_id) {
case TEGRA20: case TEGRA20:
ret = tegra20_cpuidle_init(); tegra20_cpuidle_init();
break; break;
case TEGRA30: case TEGRA30:
ret = tegra30_cpuidle_init(); tegra30_cpuidle_init();
break; break;
case TEGRA114: case TEGRA114:
ret = tegra114_cpuidle_init(); tegra114_cpuidle_init();
break; break;
default: default:
ret = -ENODEV;
break; break;
} }
return ret;
} }
device_initcall(tegra_cpuidle_init);

Просмотреть файл

@ -35,4 +35,10 @@ int tegra114_cpuidle_init(void);
static inline int tegra114_cpuidle_init(void) { return -ENODEV; } static inline int tegra114_cpuidle_init(void) { return -ENODEV; }
#endif #endif
#ifdef CONFIG_CPU_IDLE
void tegra_cpuidle_init(void);
#else
static inline void tegra_cpuidle_init(void) {}
#endif
#endif #endif