diff options
author | Joseph Lo <josephl@nvidia.com> | 2012-10-31 05:41:19 -0400 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-11-15 17:09:21 -0500 |
commit | a6e293eef2eafc31dbe008301182e7124bd87755 (patch) | |
tree | b4feec69bd092c576fc17584961d84a9c2e6dfe4 /arch/arm/mach-tegra/tegra_cpu_car.h | |
parent | fe508d776908b8512c6d936eb29e40bef1f4b8fc (diff) |
ARM: tegra30: clocks: add CPU low-power function into tegra_cpu_car_ops
Add suspend, resume and rail_off_ready API into tegra_cpu_car_ops. These
functions were used for CPU powered-down state maintenance. One thing
needs to notice the rail_off_ready API only availalbe for cpu_g cluster
not cpu_lp cluster.
Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra_cpu_car.h')
-rw-r--r-- | arch/arm/mach-tegra/tegra_cpu_car.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra_cpu_car.h b/arch/arm/mach-tegra/tegra_cpu_car.h index 30d063ad2bef..9764d31032b7 100644 --- a/arch/arm/mach-tegra/tegra_cpu_car.h +++ b/arch/arm/mach-tegra/tegra_cpu_car.h | |||
@@ -30,6 +30,12 @@ | |||
30 | * CPU clock un-gate | 30 | * CPU clock un-gate |
31 | * disable_clock: | 31 | * disable_clock: |
32 | * CPU clock gate | 32 | * CPU clock gate |
33 | * rail_off_ready: | ||
34 | * CPU is ready for rail off | ||
35 | * suspend: | ||
36 | * save the clock settings when CPU go into low-power state | ||
37 | * resume: | ||
38 | * restore the clock settings when CPU exit low-power state | ||
33 | */ | 39 | */ |
34 | struct tegra_cpu_car_ops { | 40 | struct tegra_cpu_car_ops { |
35 | void (*wait_for_reset)(u32 cpu); | 41 | void (*wait_for_reset)(u32 cpu); |
@@ -37,6 +43,11 @@ struct tegra_cpu_car_ops { | |||
37 | void (*out_of_reset)(u32 cpu); | 43 | void (*out_of_reset)(u32 cpu); |
38 | void (*enable_clock)(u32 cpu); | 44 | void (*enable_clock)(u32 cpu); |
39 | void (*disable_clock)(u32 cpu); | 45 | void (*disable_clock)(u32 cpu); |
46 | #ifdef CONFIG_PM_SLEEP | ||
47 | bool (*rail_off_ready)(void); | ||
48 | void (*suspend)(void); | ||
49 | void (*resume)(void); | ||
50 | #endif | ||
40 | }; | 51 | }; |
41 | 52 | ||
42 | extern struct tegra_cpu_car_ops *tegra_cpu_car_ops; | 53 | extern struct tegra_cpu_car_ops *tegra_cpu_car_ops; |
@@ -81,6 +92,32 @@ static inline void tegra_disable_cpu_clock(u32 cpu) | |||
81 | tegra_cpu_car_ops->disable_clock(cpu); | 92 | tegra_cpu_car_ops->disable_clock(cpu); |
82 | } | 93 | } |
83 | 94 | ||
95 | #ifdef CONFIG_PM_SLEEP | ||
96 | static inline bool tegra_cpu_rail_off_ready(void) | ||
97 | { | ||
98 | if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready)) | ||
99 | return false; | ||
100 | |||
101 | return tegra_cpu_car_ops->rail_off_ready(); | ||
102 | } | ||
103 | |||
104 | static inline void tegra_cpu_clock_suspend(void) | ||
105 | { | ||
106 | if (WARN_ON(!tegra_cpu_car_ops->suspend)) | ||
107 | return; | ||
108 | |||
109 | tegra_cpu_car_ops->suspend(); | ||
110 | } | ||
111 | |||
112 | static inline void tegra_cpu_clock_resume(void) | ||
113 | { | ||
114 | if (WARN_ON(!tegra_cpu_car_ops->resume)) | ||
115 | return; | ||
116 | |||
117 | tegra_cpu_car_ops->resume(); | ||
118 | } | ||
119 | #endif | ||
120 | |||
84 | void tegra20_cpu_car_ops_init(void); | 121 | void tegra20_cpu_car_ops_init(void); |
85 | void tegra30_cpu_car_ops_init(void); | 122 | void tegra30_cpu_car_ops_init(void); |
86 | 123 | ||