[ARM] tegra: clock: Add dvfs support, bug fixes, and cleanups
[linux-2.6.git] / arch / arm / mach-tegra / tegra2_dvfs.c
1 /*
2  * arch/arm/mach-tegra/tegra2_dvfs.c
3  *
4  * Copyright (C) 2010 Google, Inc.
5  *
6  * Author:
7  *      Colin Cross <ccross@google.com>
8  *
9  * This software is licensed under the terms of the GNU General Public
10  * License version 2, as published by the Free Software Foundation, and
11  * may be copied, distributed, and modified under those terms.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  */
19
20 #include <linux/kernel.h>
21
22 #include "clock.h"
23 #include "tegra2_dvfs.h"
24
25 static struct dvfs_table virtual_cpu_process_0[] = {
26         {314000000,  750},
27         {456000000,  825},
28         {608000000,  900},
29         {760000000,  975},
30         {817000000,  1000},
31         {912000000,  1050},
32         {1000000000, 1100},
33         {0, 0},
34 };
35
36 static struct dvfs_table virtual_cpu_process_1[] = {
37         {314000000,  750},
38         {456000000,  825},
39         {618000000,  900},
40         {770000000,  975},
41         {827000000,  1000},
42         {922000000,  1050},
43         {1000000000, 1100},
44         {0, 0},
45 };
46
47 static struct dvfs_table virtual_cpu_process_2[] = {
48         {494000000,  750},
49         {675000000,  825},
50         {817000000,  875},
51         {922000000,  925},
52         {1000000000, 975},
53         {0, 0},
54 };
55
56 static struct dvfs_table virtual_cpu_process_3[] = {
57         {730000000,  750},
58         {760000000,  775},
59         {845000000,  800},
60         {1000000000, 875},
61         {0, 0},
62 };
63
64 struct dvfs tegra_dvfs_virtual_cpu_dvfs = {
65         .reg_id = "vdd_cpu",
66         .process_id_table = {
67                 {
68                         .process_id = 0,
69                         .table = virtual_cpu_process_0,
70                 },
71                 {
72                         .process_id = 1,
73                         .table = virtual_cpu_process_1,
74                 },
75                 {
76                         .process_id = 2,
77                         .table = virtual_cpu_process_2,
78                 },
79                 {
80                         .process_id = 3,
81                         .table = virtual_cpu_process_3,
82                 },
83         },
84         .process_id_table_length = 4,
85         .cpu = 1,
86 };