return off || !initialized || !drv || !dev || !dev->enabled;
}
+unsigned int cpuidle_get_target_residency(int cpu, int state)
+{
+ struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu);
+ struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
+ struct cpuidle_state *s;
+ unsigned int target_residency = INT_MAX;
+
+ if (!drv)
+ goto exit_func;
+
+ s = &drv->states[state];
+ target_residency = s->target_residency;
+
+exit_func:
+ return target_residency;
+}
+
/**
* cpuidle_play_dead - cpu off-lining
*
extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
static inline struct cpuidle_device *cpuidle_get_device(void)
{return __this_cpu_read(cpuidle_devices); }
+extern unsigned int cpuidle_get_target_residency(int cpu, int state);
#else
static inline void disable_cpuidle(void) { }
static inline bool cpuidle_not_available(struct cpuidle_driver *drv,
static inline struct cpuidle_driver *cpuidle_get_cpu_driver(
struct cpuidle_device *dev) {return NULL; }
static inline struct cpuidle_device *cpuidle_get_device(void) {return NULL; }
+static inline unsigned int cpuidle_get_target_residency(int cpu, int state) {return UINT_MAX;}
#endif
#ifdef CONFIG_CPU_IDLE