ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / board-ardbeg-powermon.c
index cad2c28..f6f6713 100644 (file)
  */
 
 #include <linux/i2c.h>
-#include <linux/ina219.h>
 #include <linux/platform_data/ina230.h>
-#include <linux/i2c/pca954x.h>
 
 #include "board.h"
 #include "board-ardbeg.h"
 #include "tegra-board-id.h"
 
 #define PRECISION_MULTIPLIER_ARDBEG    1000
+#define ARDBEG_POWER_REWORKED_CONFIG   0x10
+#define VDD_SOC_SD1_REWORKED           10
+#define VDD_CPU_BUCKCPU_REWORKED       10
+#define VDD_1V35_SD2_REWORKED          10
 
-/* unused rail */
+#define AVG_SAMPLES (2 << 9) /* 16 samples */
+
+/* AVG is specified from platform data */
+#define INA230_CONT_CONFIG     (AVG_SAMPLES | INA230_VBUS_CT | \
+                               INA230_VSH_CT | INA230_CONT_MODE)
+#define INA230_TRIG_CONFIG     (AVG_SAMPLES | INA230_VBUS_CT | \
+                               INA230_VSH_CT | INA230_TRIG_MODE)
+
+/* rails on i2c2_0 */
 enum {
-       UNUSED_RAIL,
+       VDD_BAT_0,
+       VDD_SYS_BUCKCPU_0,
+       VDD_SYS_BUCKSOC_0,
+       VDD_SYS_BUCKGPU_0,
 };
 
 /* following rails are present on Ardbeg */
@@ -83,14 +96,47 @@ enum {
        ARDBEG_A01_VDD_SYS_BL,
 };
 
