]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/regulator/fixed.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
[karo-tx-linux.git] / drivers / regulator / fixed.c
index 6e0bede16ef8db6ea608ca97143a0a07bfd6fabb..cdc674fb46c3371192c7b2975df97ac9794a3e0d 100644 (file)
@@ -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;
 
@@ -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");