aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-09-10 06:15:06 -0400
committerMark Brown <broonie@linaro.org>2013-09-10 13:19:52 -0400
commitc368e5fc2a190923b786f2de3e79430ea3566a25 (patch)
tree47f6d20005b4aa8e87989a85b3cbde3ec193ced5
parent5a523605afa7d3b54b2e7041f8c9e6bc39872a7e (diff)
regulator: fixed: get rid of {get|list}_voltage()
Provide the rail supply voltage through descriptor to the core and remove the callbacks which implement the get_voltage and list_voltage. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/regulator/fixed.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 7610920014d7..de811f3b921b 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -34,7 +34,6 @@
34struct fixed_voltage_data { 34struct fixed_voltage_data {
35 struct regulator_desc desc; 35 struct regulator_desc desc;
36 struct regulator_dev *dev; 36 struct regulator_dev *dev;
37 int microvolts;
38}; 37};
39 38
40 39
@@ -108,30 +107,7 @@ of_get_fixed_voltage_config(struct device *dev)
108 return config; 107 return config;
109} 108}
110 109
111static int fixed_voltage_get_voltage(struct regulator_dev *dev)
112{
113 struct fixed_voltage_data *data = rdev_get_drvdata(dev);
114
115 if (data->microvolts)
116 return data->microvolts;
117 else
118 return -EINVAL;
119}
120
121static int fixed_voltage_list_voltage(struct regulator_dev *dev,
122 unsigned selector)
123{
124 struct fixed_voltage_data *data = rdev_get_drvdata(dev);
125
126 if (selector != 0)
127 return -EINVAL;
128
129 return data->microvolts;
130}
131
132static struct regulator_ops fixed_voltage_ops = { 110static struct regulator_ops fixed_voltage_ops = {
133 .get_voltage = fixed_voltage_get_voltage,
134 .list_voltage = fixed_voltage_list_voltage,
135}; 111};
136 112
137static int reg_fixed_voltage_probe(struct platform_device *pdev) 113static int reg_fixed_voltage_probe(struct platform_device *pdev)
@@ -186,7 +162,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
186 if (config->microvolts) 162 if (config->microvolts)
187 drvdata->desc.n_voltages = 1; 163 drvdata->desc.n_voltages = 1;
188 164
189 drvdata->microvolts = config->microvolts; 165 drvdata->desc.fixed_uV = config->microvolts;
190 166
191 if (config->gpio >= 0) 167 if (config->gpio >= 0)
192 cfg.ena_gpio = config->gpio; 168 cfg.ena_gpio = config->gpio;
@@ -222,7 +198,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
222 platform_set_drvdata(pdev, drvdata); 198 platform_set_drvdata(pdev, drvdata);
223 199
224 dev_dbg(&pdev->dev, "%s supplying %duV\n", drvdata->desc.name, 200 dev_dbg(&pdev->dev, "%s supplying %duV\n", drvdata->desc.name,
225 drvdata->microvolts); 201 drvdata->desc.fixed_uV);
226 202
227 return 0; 203 return 0;
228 204