max170xx_batteey: disable 71 model scaling for Redridge tablet
authorRamakrishna Pallala <ramakrishna.pallala@intel.com>
Wed, 16 May 2012 06:10:06 +0000 (11:40 +0530)
committerbuildbot <buildbot@intel.com>
Thu, 17 May 2012 16:54:28 +0000 (09:54 -0700)
BZ: 36109

This patch disables the 71% model scaling on max17042 fuel gauge
for redridge as the config data we recieved is for 100% model.

To have good initial accuracy we need POR on the board. So this patch
also adds WA to do chip reset on FW update. This WA will be removed by
ww21 build.

Change-Id: I98374b46aa69ac11959fcf21314c5a58b8723046
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Reviewed-on: http://android.intel.com:8080/48945
Reviewed-by: Tc, Jenny <jenny.tc@intel.com>
Reviewed-by: Gugwad, SantoshX <santoshx.gugwad@intel.com>
Reviewed-by: Kurtadkar, Yashodhan <yashodhan.kurtadkar@intel.com>
Tested-by: Kallappa Manjanna, MadhukumarX <madhukumarx.kallappa.manjanna@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/power/max17042_battery.c

index c7552fd..8a55de2 100644 (file)
 /* Model multiplying and dividing factors for Max17050
  * chip to be added later as needed
  */
+#ifdef CONFIG_BOARD_REDRIDGE
+#define MAX17042_MODEL_MUL_FACTOR(a)   (a)
+#define MAX17042_MODEL_DIV_FACTOR(a)   (a)
+#else
 #define MAX17042_MODEL_MUL_FACTOR(a)   ((a * 10) / 7)
 #define MAX17042_MODEL_DIV_FACTOR(a)   ((a * 7) / 10)
+#endif
 
 #define CONSTANT_TEMP_IN_POWER_SUPPLY  350
 #define POWER_SUPPLY_VOLT_MIN_THRESHOLD        3500000
@@ -1196,7 +1201,9 @@ static void max17042_restore_conf_data(struct max17042_chip *chip)
                                                (val & STATUS_POR_BIT)) {
                                dev_info(&chip->client->dev,
                                        "config data needs to be loaded\n");
-
+#ifdef CONFIG_BOARD_REDRIDGE
+                               reset_max17042(chip);
+#endif
                                retval = init_max17042_chip(chip);
                                if (retval < 0) {
                                        dev_err(&chip->client->dev,