pm-imx27.c 962 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * i.MX27 Power Management Routines
  3. *
  4. * Based on Freescale's BSP
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License.
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/suspend.h>
  11. #include <linux/io.h>
  12. #include <mach/system.h>
  13. #include <mach/mx27.h>
  14. static int mx27_suspend_enter(suspend_state_t state)
  15. {
  16. u32 cscr;
  17. switch (state) {
  18. case PM_SUSPEND_MEM:
  19. /* Clear MPEN and SPEN to disable MPLL/SPLL */
  20. cscr = __raw_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
  21. cscr &= 0xFFFFFFFC;
  22. __raw_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
  23. /* Executes WFI */
  24. arch_idle();
  25. break;
  26. default:
  27. return -EINVAL;
  28. }
  29. return 0;
  30. }
  31. static struct platform_suspend_ops mx27_suspend_ops = {
  32. .enter = mx27_suspend_enter,
  33. .valid = suspend_valid_only_mem,
  34. };
  35. static int __init mx27_pm_init(void)
  36. {
  37. suspend_set_ops(&mx27_suspend_ops);
  38. return 0;
  39. }
  40. device_initcall(mx27_pm_init);