2 * CPU idle driver for Tegra CPUs
4 * Copyright (c) 2010-2012, NVIDIA Corporation.
5 * Copyright (c) 2011 Google, Inc.
6 * Author: Colin Cross <ccross@android.com>
7 * Gary King <gking@nvidia.com>
9 * Rework for 3.3 by Peter De Schrijver <pdeschrijver@nvidia.com>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
22 #include <linux/kernel.h>
23 #include <linux/module.h>
24 #include <linux/cpuidle.h>
26 #include <asm/cpuidle.h>
28 static struct cpuidle_driver tegra_idle_driver
= {
31 .en_core_tk_irqen
= 1,
34 [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
38 static DEFINE_PER_CPU(struct cpuidle_device
, tegra_idle_device
);
40 int __init
tegra20_cpuidle_init(void)
44 struct cpuidle_device
*dev
;
45 struct cpuidle_driver
*drv
= &tegra_idle_driver
;
47 ret
= cpuidle_register_driver(&tegra_idle_driver
);
49 pr_err("CPUidle driver registration failed\n");
53 for_each_possible_cpu(cpu
) {
54 dev
= &per_cpu(tegra_idle_device
, cpu
);
57 dev
->state_count
= drv
->state_count
;
58 ret
= cpuidle_register_device(dev
);
60 pr_err("CPU%u: CPUidle device registration failed\n",