diff options
author | Thierry Reding <treding@nvidia.com> | 2014-07-11 13:19:06 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-07-17 14:58:43 +0200 |
commit | 7232398abc6a7186e315425638c367d50c674718 (patch) | |
tree | 874b08603b104c3b42a07cb7c1402a8f3bcf5ec0 /include/soc | |
parent | 24fa5af81059af90c723bec6aacc3cd2b2809d14 (diff) | |
download | linux-stable-7232398abc6a7186e315425638c367d50c674718.tar.gz linux-stable-7232398abc6a7186e315425638c367d50c674718.tar.bz2 linux-stable-7232398abc6a7186e315425638c367d50c674718.zip |
ARM: tegra: Convert PMC to a driver
This commit converts the PMC support code to a platform driver. Because
the boot process needs to call into this driver very early, also set up
a minimal environment via an early initcall.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'include/soc')
-rw-r--r-- | include/soc/tegra/pm.h | 38 | ||||
-rw-r--r-- | include/soc/tegra/pmc.h (renamed from include/soc/tegra/powergate.h) | 31 |
2 files changed, 65 insertions, 4 deletions
diff --git a/include/soc/tegra/pm.h b/include/soc/tegra/pm.h new file mode 100644 index 000000000000..30fe2078a547 --- /dev/null +++ b/include/soc/tegra/pm.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2014 NVIDIA Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __SOC_TEGRA_PM_H__ +#define __SOC_TEGRA_PM_H__ + +enum tegra_suspend_mode { + TEGRA_SUSPEND_NONE = 0, + TEGRA_SUSPEND_LP2, /* CPU voltage off */ + TEGRA_SUSPEND_LP1, /* CPU voltage off, DRAM self-refresh */ + TEGRA_SUSPEND_LP0, /* CPU + core voltage off, DRAM self-refresh */ + TEGRA_MAX_SUSPEND_MODE, +}; + +#ifdef CONFIG_PM_SLEEP +enum tegra_suspend_mode +tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode); + +/* low-level resume entry point */ +void tegra_resume(void); +#else +static inline enum tegra_suspend_mode +tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode) +{ + return TEGRA_SUSPEND_NONE; +} + +static inline void tegra_resume(void) +{ +} +#endif /* CONFIG_PM_SLEEP */ + +#endif /* __SOC_TEGRA_PM_H__ */ diff --git a/include/soc/tegra/powergate.h b/include/soc/tegra/pmc.h index c16912ed1a8d..65a93273e72f 100644 --- a/include/soc/tegra/powergate.h +++ b/include/soc/tegra/pmc.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2010 Google, Inc + * Copyright (c) 2014 NVIDIA Corporation * * Author: * Colin Cross <ccross@google.com> @@ -15,12 +16,34 @@ * */ -#ifndef __SOC_TEGRA_POWERGATE_H__ -#define __SOC_TEGRA_POWERGATE_H__ +#ifndef __SOC_TEGRA_PMC_H__ +#define __SOC_TEGRA_PMC_H__ + +#include <linux/reboot.h> + +#include <soc/tegra/pm.h> struct clk; struct reset_control; +void tegra_pmc_restart(enum reboot_mode mode, const char *cmd); + +#ifdef CONFIG_PM_SLEEP +enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void); +void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode); +void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode); +#endif /* CONFIG_PM_SLEEP */ + +#ifdef CONFIG_SMP +bool tegra_pmc_cpu_is_powered(int cpuid); +int tegra_pmc_cpu_power_on(int cpuid); +int tegra_pmc_cpu_remove_clamping(int cpuid); +#endif /* CONFIG_SMP */ + +/* + * powergate and I/O rail APIs + */ + #define TEGRA_POWERGATE_CPU 0 #define TEGRA_POWERGATE_3D 1 #define TEGRA_POWERGATE_VENC 2 @@ -129,6 +152,6 @@ static inline int tegra_io_rail_power_off(int id) { return -ENOSYS; } -#endif +#endif /* CONFIG_ARCH_TEGRA */ -#endif /* __SOC_TEGRA_POWERGATE_H__ */ +#endif /* __SOC_TEGRA_PMC_H__ */ |