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

regulator: mc13892: Convert mc13892_sw_regulator_ops to get_voltage_sel

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 8db98440
...@@ -393,11 +393,11 @@ static struct regulator_ops mc13892_gpo_regulator_ops = { ...@@ -393,11 +393,11 @@ static struct regulator_ops mc13892_gpo_regulator_ops = {
.get_voltage = mc13xxx_fixed_regulator_get_voltage, .get_voltage = mc13xxx_fixed_regulator_get_voltage,
}; };
static int mc13892_sw_regulator_get_voltage(struct regulator_dev *rdev) static int mc13892_sw_regulator_get_voltage_sel(struct regulator_dev *rdev)
{ {
struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev); struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
int ret, id = rdev_get_id(rdev); int ret, id = rdev_get_id(rdev);
unsigned int val, hi; unsigned int val;
dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id); dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
...@@ -408,17 +408,11 @@ static int mc13892_sw_regulator_get_voltage(struct regulator_dev *rdev) ...@@ -408,17 +408,11 @@ static int mc13892_sw_regulator_get_voltage(struct regulator_dev *rdev)
if (ret) if (ret)
return ret; return ret;
hi = val & MC13892_SWITCHERS0_SWxHI;
val = (val & mc13892_regulators[id].vsel_mask) val = (val & mc13892_regulators[id].vsel_mask)
>> mc13892_regulators[id].vsel_shift; >> mc13892_regulators[id].vsel_shift;
dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val); dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val);
if (hi)
val = (25000 * val) + 1100000;
else
val = (25000 * val) + 600000;
return val; return val;
} }
...@@ -453,7 +447,7 @@ static int mc13892_sw_regulator_set_voltage_sel(struct regulator_dev *rdev, ...@@ -453,7 +447,7 @@ static int mc13892_sw_regulator_set_voltage_sel(struct regulator_dev *rdev,
static struct regulator_ops mc13892_sw_regulator_ops = { static struct regulator_ops mc13892_sw_regulator_ops = {
.list_voltage = regulator_list_voltage_table, .list_voltage = regulator_list_voltage_table,
.set_voltage_sel = mc13892_sw_regulator_set_voltage_sel, .set_voltage_sel = mc13892_sw_regulator_set_voltage_sel,
.get_voltage = mc13892_sw_regulator_get_voltage, .get_voltage_sel = mc13892_sw_regulator_get_voltage_sel,
}; };
static int mc13892_vcam_set_mode(struct regulator_dev *rdev, unsigned int mode) static int mc13892_vcam_set_mode(struct regulator_dev *rdev, unsigned int mode)
......
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