diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-15 12:27:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-15 12:27:37 -0400 |
commit | d3bf80bff13597004b5724ee4549cd68eb0badf0 (patch) | |
tree | 67f0a50e3135acd63348882d8ef836b498450f5f /drivers/regulator/fixed.c | |
parent | 9c7cb99a8202452d3e0440a5505c5c6d262771d9 (diff) | |
parent | c8f1e5025ca2fa8e6e037451f3d271e66745a19b (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
regulator/max1586: fix V3 gain calculation integer overflow
regulator/max1586: support increased V3 voltage range
regulator: lp3971 - fix driver link error when built-in.
LP3971 PMIC regulator driver (updated and combined version)
regulator: remove driver_data direct access of struct device
regulator: Set MODULE_ALIAS for regulator drivers
regulator: Support list_voltage for fixed voltage regulator
regulator: Move regulator drivers to subsys_initcall()
regulator: build fix for powerpc - renamed show_state
regulator: add userspace-consumer driver
Maxim 1586 regulator driver
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) | |||
44 | return data->microvolts; | 44 | return data->microvolts; |
45 | } | 45 | } |
46 | 46 | ||
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 | |||
47 | static struct regulator_ops fixed_voltage_ops = { | 58 | static 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 | ||
53 | static int regulator_fixed_voltage_probe(struct platform_device *pdev) | 65 | static 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(®ulator_fixed_voltage_driver); | 131 | return platform_driver_register(®ulator_fixed_voltage_driver); |
119 | } | 132 | } |
120 | module_init(regulator_fixed_voltage_init); | 133 | subsys_initcall(regulator_fixed_voltage_init); |
121 | 134 | ||
122 | static void __exit regulator_fixed_voltage_exit(void) | 135 | static void __exit regulator_fixed_voltage_exit(void) |
123 | { | 136 | { |
@@ -128,3 +141,4 @@ module_exit(regulator_fixed_voltage_exit); | |||
128 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | 141 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
129 | MODULE_DESCRIPTION("Fixed voltage regulator"); | 142 | MODULE_DESCRIPTION("Fixed voltage regulator"); |
130 | MODULE_LICENSE("GPL"); | 143 | MODULE_LICENSE("GPL"); |
144 | MODULE_ALIAS("platform:reg-fixed-voltage"); | ||