Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: tegra: Expose PM functions required for new cpuidle driver

The upcoming unified CPUIDLE driver will be added to the drivers/cpuidle/
directory and it will require all these exposed Tegra PM-core functions.

Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Tested-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Jasper Korten <jja2000@gmail.com>
Tested-by: David Heidelberg <david@ixit.cz>
Tested-by: Nicolas Chauvet <kwizart@gmail.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
[treding@nvidia.com: fixup missing include rename]
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Dmitry Osipenko and committed by
Thierry Reding
7741868f 891e1286

+44 -18
+2 -1
arch/arm/mach-tegra/cpuidle-tegra114.c
··· 12 12 13 13 #include <linux/firmware/trusted_foundations.h> 14 14 15 + #include <soc/tegra/pm.h> 16 + 15 17 #include <asm/cpuidle.h> 16 18 #include <asm/smp_plat.h> 17 19 #include <asm/suspend.h> 18 20 #include <asm/psci.h> 19 21 20 22 #include "cpuidle.h" 21 - #include "pm.h" 22 23 #include "sleep.h" 23 24 24 25 #ifdef CONFIG_PM_SLEEP
+2 -2
arch/arm/mach-tegra/cpuidle-tegra20.c
··· 18 18 #include <linux/module.h> 19 19 20 20 #include <soc/tegra/flowctrl.h> 21 + #include <soc/tegra/irq.h> 22 + #include <soc/tegra/pm.h> 21 23 22 24 #include <asm/cpuidle.h> 23 25 #include <asm/smp_plat.h> ··· 27 25 28 26 #include "cpuidle.h" 29 27 #include "iomap.h" 30 - #include "irq.h" 31 - #include "pm.h" 32 28 #include "reset.h" 33 29 #include "sleep.h" 34 30
+2 -1
arch/arm/mach-tegra/cpuidle-tegra30.c
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/module.h> 19 19 20 + #include <soc/tegra/pm.h> 21 + 20 22 #include <asm/cpuidle.h> 21 23 #include <asm/smp_plat.h> 22 24 #include <asm/suspend.h> 23 25 24 26 #include "cpuidle.h" 25 - #include "pm.h" 26 27 #include "sleep.h" 27 28 28 29 #ifdef CONFIG_PM_SLEEP
+2 -1
arch/arm/mach-tegra/irq.c
··· 18 18 #include <linux/of.h> 19 19 #include <linux/syscore_ops.h> 20 20 21 + #include <soc/tegra/irq.h> 22 + 21 23 #include "board.h" 22 24 #include "iomap.h" 23 - #include "irq.h" 24 25 25 26 #define SGI_MASK 0xFFFF 26 27
+5 -3
arch/arm/mach-tegra/irq.h include/soc/tegra/irq.h
··· 3 3 * Copyright (c) 2012, NVIDIA Corporation. All rights reserved. 4 4 */ 5 5 6 - #ifndef __TEGRA_IRQ_H 7 - #define __TEGRA_IRQ_H 6 + #ifndef __SOC_TEGRA_IRQ_H 7 + #define __SOC_TEGRA_IRQ_H 8 8 9 + #if defined(CONFIG_ARM) 9 10 bool tegra_pending_sgi(void); 10 - 11 11 #endif 12 + 13 + #endif /* __SOC_TEGRA_IRQ_H */
-8
arch/arm/mach-tegra/pm.h
··· 23 23 void tegra30_lp1_iram_hook(void); 24 24 void tegra30_sleep_core_init(void); 25 25 26 - void tegra_clear_cpu_in_lp2(void); 27 - void tegra_set_cpu_in_lp2(void); 28 - int tegra_idle_lp2_last(void); 29 26 extern void (*tegra_tear_down_cpu)(void); 30 27 31 28 #ifdef CONFIG_PM_SLEEP 32 29 void tegra_init_suspend(void); 33 - int tegra_pm_park_secondary_cpu(unsigned long cpu); 34 30 #else 35 31 static inline void tegra_init_suspend(void) {} 36 - static inline int tegra_pm_park_secondary_cpu(unsigned long cpu) 37 - { 38 - return -ENOTSUPP; 39 - } 40 32 #endif 41 33 42 34 #endif /* _MACH_TEGRA_PM_H_ */
-1
arch/arm/mach-tegra/sleep.h
··· 122 122 void tegra30_hotplug_shutdown(void); 123 123 124 124 void tegra20_tear_down_cpu(void); 125 - int tegra30_sleep_cpu_secondary_finish(unsigned long); 126 125 void tegra30_tear_down_cpu(void); 127 126 128 127 #endif
-1
arch/arm/mach-tegra/tegra.c
··· 42 42 #include "common.h" 43 43 #include "cpuidle.h" 44 44 #include "iomap.h" 45 - #include "irq.h" 46 45 #include "pm.h" 47 46 #include "reset.h" 48 47 #include "sleep.h"
+31
include/soc/tegra/pm.h
··· 6 6 #ifndef __SOC_TEGRA_PM_H__ 7 7 #define __SOC_TEGRA_PM_H__ 8 8 9 + #include <linux/errno.h> 10 + 9 11 enum tegra_suspend_mode { 10 12 TEGRA_SUSPEND_NONE = 0, 11 13 TEGRA_SUSPEND_LP2, /* CPU voltage off */ ··· 22 20 23 21 /* low-level resume entry point */ 24 22 void tegra_resume(void); 23 + 24 + int tegra30_sleep_cpu_secondary_finish(unsigned long arg); 25 + void tegra_clear_cpu_in_lp2(void); 26 + void tegra_set_cpu_in_lp2(void); 27 + int tegra_idle_lp2_last(void); 28 + int tegra_pm_park_secondary_cpu(unsigned long cpu); 25 29 #else 26 30 static inline enum tegra_suspend_mode 27 31 tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode) ··· 37 29 38 30 static inline void tegra_resume(void) 39 31 { 32 + } 33 + 34 + static inline int tegra30_sleep_cpu_secondary_finish(unsigned long arg) 35 + { 36 + return -ENOTSUPP; 37 + } 38 + 39 + static inline void tegra_clear_cpu_in_lp2(void) 40 + { 41 + } 42 + 43 + static inline void tegra_set_cpu_in_lp2(void) 44 + { 45 + } 46 + 47 + static inline int tegra_idle_lp2_last(void) 48 + { 49 + return -ENOTSUPP; 50 + } 51 + 52 + static inline int tegra_pm_park_secondary_cpu(unsigned long cpu) 53 + { 54 + return -ENOTSUPP; 40 55 } 41 56 #endif /* CONFIG_PM_SLEEP */ 42 57