regulator: palmas: Fix SMPS enable/disable/is_enable for tps65917
authorNishanth Menon <nm@ti.com>
Mon, 30 Jun 2014 15:57:39 +0000 (10:57 -0500)
committerMark Brown <broonie@linaro.org>
Thu, 3 Jul 2014 14:25:56 +0000 (15:25 +0100)
We use regmap regulator ops to enable/disable and check if regulator
is enabled for various SMPS. However, these depend on valid
enable_reg, enable_mask and enable_value in regulator descriptor.

So, similar to fix we did in commit 318dbb02b50c
("regulator: palmas: Fix SMPS enable/disable/is_enabled"), populate the
same for TPS65917 SMPS registration. LDO definitions are already in
place.

Fixes: d6f83370ed97 ("regulator: palmas: Add tps65917 PMIC support")
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/palmas-regulator.c

index ae0f639096fbe431378f84cd6cc914591d2fae9a..a7ce34d1b5f2e8514ad33fcb2170c35ab7e5ecca 100644 (file)
@@ -1312,6 +1312,11 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic,
                        return ret;
                pmic->current_reg_mode[id] = reg &
                                PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK;
+               desc->enable_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
+                                                     rinfo->ctrl_addr);
+               desc->enable_mask = PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK;
+               /* set_mode overrides this value */
+               desc->enable_val = SMPS_CTRL_MODE_ON;
 
                desc->type = REGULATOR_VOLTAGE;
                desc->owner = THIS_MODULE;