pm-imx27.c 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "hardware.h"
  13. static int mx27_suspend_enter(suspend_state_t state)
  14. {
  15. u32 cscr;
  16. switch (state) {
  17. case PM_SUSPEND_MEM:
  18. /* Clear MPEN and SPEN to disable MPLL/SPLL */
  19. cscr = imx_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
  20. cscr &= 0xFFFFFFFC;
  21. imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
  22. /* Executes WFI */
  23. cpu_do_idle();
  24. break;
  25. default:
  26. return -EINVAL;
  27. }
  28. return 0;
  29. }
  30. static const struct platform_suspend_ops mx27_suspend_ops = {
  31. .enter = mx27_suspend_enter,
  32. .valid = suspend_valid_only_mem,
  33. };
  34. void __init imx27_pm_init(void)
  35. {
  36. suspend_set_ops(&mx27_suspend_ops);
  37. }