cpuidle.c 911 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * CPUIdle support code for SH-Mobile ARM
  3. *
  4. * Copyright (C) 2011 Magnus Damm
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/pm.h>
  11. #include <linux/cpuidle.h>
  12. #include <linux/suspend.h>
  13. #include <linux/module.h>
  14. #include <linux/err.h>
  15. #include <asm/cpuidle.h>
  16. #include <asm/io.h>
  17. static struct cpuidle_driver shmobile_cpuidle_default_driver = {
  18. .name = "shmobile_cpuidle",
  19. .owner = THIS_MODULE,
  20. .states[0] = ARM_CPUIDLE_WFI_STATE,
  21. .safe_state_index = 0, /* C1 */
  22. .state_count = 1,
  23. };
  24. static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver;
  25. void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv)
  26. {
  27. cpuidle_drv = drv;
  28. }
  29. int __init shmobile_cpuidle_init(void)
  30. {
  31. return cpuidle_register(cpuidle_drv, NULL);
  32. }