aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/fixed.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r--drivers/regulator/fixed.c18
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)
44 return data->microvolts; 44 return data->microvolts;
45} 45}
46 46
47static 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
47static struct regulator_ops fixed_voltage_ops = { 58static struct regulator_ops fixed_voltage_ops = {
48 .is_enabled = fixed_voltage_is_enabled, 59 .is_enabled = fixed_voltage_is_enabled,
49 .enable = fixed_voltage_enable, 60 .enable = fixed_voltage_enable,
50 .get_voltage = fixed_voltage_get_voltage, 61 .get_voltage = fixed_voltage_get_voltage,
62 .list_voltage = fixed_voltage_list_voltage,
51}; 63};
52 64
53static int regulator_fixed_voltage_probe(struct platform_device *pdev) 65static int regulator_fixed_voltage_probe(struct platform_device *pdev)
@@ -69,7 +81,8 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
69 } 81 }
70 drvdata->desc.type = REGULATOR_VOLTAGE; 82 drvdata->desc.type = REGULATOR_VOLTAGE;
71 drvdata->desc.owner = THIS_MODULE; 83 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;
73 86
74 drvdata->microvolts = config->microvolts; 87 drvdata->microvolts = config->microvolts;
75 88
@@ -117,7 +130,7 @@ static int __init regulator_fixed_voltage_init(void)
117{ 130{
118 return platform_driver_register(&regulator_fixed_voltage_driver); 131 return platform_driver_register(&regulator_fixed_voltage_driver);
119} 132}
120module_init(regulator_fixed_voltage_init); 133subsys_initcall(regulator_fixed_voltage_init);
121 134
122static void __exit regulator_fixed_voltage_exit(void) 135static void __exit regulator_fixed_voltage_exit(void)
123{ 136{
@@ -128,3 +141,4 @@ module_exit(regulator_fixed_voltage_exit);
128MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); 141MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
129MODULE_DESCRIPTION("Fixed voltage regulator"); 142MODULE_DESCRIPTION("Fixed voltage regulator");
130MODULE_LICENSE("GPL"); 143MODULE_LICENSE("GPL");
144MODULE_ALIAS("platform:reg-fixed-voltage");