Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-tegra / cpuidle-tegra30.c
index 8b50cf4ddd6f04819e0c8a69bf4bf7eb9d28ddc5..3cf9aca5f3ea9de1266d11b67a1e7c4ae62a0ee8 100644 (file)
@@ -43,7 +43,6 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev,
 static struct cpuidle_driver tegra_idle_driver = {
        .name = "tegra_idle",
        .owner = THIS_MODULE,
-       .en_core_tk_irqen = 1,
 #ifdef CONFIG_PM_SLEEP
        .state_count = 2,
 #else
@@ -65,17 +64,11 @@ static struct cpuidle_driver tegra_idle_driver = {
        },
 };
 
-static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
-
 #ifdef CONFIG_PM_SLEEP
 static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
                                           struct cpuidle_driver *drv,
                                           int index)
 {
-       struct cpuidle_state *state = &drv->states[index];
-       u32 cpu_on_time = state->exit_latency;
-       u32 cpu_off_time = state->target_residency - state->exit_latency;
-
        /* All CPUs entering LP2 is not working.
         * Don't let CPU0 enter LP2 when any secondary CPU is online.
         */
@@ -86,7 +79,7 @@ static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
 
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
 
-       tegra_idle_lp2_last(cpu_on_time, cpu_off_time);
+       tegra_idle_lp2_last();
 
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
 
@@ -102,12 +95,8 @@ static bool tegra30_cpu_core_power_down(struct cpuidle_device *dev,
 
        smp_wmb();
 
-       save_cpu_arch_register();
-
        cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
 
-       restore_cpu_arch_register();
-
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
 
        return true;
@@ -157,32 +146,8 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev,
 
 int __init tegra30_cpuidle_init(void)
 {
-       int ret;
-       unsigned int cpu;
-       struct cpuidle_device *dev;
-       struct cpuidle_driver *drv = &tegra_idle_driver;
-
 #ifdef CONFIG_PM_SLEEP
        tegra_tear_down_cpu = tegra30_tear_down_cpu;
 #endif
-
-       ret = cpuidle_register_driver(&tegra_idle_driver);
-       if (ret) {
-               pr_err("CPUidle driver registration failed\n");
-               return ret;
-       }
-
-       for_each_possible_cpu(cpu) {
-               dev = &per_cpu(tegra_idle_device, cpu);
-               dev->cpu = cpu;
-
-               dev->state_count = drv->state_count;
-               ret = cpuidle_register_device(dev);
-               if (ret) {
-                       pr_err("CPU%u: CPUidle device registration failed\n",
-                               cpu);
-                       return ret;
-               }
-       }
-       return 0;
+       return cpuidle_register(&tegra_idle_driver, NULL);
 }