power: max17048: reduce debug message
Hyongbin Kim [Tue, 6 Aug 2013 09:49:01 +0000 (18:49 +0900)]
For reduce debug massage, print VCELL and SOC when SOC is changed.
And add print temperature when temperature is changed over 1.5C.

Bug 1304204
Bug 1317331

Change-Id: I6966a79d7a7045b839a1cdde8520a231e4aa3b08
Signed-off-by: Hyongbin Kim <hyongbink@nvidia.com>
Reviewed-on: http://git-master/r/258673
(cherry picked from commit 6de902ba052fc1363a4c1701f96c2d6b0b57d55e)
Reviewed-on: http://git-master/r/289142
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gabby Lee <galee@nvidia.com>

drivers/power/max17048_battery.c

index 7114926..e4798e4 100644 (file)
@@ -60,6 +60,8 @@
 
 #define MAX17048_CONFIG_ALRT           0x0020 /* CONFIG.ALRT bit*/
 
+/* #define DEBUG_PRINTK_SOC_VCELL */
+
 struct max17048_chip {
        struct i2c_client               *client;
        struct delayed_work             work;
@@ -229,7 +231,9 @@ static void max17048_get_vcell(struct i2c_client *client)
        else
                chip->vcell = (uint16_t)(((vcell >> 4) * 125) / 100);
 
-       dev_info(&client->dev, "%s(): vcell %d %%\n", __func__, chip->vcell);
+#ifdef DEBUG_PRINTK_SOC_VCELL
+       dev_info(&client->dev, "%s(): VCELL %dmV\n", __func__, chip->vcell);
+#endif
 }
 
 static void max17048_get_soc(struct i2c_client *client)
@@ -248,8 +252,10 @@ static void max17048_get_soc(struct i2c_client *client)
                        chip->internal_soc = (uint16_t)soc >> 9;
        }
 
-       dev_info(&client->dev, "%s(): SOC %d %%\n",
+#ifdef DEBUG_PRINTK_SOC_VCELL
+       dev_info(&client->dev, "%s(): SOC %d%%\n",
                        __func__, chip->internal_soc);
+#endif
 
        chip->soc = chip->internal_soc;
 
@@ -362,6 +368,8 @@ static void max17048_work(struct work_struct *work)
        }
 
        if (abs(chip->temperature - chip->lasttime_temperature) >= 1500) {
+               dev_info(&chip->client->dev, "%s(): Temp %ldC\n",
+                               __func__, chip->temperature / 1000);
                chip->lasttime_temperature = chip->temperature;
                max17048_update_rcomp(chip, chip->temperature);
        }
@@ -657,8 +665,8 @@ static irqreturn_t max17048_irq(int id, void *dev)
                max17048_get_soc(client);
                chip->lasttime_soc = chip->soc;
                dev_info(&client->dev,
-                               "%s(): STATUS_HD, SOC: %d\n",
-                               __func__, chip->soc);
+                               "%s(): STATUS_HD, VCELL %dmV, SOC %d%%\n",
+                               __func__, chip->vcell, chip->internal_soc);
                power_supply_changed(&chip->battery);
        }
        if (val & MAX17048_STATUS_SC) {
@@ -666,8 +674,8 @@ static irqreturn_t max17048_irq(int id, void *dev)
                max17048_get_soc(client);
                chip->lasttime_soc = chip->soc;
                dev_info(&client->dev,
-                               "%s(): STATUS_SC, SOC: %d\n",
-                               __func__, chip->internal_soc);
+                               "%s(): STATUS_SC, VCELL %dmV, SOC %d%%\n",
+                               __func__, chip->vcell, chip->internal_soc);
                power_supply_changed(&chip->battery);
 
                /* Set VL again when soc is above 1% */