cpuidle-imx5.c 939 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. #include "cpuidle.h"
  12. static int imx5_cpuidle_enter(struct cpuidle_device *dev,
  13. struct cpuidle_driver *drv, int index)
  14. {
  15. arm_pm_idle();
  16. return index;
  17. }
  18. static struct cpuidle_driver imx5_cpuidle_driver = {
  19. .name = "imx5_cpuidle",
  20. .owner = THIS_MODULE,
  21. .states[0] = {
  22. .enter = imx5_cpuidle_enter,
  23. .exit_latency = 2,
  24. .target_residency = 1,
  25. .name = "IMX5 SRPG",
  26. .desc = "CPU state retained,powered off",
  27. },
  28. .state_count = 1,
  29. };
  30. int __init imx5_cpuidle_init(void)
  31. {
  32. return cpuidle_register(&imx5_cpuidle_driver, NULL);
  33. }