Commit bf1fc259 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 21687b16
...@@ -339,13 +339,9 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev, ...@@ -339,13 +339,9 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
unsigned int new_sel) unsigned int new_sel)
{ {
struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
const struct sec_voltage_desc *desc;
int reg_id = rdev_get_id(rdev);
desc = reg_voltage_map[reg_id];
if ((old_sel < new_sel) && s5m8767->ramp_delay) if ((old_sel < new_sel) && s5m8767->ramp_delay)
return DIV_ROUND_UP(desc->step * (new_sel - old_sel), return DIV_ROUND_UP(rdev->desc->uV_step * (new_sel - old_sel),
s5m8767->ramp_delay * 1000); s5m8767->ramp_delay * 1000);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment