cpuidle.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __ASM_ARM_CPUIDLE_H
  2. #define __ASM_ARM_CPUIDLE_H
  3. #include <asm/proc-fns.h>
  4. #ifdef CONFIG_CPU_IDLE
  5. extern int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
  6. struct cpuidle_driver *drv, int index);
  7. #else
  8. static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
  9. struct cpuidle_driver *drv, int index) { return -ENODEV; }
  10. #endif
  11. /* Common ARM WFI state */
  12. #define ARM_CPUIDLE_WFI_STATE_PWR(p) {\
  13. .enter = arm_cpuidle_simple_enter,\
  14. .exit_latency = 1,\
  15. .target_residency = 1,\
  16. .power_usage = p,\
  17. .name = "WFI",\
  18. .desc = "ARM WFI",\
  19. }
  20. /*
  21. * in case power_specified == 1, give a default WFI power value needed
  22. * by some governors
  23. */
  24. #define ARM_CPUIDLE_WFI_STATE ARM_CPUIDLE_WFI_STATE_PWR(UINT_MAX)
  25. struct device_node;
  26. struct cpuidle_ops {
  27. int (*suspend)(unsigned long arg);
  28. int (*init)(struct device_node *, int cpu);
  29. };
  30. struct of_cpuidle_method {
  31. const char *method;
  32. const struct cpuidle_ops *ops;
  33. };
  34. #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops) \
  35. static const struct of_cpuidle_method __cpuidle_method_of_table_##name \
  36. __used __section(__cpuidle_method_of_table) \
  37. = { .method = _method, .ops = _ops }
  38. extern int arm_cpuidle_suspend(int index);
  39. extern int arm_cpuidle_init(int cpu);
  40. #endif