mfd: bq2419x: Fix hot-plug functionality
Sumit Sharma [Fri, 1 Mar 2013 11:51:35 +0000 (16:51 +0530)]
Fix hot-plug funtionality in bq2419x mfd driver

Bug 1245272

Change-Id: I8ba74f77215f8d69e494856d9599d714653d1d67
Signed-off-by: Sumit Sharma <sumsharma@nvidia.com>
Reviewed-on: http://git-master/r/205551
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/mfd/bq2419x.c

index 71c510e..59b7a0c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * MFD driver for BQ2419X charger.
  *
- * Copyright (c) 2012, NVIDIA Corporation.
+ * Copyright (c) 2012-2013, NVIDIA Corporation.
  *
  * Author: Laxman Dewangan <ldewangan@nvidia.com>
  *
@@ -43,7 +43,6 @@ static const struct regmap_config bq2419x_regmap_config = {
        .reg_bits               = 8,
        .val_bits               = 8,
        .max_register           = BQ2419X_MAX_REGS,
-       .cache_type             = REGCACHE_RBTREE,
 };
 
 static int __devinit bq2419x_probe(struct i2c_client *client,
@@ -84,6 +83,15 @@ static int __devinit bq2419x_probe(struct i2c_client *client,
                }
        }
 
+       /* Clear EN_HIZ */
+       ret = regmap_update_bits(bq->regmap,
+               BQ2419X_INPUT_SRC_REG, BQ2419X_EN_HIZ, 0);
+       if (ret < 0) {
+               dev_err(bq->dev, "error reading reg: 0x%x\n",
+                       BQ2419X_INPUT_SRC_REG);
+               return ret;
+       }
+
        ret = mfd_add_devices(bq->dev, -1, bq2419x_children,
                        ARRAY_SIZE(bq2419x_children), NULL, 0);
        if (ret < 0) {