diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-04-28 12:13:54 +0200 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-06-15 12:18:24 +0200 |
commit | 9035cefc2d4b67591cbc2e4e8fbc8d73901ca9eb (patch) | |
tree | 5c834ee490688ae5254a8d62cc4ea878b60b2b67 /drivers/regulator/fixed.c | |
parent | regulator: Move regulator drivers to subsys_initcall() (diff) | |
download | linux-9035cefc2d4b67591cbc2e4e8fbc8d73901ca9eb.tar.xz linux-9035cefc2d4b67591cbc2e4e8fbc8d73901ca9eb.zip |
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>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r-- | drivers/regulator/fixed.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 6e0bede16ef8..4c525afb0091 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -44,10 +44,22 @@ static int fixed_voltage_get_voltage(struct regulator_dev *dev) return data->microvolts; } +static int fixed_voltage_list_voltage(struct regulator_dev *dev, + unsigned selector) +{ + struct fixed_voltage_data *data = rdev_get_drvdata(dev); + + if (selector != 0) + return -EINVAL; + + return data->microvolts; +} + static struct regulator_ops fixed_voltage_ops = { .is_enabled = fixed_voltage_is_enabled, .enable = fixed_voltage_enable, .get_voltage = fixed_voltage_get_voltage, + .list_voltage = fixed_voltage_list_voltage, }; static int regulator_fixed_voltage_probe(struct platform_device *pdev) @@ -69,7 +81,8 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev) } drvdata->desc.type = REGULATOR_VOLTAGE; drvdata->desc.owner = THIS_MODULE; - drvdata->desc.ops = &fixed_voltage_ops, + drvdata->desc.ops = &fixed_voltage_ops; + drvdata->desc.n_voltages = 1; drvdata->microvolts = config->microvolts; |