]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-omap2/cpuidle34xx.c
Merge tag 'fixes-non-3.11-2' of git://git.infradead.org/users/jcooper/linux into...
[~andy/linux] / arch / arm / mach-omap2 / cpuidle34xx.c
index 80392fca86c684c419d3362ce824bf23ca6401fe..e18709d3b95d906e79e070774e2c277d81b5f709 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/cpuidle.h>
 #include <linux/export.h>
 #include <linux/cpu_pm.h>
+#include <asm/cpuidle.h>
 
 #include "powerdomain.h"
 #include "clockdomain.h"
@@ -99,16 +100,18 @@ static struct omap3_idle_statedata omap3_idle_data[] = {
        },
 };
 
-/* Private functions */
-
-static int __omap3_enter_idle(struct cpuidle_device *dev,
-                               struct cpuidle_driver *drv,
-                               int index)
+/**
+ * omap3_enter_idle - Programs OMAP3 to enter the specified state
+ * @dev: cpuidle device
+ * @drv: cpuidle driver
+ * @index: the index of state to be entered
+ */
+static int omap3_enter_idle(struct cpuidle_device *dev,
+                           struct cpuidle_driver *drv,
+                           int index)
 {
        struct omap3_idle_statedata *cx = &omap3_idle_data[index];
 
-       local_fiq_disable();
-
        if (omap_irq_pending() || need_resched())
                goto return_sleep_time;
 
@@ -143,27 +146,10 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,
                clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]);
 
 return_sleep_time:
-       local_fiq_enable();
 
        return index;
 }
 
-/**
- * omap3_enter_idle - Programs OMAP3 to enter the specified state
- * @dev: cpuidle device
- * @drv: cpuidle driver
- * @index: the index of state to be entered
- *
- * Called from the CPUidle framework to program the device to the
- * specified target state selected by the governor.
- */
-static inline int omap3_enter_idle(struct cpuidle_device *dev,
-                               struct cpuidle_driver *drv,
-                               int index)
-{
-       return cpuidle_wrap_enter(dev, drv, index, __omap3_enter_idle);
-}
-
 /**
  * next_valid_state - Find next valid C-state
  * @dev: cpuidle device
@@ -271,11 +257,9 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
        return ret;
 }
 
-static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);
-
 static struct cpuidle_driver omap3_idle_driver = {
-       .name =         "omap3_idle",
-       .owner =        THIS_MODULE,
+       .name             = "omap3_idle",
+       .owner            = THIS_MODULE,
        .states = {
                {
                        .enter            = omap3_enter_idle_bm,
@@ -348,8 +332,6 @@ static struct cpuidle_driver omap3_idle_driver = {
  */
 int __init omap3_idle_init(void)
 {
-       struct cpuidle_device *dev;
-
        mpu_pd = pwrdm_lookup("mpu_pwrdm");
        core_pd = pwrdm_lookup("core_pwrdm");
        per_pd = pwrdm_lookup("per_pwrdm");
@@ -358,16 +340,5 @@ int __init omap3_idle_init(void)
        if (!mpu_pd || !core_pd || !per_pd || !cam_pd)
                return -ENODEV;
 
-       cpuidle_register_driver(&omap3_idle_driver);
-
-       dev = &per_cpu(omap3_idle_dev, smp_processor_id());
-       dev->cpu = 0;
-
-       if (cpuidle_register_device(dev)) {
-               printk(KERN_ERR "%s: CPUidle register device failed\n",
-                      __func__);
-               return -EIO;
-       }
-
-       return 0;
+       return cpuidle_register(&omap3_idle_driver, NULL);
 }