pm.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2014 NVIDIA Corporation
  4. */
  5. #ifndef __SOC_TEGRA_PM_H__
  6. #define __SOC_TEGRA_PM_H__
  7. #include <linux/errno.h>
  8. enum tegra_suspend_mode {
  9. TEGRA_SUSPEND_NONE = 0,
  10. TEGRA_SUSPEND_LP2, /* CPU voltage off */
  11. TEGRA_SUSPEND_LP1, /* CPU voltage off, DRAM self-refresh */
  12. TEGRA_SUSPEND_LP0, /* CPU + core voltage off, DRAM self-refresh */
  13. TEGRA_MAX_SUSPEND_MODE,
  14. TEGRA_SUSPEND_NOT_READY,
  15. };
  16. #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM) && defined(CONFIG_ARCH_TEGRA)
  17. enum tegra_suspend_mode
  18. tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode);
  19. /* low-level resume entry point */
  20. void tegra_resume(void);
  21. int tegra30_pm_secondary_cpu_suspend(unsigned long arg);
  22. void tegra_pm_clear_cpu_in_lp2(void);
  23. void tegra_pm_set_cpu_in_lp2(void);
  24. int tegra_pm_enter_lp2(void);
  25. int tegra_pm_park_secondary_cpu(unsigned long cpu);
  26. void tegra_pm_init_suspend(void);
  27. #else
  28. static inline enum tegra_suspend_mode
  29. tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode)
  30. {
  31. return TEGRA_SUSPEND_NONE;
  32. }
  33. static inline void tegra_resume(void)
  34. {
  35. }
  36. static inline int tegra30_pm_secondary_cpu_suspend(unsigned long arg)
  37. {
  38. return -ENOTSUPP;
  39. }
  40. static inline void tegra_pm_clear_cpu_in_lp2(void)
  41. {
  42. }
  43. static inline void tegra_pm_set_cpu_in_lp2(void)
  44. {
  45. }
  46. static inline int tegra_pm_enter_lp2(void)
  47. {
  48. return -ENOTSUPP;
  49. }
  50. static inline int tegra_pm_park_secondary_cpu(unsigned long cpu)
  51. {
  52. return -ENOTSUPP;
  53. }
  54. static inline void tegra_pm_init_suspend(void)
  55. {
  56. }
  57. #endif /* CONFIG_PM_SLEEP */
  58. #endif /* __SOC_TEGRA_PM_H__ */