regulator: tps65090: Add support always/boot_on
Pradeep Goudagunta [Fri, 24 Aug 2012 16:54:18 +0000 (21:54 +0530)]
Check if always_on or boot_on in preinit and enable regulator
accordingly.

Bug 982726

Change-Id: Ic18569bafaa8333c85a16873db32946b5cd1a40c
Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Reviewed-on: http://git-master/r/127234
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

drivers/regulator/tps65090-regulator.c

index d982f16..b480e97 100644 (file)
@@ -188,6 +188,17 @@ static int __devinit tps65090_regulator_preinit(int id,
        struct device *parent = ri->dev->parent;
 
        if (!tps_pdata->enable_ext_control) {
+               if (tps_pdata->reg_init_data->constraints.always_on ||
+                               tps_pdata->reg_init_data->constraints.boot_on) {
+                       ret =  tps65090_set_bits(parent,
+                                       ri->rinfo->reg_en_reg, 0);
+                       if (ret < 0) {
+                               dev_err(ri->dev, "Error in set reg 0x%x\n",
+                                       ri->rinfo->reg_en_reg);
+                               return ret;
+                       }
+               }
+
                ret =  tps65090_clr_bits(parent,
                                ri->rinfo->reg_en_reg, 1);
                if (ret < 0) {