ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / board-tn8-p1761-powermon.c
1 /*
2  * arch/arm/mach-tegra/board-tn8-p1761-powermon.c
3  *
4  * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19
20 #include <linux/i2c.h>
21 #include <linux/ina3221.h>
22
23 /* rails on TN8_P1761 i2c */
24 enum {
25         VDD_BAT_CPU_GPU,
26 };
27 enum {
28         INA_I2C_ADDR_40,
29 };
30
31 static struct ina3221_platform_data tn8_p1761_power_mon_info[] = {
32         [VDD_BAT_CPU_GPU] = {
33                 .rail_name = {"VDD_BAT", "VDD_CPU", "VDD_GPU"},
34                 .shunt_resistor = {1, 1, 1},
35                 .cont_conf_data = INA3221_CONT_CONFIG_DATA,
36                 .trig_conf_data = INA3221_TRIG_CONFIG_DATA,
37                 .warn_conf_limits = {-1, -1, -1},
38                 .crit_conf_limits = {6450, -1, -1},
39         },
40 };
41
42 static struct i2c_board_info tn8_p1761_i2c_ina3221_info[] = {
43         [INA_I2C_ADDR_40] = {
44                 I2C_BOARD_INFO("ina3221", 0x40),
45                 .platform_data = &tn8_p1761_power_mon_info[VDD_BAT_CPU_GPU],
46                 .irq = -1,
47         },
48 };
49
50 int __init tn8_p1761_pmon_init(void)
51 {
52         int ret;
53         ret = i2c_register_board_info(1, tn8_p1761_i2c_ina3221_info,
54                                       ARRAY_SIZE(tn8_p1761_i2c_ina3221_info));
55         return ret;
56 }