pm-imx25.c 727 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2016 NXP Semiconductors
  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/kernel.h>
  9. #include <linux/suspend.h>
  10. #include <linux/io.h>
  11. static int imx25_suspend_enter(suspend_state_t state)
  12. {
  13. if (!IS_ENABLED(CONFIG_PM))
  14. return 0;
  15. switch (state) {
  16. case PM_SUSPEND_MEM:
  17. cpu_do_idle();
  18. break;
  19. default:
  20. return -EINVAL;
  21. }
  22. return 0;
  23. }
  24. static const struct platform_suspend_ops imx25_suspend_ops = {
  25. .enter = imx25_suspend_enter,
  26. .valid = suspend_valid_only_mem,
  27. };
  28. void __init imx25_pm_init(void)
  29. {
  30. suspend_set_ops(&imx25_suspend_ops);
  31. }