Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
[linux-2.6-block.git] / arch / arm / mach-shmobile / cpuidle.c
index 21b09b6455e4b7788057df17d624f3778a7cad21..7e6559105d40f27be8ffbdbc394cc377cec65ade 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/suspend.h>
 #include <linux/module.h>
 #include <linux/err.h>
+#include <asm/cpuidle.h>
 #include <asm/io.h>
 
 static void shmobile_enter_wfi(void)
@@ -28,37 +29,19 @@ static int shmobile_cpuidle_enter(struct cpuidle_device *dev,
                                  struct cpuidle_driver *drv,
                                  int index)
 {
-       ktime_t before, after;
-
-       before = ktime_get();
-
-       local_irq_disable();
-       local_fiq_disable();
-
        shmobile_cpuidle_modes[index]();
 
-       local_irq_enable();
-       local_fiq_enable();
-
-       after = ktime_get();
-       dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10;
-
        return index;
 }
 
 static struct cpuidle_device shmobile_cpuidle_dev;
 static struct cpuidle_driver shmobile_cpuidle_driver = {
-       .name =         "shmobile_cpuidle",
-       .owner =        THIS_MODULE,
-       .states[0] = {
-               .name = "C1",
-               .desc = "WFI",
-               .exit_latency = 1,
-               .target_residency = 1 * 2,
-               .flags = CPUIDLE_FLAG_TIME_VALID,
-       },
-       .safe_state_index = 0, /* C1 */
-       .state_count = 1,
+       .name                   = "shmobile_cpuidle",
+       .owner                  = THIS_MODULE,
+       .en_core_tk_irqen       = 1,
+       .states[0]              = ARM_CPUIDLE_WFI_STATE,
+       .safe_state_index       = 0, /* C1 */
+       .state_count            = 1,
 };
 
 void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);