regulator: palmas: use correct bit for finding smps enabled or not
Laxman Dewangan [Fri, 15 Mar 2013 10:44:22 +0000 (15:44 +0530)]
SMPS registers are cached for higher performance on voltage control
and hence it need to check the proper bits for enabled or not in place
of volatile bits.

bug 1250602

Change-Id: I8d2e1fca3926c551523a616b605ac5fd93352c33
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/209976
Reviewed-by: Kerwin Wan <kerwinw@nvidia.com>
Reviewed-by: Ken Chang <kenc@nvidia.com>
Tested-by: Ken Chang <kenc@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/regulator/palmas-regulator.c

index c768b83..94bd0e7 100644 (file)
@@ -295,8 +295,8 @@ static int palmas_is_enabled_smps(struct regulator_dev *dev)
 
        palmas_smps_read(pmic->palmas, palmas_regs_info[id].ctrl_addr, &reg);
 
-       reg &= PALMAS_SMPS12_CTRL_STATUS_MASK;
-       reg >>= PALMAS_SMPS12_CTRL_STATUS_SHIFT;
+       reg &= PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK;
+       reg >>= PALMAS_SMPS12_CTRL_MODE_ACTIVE_SHIFT;
 
        return !!(reg);
 }