cpuidle-imx5.c 918 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) 2012 Freescale Semiconductor, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/cpuidle.h>
  9. #include <linux/module.h>
  10. #include <asm/system_misc.h>
  11. static int imx5_cpuidle_enter(struct cpuidle_device *dev,
  12. struct cpuidle_driver *drv, int index)
  13. {
  14. arm_pm_idle();
  15. return index;
  16. }
  17. static struct cpuidle_driver imx5_cpuidle_driver = {
  18. .name = "imx5_cpuidle",
  19. .owner = THIS_MODULE,
  20. .states[0] = {
  21. .enter = imx5_cpuidle_enter,
  22. .exit_latency = 2,
  23. .target_residency = 1,
  24. .name = "IMX5 SRPG",
  25. .desc = "CPU state retained,powered off",
  26. },
  27. .state_count = 1,
  28. };
  29. int __init imx5_cpuidle_init(void)
  30. {
  31. return cpuidle_register(&imx5_cpuidle_driver, NULL);
  32. }