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.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index a43b0e8a438d..988a7472c2ab 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -30,9 +30,6 @@
30#include <linux/of_gpio.h> 30#include <linux/of_gpio.h>
31#include <linux/regulator/of_regulator.h> 31#include <linux/regulator/of_regulator.h>
32#include <linux/regulator/machine.h> 32#include <linux/regulator/machine.h>
33#include <linux/acpi.h>
34#include <linux/property.h>
35#include <linux/gpio/consumer.h>
36 33
37struct fixed_voltage_data { 34struct fixed_voltage_data {
38 struct regulator_desc desc; 35 struct regulator_desc desc;
@@ -97,44 +94,6 @@ of_get_fixed_voltage_config(struct device *dev,
97 return config; 94 return config;
98} 95}
99 96
100/**
101 * acpi_get_fixed_voltage_config - extract fixed_voltage_config structure info
102 * @dev: device requesting for fixed_voltage_config
103 * @desc: regulator description
104 *
105 * Populates fixed_voltage_config structure by extracting data through ACPI
106 * interface, returns a pointer to the populated structure of NULL if memory
107 * alloc fails.
108 */
109static struct fixed_voltage_config *
110acpi_get_fixed_voltage_config(struct device *dev,
111 const struct regulator_desc *desc)
112{
113 struct fixed_voltage_config *config;
114 const char *supply_name;
115 struct gpio_desc *gpiod;
116 int ret;
117
118 config = devm_kzalloc(dev, sizeof(*config), GFP_KERNEL);
119 if (!config)
120 return ERR_PTR(-ENOMEM);
121
122 ret = device_property_read_string(dev, "supply-name", &supply_name);
123 if (!ret)
124 config->supply_name = supply_name;
125
126 gpiod = gpiod_get(dev, "gpio", GPIOD_ASIS);
127 if (IS_ERR(gpiod))
128 return ERR_PTR(-ENODEV);
129
130 config->gpio = desc_to_gpio(gpiod);
131 config->enable_high = device_property_read_bool(dev,
132 "enable-active-high");
133 gpiod_put(gpiod);
134
135 return config;
136}
137
138static struct regulator_ops fixed_voltage_ops = { 97static struct regulator_ops fixed_voltage_ops = {
139}; 98};
140 99
@@ -155,11 +114,6 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
155 &drvdata->desc); 114 &drvdata->desc);
156 if (IS_ERR(config)) 115 if (IS_ERR(config))
157 return PTR_ERR(config); 116 return PTR_ERR(config);
158 } else if (ACPI_HANDLE(&pdev->dev)) {
159 config = acpi_get_fixed_voltage_config(&pdev->dev,
160 &drvdata->desc);
161 if (IS_ERR(config))
162 return PTR_ERR(config);
163 } else { 117 } else {
164 config = dev_get_platdata(&pdev->dev); 118 config = dev_get_platdata(&pdev->dev);
165 } 119 }