pm.c 561 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2010 Freescale Semiconductor, Inc.
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/suspend.h>
  7. #include <linux/io.h>
  8. #include "pm.h"
  9. static int mxs_suspend_enter(suspend_state_t state)
  10. {
  11. switch (state) {
  12. case PM_SUSPEND_MEM:
  13. cpu_do_idle();
  14. break;
  15. default:
  16. return -EINVAL;
  17. }
  18. return 0;
  19. }
  20. static const struct platform_suspend_ops mxs_suspend_ops = {
  21. .enter = mxs_suspend_enter,
  22. .valid = suspend_valid_only_mem,
  23. };
  24. void __init mxs_pm_init(void)
  25. {
  26. suspend_set_ops(&mxs_suspend_ops);
  27. }