20 #include <linux/kernel.h>
36 #define PWRGATE_TOGGLE 0x30
37 #define PWRGATE_TOGGLE_START (1 << 8)
39 #define REMOVE_CLAMPING 0x34
41 #define PWRGATE_STATUS 0x38
43 static int tegra_num_powerdomains;
44 static int tegra_num_cpu_domains;
45 static u8 *tegra_cpu_domains;
46 static u8 tegra30_cpu_domains[] = {
57 static u32 pmc_read(
unsigned long reg)
59 return readl(pmc + reg);
62 static void pmc_write(
u32 val,
unsigned long reg)
67 static int tegra_powergate_set(
int id,
bool new_state)
76 if (status == new_state) {
77 spin_unlock_irqrestore(&tegra_powergate_lock, flags);
83 spin_unlock_irqrestore(&tegra_powergate_lock, flags);
93 return tegra_powergate_set(
id,
true);
101 return tegra_powergate_set(
id,
false);
149 ret = clk_prepare_enable(clk);
165 clk_disable_unprepare(clk);
174 if (cpuid > 0 && cpuid < tegra_num_cpu_domains)
175 return tegra_cpu_domains[
cpuid];
184 tegra_num_powerdomains = 7;
187 tegra_num_powerdomains = 14;
188 tegra_num_cpu_domains = 4;
189 tegra_cpu_domains = tegra30_cpu_domains;
193 tegra_num_powerdomains = 0;
200 #ifdef CONFIG_DEBUG_FS
202 static const char *
const *powergate_name;
204 static const char *
const powergate_name_t20[] = {
214 static const char *
const powergate_name_t30[] = {
238 for (i = 0; i < tegra_num_powerdomains; i++)
239 seq_printf(s,
" %9s %7s\n", powergate_name[i],
250 .
open = powergate_open,
256 int __init tegra_powergate_debugfs_init(
void)
262 powergate_name = powergate_name_t20;
265 powergate_name = powergate_name_t30;
269 if (powergate_name) {