hwmon: ina230: power down ina devices after init
Deepak Nibade [Wed, 2 Jan 2013 08:29:26 +0000 (13:29 +0530)]
-power down ina devices by setting register values
-earlier power down method was a conditional one
and left ina devices ON after init

Bug 1211188

Change-Id: I113a1e7dc3eb6c211dab58596090c6c508364e25
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/187946
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/hwmon/ina230.c

index d5d50dd..857cb6c 100644 (file)
@@ -545,7 +545,21 @@ static int __devinit ina230_probe(struct i2c_client *client,
 
        register_hotcpu_notifier(&(data->nb));
 
-       evaluate_state(client);
+       err = i2c_smbus_write_word_data(client, INA230_MASK, 0);
+       if (err < 0) {
+               dev_err(&client->dev, "mask write failure sts: 0x%x\n",
+                       err);
+               goto exit_remove;
+       }
+
+       /* set ina230 to power down mode */
+       err = i2c_smbus_write_word_data(client, INA230_CONFIG,
+                                    __constant_cpu_to_be16(INA230_POWER_DOWN));
+       if (err < 0) {
+               dev_err(&client->dev, "power down failure sts: 0x%x\n",
+                       err);
+               goto exit_remove;
+       }
 
        return 0;