-static struct ina219_platform_data power_mon_info_0[] = {
-       /* All unused INA219 devices use below data */
-       [UNUSED_RAIL] = {
-               .calibration_data = 0x369c,
-               .power_lsb = 3.051979018 * PRECISION_MULTIPLIER_ARDBEG,
-               .rail_name = "unused_rail",
-               .divisor = 20,
+static struct ina230_platform_data power_mon_info_0[] = {
+       /* E1780-A02 (Shield ERS) */
+       [VDD_BAT_0] = {
+               .calibration_data = 0x1366,
+               .power_lsb = 2.577527185 * PRECISION_MULTIPLIER_ARDBEG,
+               .rail_name = "__VDD_BAT",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
+               .divisor = 25,
+               .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
+               .resistor = 10,
+       },
+       [VDD_SYS_BUCKCPU_0] = {
+               .calibration_data = 0x1AC5,
+               .power_lsb = 1.867795126 * PRECISION_MULTIPLIER_ARDBEG,
+               .rail_name = "__VDD_SYS_BUCKCPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
+               .divisor = 25,
+               .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
+               .resistor = 10,
+       },
+       [VDD_SYS_BUCKSOC_0] = {
+               .calibration_data = 0x2802,
+               .power_lsb = 0.624877954 * PRECISION_MULTIPLIER_ARDBEG,
+               .rail_name = "__VDD_SYS_BUCKSOC",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
+               .divisor = 25,
+               .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
+               .resistor = 20,
+       },
+       [VDD_SYS_BUCKGPU_0] = {
+               .calibration_data = 0x1F38,
+               .power_lsb = 1.601601602 * PRECISION_MULTIPLIER_ARDBEG,
+               .rail_name = "__VDD_SYS_BUCKGPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
+               .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
+               .resistor = 10,
        },
 };
 
@@ -100,6 +146,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x1366,
                .power_lsb = 2.577527185 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BAT",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -108,6 +156,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.078127384 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_RTC_LDO5",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -116,6 +166,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x4759,
                .power_lsb = 1.401587736 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_3V3A_SMPS1_2",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -124,6 +176,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 3.906369213 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SOC_SMPS1_2",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -132,6 +186,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x1AC5,
                .power_lsb = 1.867795126 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BUCKCPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -140,6 +196,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x2ECF,
                .power_lsb = 10.68179922 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_CPU_BUCKCPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -148,6 +206,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x5BA7,
                .power_lsb = 0.545539786 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V8A_SMPS3",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -156,6 +216,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x50B4,
                .power_lsb = 0.309777348 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V8B_SMPS9",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -164,6 +226,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x369C,
                .power_lsb = 9.155937053 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_GPU_BUCKGPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -172,6 +236,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 3.906369213 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V35_SMPS6",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -181,6 +247,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x4759,
                .power_lsb = 1.401587736 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "unused_rail",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -189,6 +257,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x3269,
                .power_lsb = 0.198372724 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_3V3B_SMPS9",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -197,6 +267,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.039063692 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_LCD_1V8B_DIS",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -205,6 +277,8 @@ static struct ina230_platform_data power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.130212307 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V05_SMPS8",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -215,6 +289,8 @@ static struct ina230_platform_data power_mon_info_2[] = {
                .calibration_data  = 0x1A29,
                .power_lsb = 0.63710119 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BL",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -223,6 +299,8 @@ static struct ina230_platform_data power_mon_info_2[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.390636921 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "AVDD_1V05_LDO2",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
        },
@@ -234,6 +312,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x1366,
                .power_lsb = 2.577527185 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BAT",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 10,
@@ -243,6 +323,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.078127384 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_RTC_LDO3",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 50,
@@ -252,6 +334,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x1AAC,
                .power_lsb = 0.624877954 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BUCKSOC",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 30,
@@ -261,6 +345,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 3.906369213 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SOC_SD1",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 1,
@@ -270,6 +356,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x1AC5,
                .power_lsb = 1.867795126 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BUCKCPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 10,
@@ -279,6 +367,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x2ECF,
                .power_lsb = 10.68179922 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_CPU_BUCKCPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 1,
@@ -288,6 +378,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x45F0,
                .power_lsb = 0.714924039 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V8_SD5",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 10,
@@ -297,6 +389,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x3A83,
                .power_lsb = 0.042726484 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_3V3A_LDO1_6",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 200,
@@ -306,6 +400,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.390636921 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_DIS_3V3_LCD",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 10,
@@ -315,6 +411,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 3.906369213 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V35_SD2",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 1,
@@ -324,6 +422,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x1F38,
                .power_lsb = 1.601601602 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BUCKGPU",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 10,
@@ -333,6 +433,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.039063692 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_LCD_1V8B_DIS",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 100,
@@ -342,6 +444,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_1[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.130212307 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V05_LDO0",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 30,
@@ -353,6 +457,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_2[] = {
                .calibration_data  = 0x7FFF,
                .power_lsb = 0.390636921 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V05_SD4",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 10,
@@ -362,6 +468,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_2[] = {
                .calibration_data  = 0x5A04,
                .power_lsb = 0.277729561 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_1V8A_LDO2_5_7",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 20,
@@ -371,6 +479,8 @@ static struct ina230_platform_data ardbeg_A01_power_mon_info_2[] = {
                .calibration_data  = 0x2468,
                .power_lsb = 0.274678112 * PRECISION_MULTIPLIER_ARDBEG,
                .rail_name = "VDD_SYS_BL",
+               .trig_conf = INA230_TRIG_CONFIG,
+               .cont_conf = INA230_CONT_CONFIG,
                .divisor = 25,
                .precision_multiplier = PRECISION_MULTIPLIER_ARDBEG,
                .resistor = 50,
@@ -436,28 +546,28 @@ enum {
 };
 
 /* following is the i2c board info for Ardbeg */
-static struct i2c_board_info ardbeg_i2c2_0_ina219_board_info[] = {
+static struct i2c_board_info ardbeg_i2c2_0_ina230_board_info[] = {
        [INA_I2C_2_0_ADDR_40] = {
-               I2C_BOARD_INFO("ina219", 0x40),
-               .platform_data = &power_mon_info_0[UNUSED_RAIL],
+               I2C_BOARD_INFO("ina230", 0x40),
+               .platform_data = &power_mon_info_0[VDD_BAT_0],
                .irq = -1,
        },
 
        [INA_I2C_2_0_ADDR_41] = {
-               I2C_BOARD_INFO("ina219", 0x41),
-               .platform_data = &power_mon_info_0[UNUSED_RAIL],
+               I2C_BOARD_INFO("ina230", 0x41),
+               .platform_data = &power_mon_info_0[VDD_SYS_BUCKCPU_0],
                .irq = -1,
        },
 
        [INA_I2C_2_0_ADDR_42] = {
-               I2C_BOARD_INFO("ina219", 0x42),
-               .platform_data = &power_mon_info_0[UNUSED_RAIL],
+               I2C_BOARD_INFO("ina230", 0x42),
+               .platform_data = &power_mon_info_0[VDD_SYS_BUCKSOC_0],
                .irq = -1,
        },
 
        [INA_I2C_2_0_ADDR_43] = {
-               I2C_BOARD_INFO("ina219", 0x43),
-               .platform_data = &power_mon_info_0[UNUSED_RAIL],
+               I2C_BOARD_INFO("ina230", 0x43),
+               .platform_data = &power_mon_info_0[VDD_SYS_BUCKGPU_0],
                .irq = -1,
        },
 };
@@ -680,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,
@@ -721,22 +812,90 @@ static void __init register_devices_ardbeg(void)
                        ARRAY_SIZE(ardbeg_i2c2_2_ina230_board_info));
 }
 
+static void modify_reworked_rail_data(void)
+{
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_1V35_SD2].resistor
+                                       = VDD_1V35_SD2_REWORKED;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_CPU_BUCKCPU].resistor
+                                       = VDD_CPU_BUCKCPU_REWORKED;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_SOC_SD1].resistor
+                                       = VDD_SOC_SD1_REWORKED;
+}
+
+static void modify_tn8_rail_data(void)
+{
+       /* E1780-A02 TN8 w/ E1736-A00 PMU*/
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_SYS_BAT]
+               .calibration_data  = 0x3547;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_SYS_BAT]
+               .power_lsb = 3.128284087 * PRECISION_MULTIPLIER_ARDBEG;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_SYS_BAT]
+               .resistor = 3;
+
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_SYS_BUCKSOC]
+               .calibration_data  = 0x2ED7;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_SYS_BUCKSOC]
+               .power_lsb = 1.067467267 * PRECISION_MULTIPLIER_ARDBEG;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_SYS_BUCKSOC]
+               .resistor = 10;
+
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_3V3A_LDO1_6]
+               .calibration_data  = 0x7FFF;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_3V3A_LDO1_6]
+               .power_lsb = 0.390636921 * PRECISION_MULTIPLIER_ARDBEG;
+       ardbeg_A01_power_mon_info_1[ARDBEG_A01_VDD_3V3A_LDO1_6]
+               .resistor = 10;
+
+       ardbeg_A01_power_mon_info_2[ARDBEG_A01_VDD_1V8A_LDO2_5_7]
+               .calibration_data  = 0x7FFF;
+       ardbeg_A01_power_mon_info_2[ARDBEG_A01_VDD_1V8A_LDO2_5_7]
+               .power_lsb = 0.390636921 * PRECISION_MULTIPLIER_ARDBEG;
+       ardbeg_A01_power_mon_info_2[ARDBEG_A01_VDD_1V8A_LDO2_5_7]
+               .resistor = 10;
+
+       power_mon_info_0[VDD_BAT_0]
+               .calibration_data = 0x1FF7;
+       power_mon_info_0[VDD_BAT_0]
+               .power_lsb = 3.128437004 * PRECISION_MULTIPLIER_ARDBEG;
+       power_mon_info_0[VDD_BAT_0]
+               .resistor = 5;
+
+       power_mon_info_0[VDD_SYS_BUCKSOC_0]
+               .calibration_data = 0x2ED7;
+       power_mon_info_0[VDD_SYS_BUCKSOC_0]
+               .power_lsb = 1.067467267 * PRECISION_MULTIPLIER_ARDBEG;
+       power_mon_info_0[VDD_SYS_BUCKSOC_0]
+               .resistor = 10;
+}
+
 int __init ardbeg_pmon_init(void)
 {
+       /*
+       * Get power_config of board and check whether
+       * board is power reworked or not.
+       * In case board is reworked, modify rail data
+       * for which rework was done.
+       */
+       u8 power_config;
        struct board_info bi;
+       power_config = get_power_config();
+       if (power_config & ARDBEG_POWER_REWORKED_CONFIG)
+               modify_reworked_rail_data();
 
        tegra_get_board_info(&bi);
 
-       i2c_register_board_info(1, ardbeg_i2c2_board_info,
-               ARRAY_SIZE(ardbeg_i2c2_board_info));
+       if (bi.sku == 1100)
+               modify_tn8_rail_data();
 
        i2c_register_board_info(PCA954x_I2C_BUS0,
-                       ardbeg_i2c2_0_ina219_board_info,
-                       ARRAY_SIZE(ardbeg_i2c2_0_ina219_board_info));
+                       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;