ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / board-ardbeg-powermon.c
index a0aa7ad..f6f6713 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <linux/i2c.h>
 #include <linux/platform_data/ina230.h>
-#include <linux/i2c/pca954x.h>
 
 #include "board.h"
 #include "board-ardbeg.h"
 #define VDD_CPU_BUCKCPU_REWORKED       10
 #define VDD_1V35_SD2_REWORKED          10
 
-#define AVG_32_SAMPLES (4 << 9)
+#define AVG_SAMPLES (2 << 9) /* 16 samples */
 
 /* AVG is specified from platform data */
-#define INA230_CONT_CONFIG     (AVG_32_SAMPLES | INA230_VBUS_CT | \
+#define INA230_CONT_CONFIG     (AVG_SAMPLES | INA230_VBUS_CT | \
                                INA230_VSH_CT | INA230_CONT_MODE)
-#define INA230_TRIG_CONFIG     (AVG_32_SAMPLES | INA230_VBUS_CT | \
+#define INA230_TRIG_CONFIG     (AVG_SAMPLES | INA230_VBUS_CT | \
                                INA230_VSH_CT | INA230_TRIG_MODE)
 
 /* rails on i2c2_0 */
@@ -102,7 +101,7 @@ static struct ina230_platform_data power_mon_info_0[] = {
        [VDD_BAT_0] = {
                .calibration_data = 0x1366,
                .power_lsb = 2.577527185 * PRECISION_MULTIPLIER_ARDBEG,
-               .rail_name = "VDD_BAT",
+               .rail_name = "__VDD_BAT",
                .trig_conf = INA230_TRIG_CONFIG,
                .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
@@ -112,7 +111,7 @@ static struct ina230_platform_data power_mon_info_0[] = {
        [VDD_SYS_BUCKCPU_0] = {
                .calibration_data = 0x1AC5,
                .power_lsb = 1.867795126 * PRECISION_MULTIPLIER_ARDBEG,
-               .rail_name = "VDD_SYS_BUCKCPU",
+               .rail_name = "__VDD_SYS_BUCKCPU",
                .trig_conf = INA230_TRIG_CONFIG,
                .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
@@ -122,7 +121,7 @@ static struct ina230_platform_data power_mon_info_0[] = {
        [VDD_SYS_BUCKSOC_0] = {
                .calibration_data = 0x2802,
                .power_lsb = 0.624877954 * PRECISION_MULTIPLIER_ARDBEG,
-               .rail_name = "VDD_SYS_BUCKSOC",
+               .rail_name = "__VDD_SYS_BUCKSOC",
                .trig_conf = INA230_TRIG_CONFIG,
                .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
@@ -132,7 +131,7 @@ static struct ina230_platform_data power_mon_info_0[] = {
        [VDD_SYS_BUCKGPU_0] = {
                .calibration_data = 0x1F38,
                .power_lsb = 1.601601602 * PRECISION_MULTIPLIER_ARDBEG,
-               .rail_name = "VDD_SYS_BUCKGPU",
+               .rail_name = "__VDD_SYS_BUCKGPU",
                .trig_conf = INA230_TRIG_CONFIG,
                .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
@@ -791,25 +790,6 @@ static struct i2c_board_info ardbeg_A01_i2c2_2_ina230_board_info[] = {
        },
 };
 
-static struct pca954x_platform_mode ardbeg_pca954x_modes[] = {
-       { .adap_id = PCA954x_I2C_BUS0, .deselect_on_exit = true, },
-       { .adap_id = PCA954x_I2C_BUS1, .deselect_on_exit = true, },
-       { .adap_id = PCA954x_I2C_BUS2, .deselect_on_exit = true, },
-       { .adap_id = PCA954x_I2C_BUS3, .deselect_on_exit = true, },
-};
-
-static struct pca954x_platform_data ardbeg_pca954x_data = {
-       .modes    = ardbeg_pca954x_modes,
-       .num_modes      = ARRAY_SIZE(ardbeg_pca954x_modes),
-};
-
-static const struct i2c_board_info ardbeg_i2c2_board_info[] = {
-       {
-               I2C_BOARD_INFO("pca9546", 0x71),
-               .platform_data = &ardbeg_pca954x_data,
-       },
-};
-
 static void __init register_devices_ardbeg_A01(void)
 {
        i2c_register_board_info(PCA954x_I2C_BUS1,
@@ -907,16 +887,15 @@ int __init ardbeg_pmon_init(void)
        if (bi.sku == 1100)
                modify_tn8_rail_data();
 
-       i2c_register_board_info(1, ardbeg_i2c2_board_info,
-               ARRAY_SIZE(ardbeg_i2c2_board_info));
-
        i2c_register_board_info(PCA954x_I2C_BUS0,
                        ardbeg_i2c2_0_ina230_board_info,
                        ARRAY_SIZE(ardbeg_i2c2_0_ina230_board_info));
 
        if (bi.fab >= BOARD_FAB_A01)
                register_devices_ardbeg_A01();
-       else
+       else if ((bi.board_id != BOARD_E1784) &&
+               (bi.board_id != BOARD_E1922) &&
+               (bi.board_id != BOARD_E1923))
                register_devices_ardbeg();
 
        return 0;