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

regulator: tps6105x: Use regulator_list_voltage_table()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 4f73ccad
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/mfd/core.h> #include <linux/mfd/core.h>
#include <linux/mfd/tps6105x.h> #include <linux/mfd/tps6105x.h>
static const int tps6105x_voltages[] = { static const unsigned int tps6105x_voltages[] = {
4500000, 4500000,
5000000, 5000000,
5250000, 5250000,
...@@ -105,22 +105,13 @@ static int tps6105x_regulator_set_voltage_sel(struct regulator_dev *rdev, ...@@ -105,22 +105,13 @@ static int tps6105x_regulator_set_voltage_sel(struct regulator_dev *rdev,
return 0; return 0;
} }
static int tps6105x_regulator_list_voltage(struct regulator_dev *rdev,
unsigned selector)
{
if (selector >= ARRAY_SIZE(tps6105x_voltages))
return -EINVAL;
return tps6105x_voltages[selector];
}
static struct regulator_ops tps6105x_regulator_ops = { static struct regulator_ops tps6105x_regulator_ops = {
.enable = tps6105x_regulator_enable, .enable = tps6105x_regulator_enable,
.disable = tps6105x_regulator_disable, .disable = tps6105x_regulator_disable,
.is_enabled = tps6105x_regulator_is_enabled, .is_enabled = tps6105x_regulator_is_enabled,
.get_voltage_sel = tps6105x_regulator_get_voltage_sel, .get_voltage_sel = tps6105x_regulator_get_voltage_sel,
.set_voltage_sel = tps6105x_regulator_set_voltage_sel, .set_voltage_sel = tps6105x_regulator_set_voltage_sel,
.list_voltage = tps6105x_regulator_list_voltage, .list_voltage = regulator_list_voltage_table,
}; };
static const struct regulator_desc tps6105x_regulator_desc = { static const struct regulator_desc tps6105x_regulator_desc = {
...@@ -130,6 +121,7 @@ static const struct regulator_desc tps6105x_regulator_desc = { ...@@ -130,6 +121,7 @@ static const struct regulator_desc tps6105x_regulator_desc = {
.id = 0, .id = 0,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.n_voltages = ARRAY_SIZE(tps6105x_voltages), .n_voltages = ARRAY_SIZE(tps6105x_voltages),
.volt_table = tps6105x_voltages,
}; };
/* /*
......
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