pm.c 625 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/init.h>
  3. #include <linux/suspend.h>
  4. #include <asm/suspend.h>
  5. #include "smc.h"
  6. #include "pm.h"
  7. static int tango_pm_powerdown(unsigned long arg)
  8. {
  9. tango_suspend(__pa_symbol(cpu_resume));
  10. return -EIO; /* tango_suspend has failed */
  11. }
  12. static int tango_pm_enter(suspend_state_t state)
  13. {
  14. if (state == PM_SUSPEND_MEM)
  15. return cpu_suspend(0, tango_pm_powerdown);
  16. return -EINVAL;
  17. }
  18. static const struct platform_suspend_ops tango_pm_ops = {
  19. .enter = tango_pm_enter,
  20. .valid = suspend_valid_only_mem,
  21. };
  22. void __init tango_pm_init(void)
  23. {
  24. suspend_set_ops(&tango_pm_ops);
  25. }