x86, efi: Set runtime_version to the EFI spec revision
[linux/fpc-iii.git] / arch / arm / mach-tegra / tegra_cpu_car.h
blob9764d31032b7c9be617ac8d9a7eb48c6a90b09aa
1 /*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef __MACH_TEGRA_CPU_CAR_H
18 #define __MACH_TEGRA_CPU_CAR_H
21 * Tegra CPU clock and reset control ops
23 * wait_for_reset:
24 * keep waiting until the CPU in reset state
25 * put_in_reset:
26 * put the CPU in reset state
27 * out_of_reset:
28 * release the CPU from reset state
29 * enable_clock:
30 * CPU clock un-gate
31 * disable_clock:
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
40 struct tegra_cpu_car_ops {
41 void (*wait_for_reset)(u32 cpu);
42 void (*put_in_reset)(u32 cpu);
43 void (*out_of_reset)(u32 cpu);
44 void (*enable_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
53 extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
55 static inline void tegra_wait_cpu_in_reset(u32 cpu)
57 if (WARN_ON(!tegra_cpu_car_ops->wait_for_reset))
58 return;
60 tegra_cpu_car_ops->wait_for_reset(cpu);
63 static inline void tegra_put_cpu_in_reset(u32 cpu)
65 if (WARN_ON(!tegra_cpu_car_ops->put_in_reset))
66 return;
68 tegra_cpu_car_ops->put_in_reset(cpu);
71 static inline void tegra_cpu_out_of_reset(u32 cpu)
73 if (WARN_ON(!tegra_cpu_car_ops->out_of_reset))
74 return;
76 tegra_cpu_car_ops->out_of_reset(cpu);
79 static inline void tegra_enable_cpu_clock(u32 cpu)
81 if (WARN_ON(!tegra_cpu_car_ops->enable_clock))
82 return;
84 tegra_cpu_car_ops->enable_clock(cpu);
87 static inline void tegra_disable_cpu_clock(u32 cpu)
89 if (WARN_ON(!tegra_cpu_car_ops->disable_clock))
90 return;
92 tegra_cpu_car_ops->disable_clock(cpu);
95 #ifdef CONFIG_PM_SLEEP
96 static inline bool tegra_cpu_rail_off_ready(void)
98 if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready))
99 return false;
101 return tegra_cpu_car_ops->rail_off_ready();
104 static inline void tegra_cpu_clock_suspend(void)
106 if (WARN_ON(!tegra_cpu_car_ops->suspend))
107 return;
109 tegra_cpu_car_ops->suspend();
112 static inline void tegra_cpu_clock_resume(void)
114 if (WARN_ON(!tegra_cpu_car_ops->resume))
115 return;
117 tegra_cpu_car_ops->resume();
119 #endif
121 void tegra20_cpu_car_ops_init(void);
122 void tegra30_cpu_car_ops_init(void);
124 #endif /* __MACH_TEGRA_CPU_CAR_H */