diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 02:24:53 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 02:24:53 +0200 |
commit | 492b057c426e4aa747484958e18e9da29003985d (patch) | |
tree | 34e08c24618688d8bcc190523028b5f94cce0c0b /drivers/regulator/fixed.c | |
parent | usb/ps3: Add missing annotations (diff) | |
parent | Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
download | linux-492b057c426e4aa747484958e18e9da29003985d.tar.xz linux-492b057c426e4aa747484958e18e9da29003985d.zip |
Merge commit 'origin/master' into next
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r-- | drivers/regulator/fixed.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 23d554628a76..cdc674fb46c3 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; @@ -117,7 +130,7 @@ static int __init regulator_fixed_voltage_init(void) { return platform_driver_register(®ulator_fixed_voltage_driver); } -module_init(regulator_fixed_voltage_init); +subsys_initcall(regulator_fixed_voltage_init); static void __exit regulator_fixed_voltage_exit(void) { @@ -128,3 +141,4 @@ module_exit(regulator_fixed_voltage_exit); MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); MODULE_DESCRIPTION("Fixed voltage regulator"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:reg-fixed-voltage"); |