From: Axel Lin Date: Tue, 23 Apr 2013 16:14:55 +0000 (+0800) Subject: regulator: max8973: Don't override control1 variable when set ramp delay bits X-Git-Tag: v3.12-rc1~994^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b27032ca3ec19edc7a1e3ed76e0988645505507b;p=kernel%2Fkernel-generic.git regulator: max8973: Don't override control1 variable when set ramp delay bits Current code overrides control1 variable when setting ramp delay bits. Fix it by just setting ramp_delay bits. Signed-off-by: Axel Lin Acked-by: Laxman Dewangan Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c index 9a8ea91..adb1414 100644 --- a/drivers/regulator/max8973-regulator.c +++ b/drivers/regulator/max8973-regulator.c @@ -274,15 +274,15 @@ static int max8973_init_dcdc(struct max8973_chip *max, if (pdata->reg_init_data && pdata->reg_init_data->constraints.ramp_delay) { if (pdata->reg_init_data->constraints.ramp_delay < 25000) - control1 = MAX8973_RAMP_12mV_PER_US; + control1 |= MAX8973_RAMP_12mV_PER_US; else if (pdata->reg_init_data->constraints.ramp_delay < 50000) - control1 = MAX8973_RAMP_25mV_PER_US; + control1 |= MAX8973_RAMP_25mV_PER_US; else if (pdata->reg_init_data->constraints.ramp_delay < 200000) - control1 = MAX8973_RAMP_50mV_PER_US; + control1 |= MAX8973_RAMP_50mV_PER_US; else - control1 = MAX8973_RAMP_200mV_PER_US; + control1 |= MAX8973_RAMP_200mV_PER_US; } else { - control1 = MAX8973_RAMP_12mV_PER_US; + control1 |= MAX8973_RAMP_12mV_PER_US; max->desc.ramp_delay = 12500; }