Commit afb8bb80 authored by Mark Brown's avatar Mark Brown Committed by Liam Girdwood

regulator: Convert WM831x drivers to use get_voltage_sel()

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 476c2d83
...@@ -377,14 +377,14 @@ static int wm831x_buckv_set_suspend_voltage(struct regulator_dev *rdev, ...@@ -377,14 +377,14 @@ static int wm831x_buckv_set_suspend_voltage(struct regulator_dev *rdev,
return wm831x_set_bits(wm831x, reg, WM831X_DC1_SLP_VSEL_MASK, vsel); return wm831x_set_bits(wm831x, reg, WM831X_DC1_SLP_VSEL_MASK, vsel);
} }
static int wm831x_buckv_get_voltage(struct regulator_dev *rdev) static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev)
{ {
struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
if (dcdc->dvs_gpio && dcdc->dvs_gpio_state) if (dcdc->dvs_gpio && dcdc->dvs_gpio_state)
return wm831x_buckv_list_voltage(rdev, dcdc->dvs_vsel); return dcdc->dvs_vsel;
else else
return wm831x_buckv_list_voltage(rdev, dcdc->on_vsel); return dcdc->on_vsel;
} }
/* Current limit options */ /* Current limit options */
...@@ -426,7 +426,7 @@ static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev) ...@@ -426,7 +426,7 @@ static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev)
static struct regulator_ops wm831x_buckv_ops = { static struct regulator_ops wm831x_buckv_ops = {
.set_voltage = wm831x_buckv_set_voltage, .set_voltage = wm831x_buckv_set_voltage,
.get_voltage = wm831x_buckv_get_voltage, .get_voltage_sel = wm831x_buckv_get_voltage_sel,
.list_voltage = wm831x_buckv_list_voltage, .list_voltage = wm831x_buckv_list_voltage,
.set_suspend_voltage = wm831x_buckv_set_suspend_voltage, .set_suspend_voltage = wm831x_buckv_set_suspend_voltage,
.set_current_limit = wm831x_buckv_set_current_limit, .set_current_limit = wm831x_buckv_set_current_limit,
...@@ -678,7 +678,7 @@ static int wm831x_buckp_set_suspend_voltage(struct regulator_dev *rdev, ...@@ -678,7 +678,7 @@ static int wm831x_buckp_set_suspend_voltage(struct regulator_dev *rdev,
return wm831x_buckp_set_voltage_int(rdev, reg, uV, uV, &selector); return wm831x_buckp_set_voltage_int(rdev, reg, uV, uV, &selector);
} }
static int wm831x_buckp_get_voltage(struct regulator_dev *rdev) static int wm831x_buckp_get_voltage_sel(struct regulator_dev *rdev)
{ {
struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
struct wm831x *wm831x = dcdc->wm831x; struct wm831x *wm831x = dcdc->wm831x;
...@@ -689,12 +689,12 @@ static int wm831x_buckp_get_voltage(struct regulator_dev *rdev) ...@@ -689,12 +689,12 @@ static int wm831x_buckp_get_voltage(struct regulator_dev *rdev)
if (val < 0) if (val < 0)
return val; return val;
return wm831x_buckp_list_voltage(rdev, val & WM831X_DC3_ON_VSEL_MASK); return val & WM831X_DC3_ON_VSEL_MASK;
} }
static struct regulator_ops wm831x_buckp_ops = { static struct regulator_ops wm831x_buckp_ops = {
.set_voltage = wm831x_buckp_set_voltage, .set_voltage = wm831x_buckp_set_voltage,
.get_voltage = wm831x_buckp_get_voltage, .get_voltage_sel = wm831x_buckp_get_voltage_sel,
.list_voltage = wm831x_buckp_list_voltage, .list_voltage = wm831x_buckp_list_voltage,
.set_suspend_voltage = wm831x_buckp_set_suspend_voltage, .set_suspend_voltage = wm831x_buckp_set_suspend_voltage,
......
...@@ -160,7 +160,7 @@ static int wm831x_gp_ldo_set_suspend_voltage(struct regulator_dev *rdev, ...@@ -160,7 +160,7 @@ static int wm831x_gp_ldo_set_suspend_voltage(struct regulator_dev *rdev,
return wm831x_gp_ldo_set_voltage_int(rdev, reg, uV, uV, &selector); return wm831x_gp_ldo_set_voltage_int(rdev, reg, uV, uV, &selector);
} }
static int wm831x_gp_ldo_get_voltage(struct regulator_dev *rdev) static int wm831x_gp_ldo_get_voltage_sel(struct regulator_dev *rdev)
{ {
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x; struct wm831x *wm831x = ldo->wm831x;
...@@ -173,7 +173,7 @@ static int wm831x_gp_ldo_get_voltage(struct regulator_dev *rdev) ...@@ -173,7 +173,7 @@ static int wm831x_gp_ldo_get_voltage(struct regulator_dev *rdev)
ret &= WM831X_LDO1_ON_VSEL_MASK; ret &= WM831X_LDO1_ON_VSEL_MASK;
return wm831x_gp_ldo_list_voltage(rdev, ret); return ret;
} }
static unsigned int wm831x_gp_ldo_get_mode(struct regulator_dev *rdev) static unsigned int wm831x_gp_ldo_get_mode(struct regulator_dev *rdev)
...@@ -293,7 +293,7 @@ static unsigned int wm831x_gp_ldo_get_optimum_mode(struct regulator_dev *rdev, ...@@ -293,7 +293,7 @@ static unsigned int wm831x_gp_ldo_get_optimum_mode(struct regulator_dev *rdev,
static struct regulator_ops wm831x_gp_ldo_ops = { static struct regulator_ops wm831x_gp_ldo_ops = {
.list_voltage = wm831x_gp_ldo_list_voltage, .list_voltage = wm831x_gp_ldo_list_voltage,
.get_voltage = wm831x_gp_ldo_get_voltage, .get_voltage_sel = wm831x_gp_ldo_get_voltage_sel,
.set_voltage = wm831x_gp_ldo_set_voltage, .set_voltage = wm831x_gp_ldo_set_voltage,
.set_suspend_voltage = wm831x_gp_ldo_set_suspend_voltage, .set_suspend_voltage = wm831x_gp_ldo_set_suspend_voltage,
.get_mode = wm831x_gp_ldo_get_mode, .get_mode = wm831x_gp_ldo_get_mode,
...@@ -465,7 +465,7 @@ static int wm831x_aldo_set_suspend_voltage(struct regulator_dev *rdev, ...@@ -465,7 +465,7 @@ static int wm831x_aldo_set_suspend_voltage(struct regulator_dev *rdev,
return wm831x_aldo_set_voltage_int(rdev, reg, uV, uV, &selector); return wm831x_aldo_set_voltage_int(rdev, reg, uV, uV, &selector);
} }
static int wm831x_aldo_get_voltage(struct regulator_dev *rdev) static int wm831x_aldo_get_voltage_sel(struct regulator_dev *rdev)
{ {
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x; struct wm831x *wm831x = ldo->wm831x;
...@@ -478,7 +478,7 @@ static int wm831x_aldo_get_voltage(struct regulator_dev *rdev) ...@@ -478,7 +478,7 @@ static int wm831x_aldo_get_voltage(struct regulator_dev *rdev)
ret &= WM831X_LDO7_ON_VSEL_MASK; ret &= WM831X_LDO7_ON_VSEL_MASK;
return wm831x_aldo_list_voltage(rdev, ret); return ret;
} }
static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev) static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev)
...@@ -559,7 +559,7 @@ static int wm831x_aldo_get_status(struct regulator_dev *rdev) ...@@ -559,7 +559,7 @@ static int wm831x_aldo_get_status(struct regulator_dev *rdev)
static struct regulator_ops wm831x_aldo_ops = { static struct regulator_ops wm831x_aldo_ops = {
.list_voltage = wm831x_aldo_list_voltage, .list_voltage = wm831x_aldo_list_voltage,
.get_voltage = wm831x_aldo_get_voltage, .get_voltage_sel = wm831x_aldo_get_voltage_sel,
.set_voltage = wm831x_aldo_set_voltage, .set_voltage = wm831x_aldo_set_voltage,
.set_suspend_voltage = wm831x_aldo_set_suspend_voltage, .set_suspend_voltage = wm831x_aldo_set_suspend_voltage,
.get_mode = wm831x_aldo_get_mode, .get_mode = wm831x_aldo_get_mode,
...@@ -718,7 +718,7 @@ static int wm831x_alive_ldo_set_suspend_voltage(struct regulator_dev *rdev, ...@@ -718,7 +718,7 @@ static int wm831x_alive_ldo_set_suspend_voltage(struct regulator_dev *rdev,
return wm831x_alive_ldo_set_voltage_int(rdev, reg, uV, uV, &selector); return wm831x_alive_ldo_set_voltage_int(rdev, reg, uV, uV, &selector);
} }
static int wm831x_alive_ldo_get_voltage(struct regulator_dev *rdev) static int wm831x_alive_ldo_get_voltage_sel(struct regulator_dev *rdev)
{ {
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x; struct wm831x *wm831x = ldo->wm831x;
...@@ -731,7 +731,7 @@ static int wm831x_alive_ldo_get_voltage(struct regulator_dev *rdev) ...@@ -731,7 +731,7 @@ static int wm831x_alive_ldo_get_voltage(struct regulator_dev *rdev)
ret &= WM831X_LDO11_ON_VSEL_MASK; ret &= WM831X_LDO11_ON_VSEL_MASK;
return wm831x_alive_ldo_list_voltage(rdev, ret); return ret;
} }
static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev) static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev)
...@@ -753,7 +753,7 @@ static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev) ...@@ -753,7 +753,7 @@ static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev)
static struct regulator_ops wm831x_alive_ldo_ops = { static struct regulator_ops wm831x_alive_ldo_ops = {
.list_voltage = wm831x_alive_ldo_list_voltage, .list_voltage = wm831x_alive_ldo_list_voltage,
.get_voltage = wm831x_alive_ldo_get_voltage, .get_voltage_sel = wm831x_alive_ldo_get_voltage_sel,
.set_voltage = wm831x_alive_ldo_set_voltage, .set_voltage = wm831x_alive_ldo_set_voltage,
.set_suspend_voltage = wm831x_alive_ldo_set_suspend_voltage, .set_suspend_voltage = wm831x_alive_ldo_set_suspend_voltage,
.get_status = wm831x_alive_ldo_get_status, .get_status = wm831x_alive_ldo_get_status,
......
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