Skip to content

Commit 9035cef

Browse files
broonieLiam Girdwood
authored andcommitted
regulator: Support list_voltage for fixed voltage regulator
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
1 parent 5a1b22b commit 9035cef

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎drivers/regulator/fixed.c‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,22 @@ static int fixed_voltage_get_voltage(struct regulator_dev *dev)
4444
return data->microvolts;
4545
}
4646

47+
static int fixed_voltage_list_voltage(struct regulator_dev *dev,
48+
unsigned selector)
49+
{
50+
struct fixed_voltage_data *data = rdev_get_drvdata(dev);
51+
52+
if (selector != 0)
53+
return -EINVAL;
54+
55+
return data->microvolts;
56+
}
57+
4758
static struct regulator_ops fixed_voltage_ops = {
4859
.is_enabled = fixed_voltage_is_enabled,
4960
.enable = fixed_voltage_enable,
5061
.get_voltage = fixed_voltage_get_voltage,
62+
.list_voltage = fixed_voltage_list_voltage,
5163
};
5264

5365
static int regulator_fixed_voltage_probe(struct platform_device *pdev)
@@ -69,7 +81,8 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
6981
}
7082
drvdata->desc.type = REGULATOR_VOLTAGE;
7183
drvdata->desc.owner = THIS_MODULE;
72-
drvdata->desc.ops = &fixed_voltage_ops,
84+
drvdata->desc.ops = &fixed_voltage_ops;
85+
drvdata->desc.n_voltages = 1;
7386

7487
drvdata->microvolts = config->microvolts;
7588

0 commit comments

Comments
 (0)