aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/axp20x-regulator.c2
-rw-r--r--drivers/regulator/fixed.c46
-rw-r--r--drivers/regulator/twl6030-regulator.c2
3 files changed, 2 insertions, 48 deletions
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index e6a512ebeae2..a3ade9e4ef47 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -272,7 +272,7 @@ static const struct regulator_desc axp806_regulators[] = {
272 64, AXP806_DCDCD_V_CTRL, 0x3f, AXP806_PWR_OUT_CTRL1, 272 64, AXP806_DCDCD_V_CTRL, 0x3f, AXP806_PWR_OUT_CTRL1,
273 BIT(3)), 273 BIT(3)),
274 AXP_DESC(AXP806, DCDCE, "dcdce", "vine", 1100, 3400, 100, 274 AXP_DESC(AXP806, DCDCE, "dcdce", "vine", 1100, 3400, 100,
275 AXP806_DCDCB_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(4)), 275 AXP806_DCDCE_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(4)),
276 AXP_DESC(AXP806, ALDO1, "aldo1", "aldoin", 700, 3300, 100, 276 AXP_DESC(AXP806, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
277 AXP806_ALDO1_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(5)), 277 AXP806_ALDO1_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(5)),
278 AXP_DESC(AXP806, ALDO2, "aldo2", "aldoin", 700, 3400, 100, 278 AXP_DESC(AXP806, ALDO2, "aldo2", "aldoin", 700, 3400, 100,
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 }
diff --git a/drivers/regulator/twl6030-regulator.c b/drivers/regulator/twl6030-regulator.c
index 4864b9d742c0..716191046a70 100644
--- a/drivers/regulator/twl6030-regulator.c
+++ b/drivers/regulator/twl6030-regulator.c
@@ -452,7 +452,7 @@ static int twl6030smps_map_voltage(struct regulator_dev *rdev, int min_uV,
452 vsel = 62; 452 vsel = 62;
453 else if ((min_uV > 1800000) && (min_uV <= 1900000)) 453 else if ((min_uV > 1800000) && (min_uV <= 1900000))
454 vsel = 61; 454 vsel = 61;
455 else if ((min_uV > 1350000) && (min_uV <= 1800000)) 455 else if ((min_uV > 1500000) && (min_uV <= 1800000))
456 vsel = 60; 456 vsel = 60;
457 else if ((min_uV > 1350000) && (min_uV <= 1500000)) 457 else if ((min_uV > 1350000) && (min_uV <= 1500000))
458 vsel = 59; 458 vsel = 59;