pm-imx25.c 578 B

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright 2016 NXP Semiconductors
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/suspend.h>
  7. #include <linux/io.h>
  8. static int imx25_suspend_enter(suspend_state_t state)
  9. {
  10. if (!IS_ENABLED(CONFIG_PM))
  11. return 0;
  12. switch (state) {
  13. case PM_SUSPEND_MEM:
  14. cpu_do_idle();
  15. break;
  16. default:
  17. return -EINVAL;
  18. }
  19. return 0;
  20. }
  21. static const struct platform_suspend_ops imx25_suspend_ops = {
  22. .enter = imx25_suspend_enter,
  23. .valid = suspend_valid_only_mem,
  24. };
  25. void __init imx25_pm_init(void)
  26. {
  27. suspend_set_ops(&imx25_suspend_ops);
  28. }