Merge branches 'pm-cpuidle' and 'pm-opp'
[muen/linux.git] / include / linux / cpuidle.h
index a6989e02d0a06bf79725cbf0024b16abe4a30c73..0b3fc229086ca6cb98d24645c487ab097d6566e5 100644 (file)
@@ -257,22 +257,30 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
 {return 0;}
 #endif
 
-#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx)       \
-({                                                             \
-       int __ret;                                              \
-                                                               \
-       if (!idx) {                                             \
-               cpu_do_idle();                                  \
-               return idx;                                     \
-       }                                                       \
-                                                               \
-       __ret = cpu_pm_enter();                                 \
-       if (!__ret) {                                           \
-               __ret = low_level_idle_enter(idx);              \
-               cpu_pm_exit();                                  \
-       }                                                       \
-                                                               \
-       __ret ? -1 : idx;                                       \
+#define __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, is_retention) \
+({                                                                     \
+       int __ret = 0;                                                  \
+                                                                       \
+       if (!idx) {                                                     \
+               cpu_do_idle();                                          \
+               return idx;                                             \
+       }                                                               \
+                                                                       \
+       if (!is_retention)                                              \
+               __ret =  cpu_pm_enter();                                \
+       if (!__ret) {                                                   \
+               __ret = low_level_idle_enter(idx);                      \
+               if (!is_retention)                                      \
+                       cpu_pm_exit();                                  \
+       }                                                               \
+                                                                       \
+       __ret ? -1 : idx;                                               \
 })
 
+#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx)       \
+       __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, 0)
+
+#define CPU_PM_CPU_IDLE_ENTER_RETENTION(low_level_idle_enter, idx)     \
+       __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, 1)
+
 #endif /* _LINUX_CPUIDLE_H */