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