ARM: tegra12: Change resistor value based on reworked/nonreowrked
Rohit Vijayaraghavan [Thu, 25 Jul 2013 22:45:11 +0000 (15:45 -0700)]
Identify whether a reworked board or not. Then set the respective
resistors accordingly and proceed.

Bug 1325536

Signed-off-by: Rohit Vijayaraghavan <rohitv@nvidia.com>
Change-Id: I243c2e78db01b0f78c49f3053d1e89c260f4e57b
Reviewed-on: http://git-master/r/253772
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>

arch/arm/mach-tegra/board-ardbeg-powermon.c

index cad2c28..06c3934 100644 (file)
 #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 */
 enum {
@@ -721,9 +725,29 @@ 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;
+}
+
 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);