regulator: bq24192: Disable supply by default
Rakesh Bodla [Tue, 11 Dec 2012 14:44:10 +0000 (19:44 +0530)]
Disable voltage supply by default.

Bug 1179219

Change-Id: Ibf963a88be446acaf76ffa3364c6e6b12068fc16
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/170378
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/regulator/bq2419x-regulator.c

index 62cb7ee..5b76b0d 100644 (file)
@@ -163,8 +163,18 @@ static int __devinit bq2419x_regulator_probe(struct platform_device *pdev)
        }
 
        bq->rdev = rdev;
+
+       ret = regmap_update_bits(bq->chip->regmap, BQ2419X_OTG,
+                                       BQ2419X_OTG_ENABLE_MASK, 0x10);
+       if (ret < 0) {
+               dev_err(bq->dev, "register %d update failed with err %d",
+                       BQ2419X_OTG, ret);
+               goto err_reg_update;
+       }
        return 0;
 
+err_reg_update:
+       regulator_unregister(bq->rdev);
 err_init:
        if (gpio_is_valid(bq->gpio_otg_iusb))
                gpio_free(bq->gpio_otg_iusb);