regulator: tps51632: Fix control register configuration
Laxman Dewangan [Fri, 28 Sep 2012 08:29:48 +0000 (13:29 +0530)]
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/139613
(cherry picked from commit 23499f8e25dc7ddb847baaf1c758931d5f72e3c1)

Change-Id: I5a56b78c43bc30d87a005c4251b7e8732344834b
Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Reviewed-on: http://git-master/r/146385
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

drivers/regulator/tps51632-regulator.c

index c43a5e7..0ab48eb 100644 (file)
@@ -164,7 +164,7 @@ static int __devinit tps51632_init_dcdc(struct tps51632_chip *tps,
        unsigned int vmax;
 
        if (pdata->enable_pwm) {
-               control = TPS51632_DVFS_PWMEN;
+               control |= TPS51632_DVFS_PWMEN;
                tps->pwm_enabled = pdata->enable_pwm;
                vsel = DIV_ROUND_UP(pdata->base_voltage_uV -
                        TPS51632_MIN_VOLATGE, TPS51632_VOLATGE_STEP) + 0x19;
@@ -177,11 +177,11 @@ static int __devinit tps51632_init_dcdc(struct tps51632_chip *tps,
                }
        }
        if (pdata->dvfs_step_20mV)
-               control = TPS51632_DVFS_STEP_20;
+               control |= TPS51632_DVFS_STEP_20;
        if (pdata->enable_vmax_alarm)
-               control = TPS51632_DVFS_VMAX_PG;
+               control |= TPS51632_DVFS_VMAX_PG;
        if (pdata->enable_overcurrent_alram)
-               control = TPS51632_DVFS_OCA_EN;
+               control |= TPS51632_DVFS_OCA_EN;
        if (pdata->max_voltage_uV) {
                /**
                 * TPS51632 hw behavior: VMAX register can be write only