summaryrefslogtreecommitdiff
path: root/drivers/regulator/arizona-ldo1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/arizona-ldo1.c')
-rw-r--r--drivers/regulator/arizona-ldo1.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c
index 96fddfff5dc4..f6d6a4ad9e8a 100644
--- a/drivers/regulator/arizona-ldo1.c
+++ b/drivers/regulator/arizona-ldo1.c
@@ -17,12 +17,11 @@
#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/of.h>
-#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
-#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/regulator/arizona-ldo1.h>
@@ -198,16 +197,6 @@ static int arizona_ldo1_of_get_pdata(struct arizona_ldo1_pdata *pdata,
struct device_node *init_node, *dcvdd_node;
struct regulator_init_data *init_data;
- pdata->ldoena = of_get_named_gpio(np, "wlf,ldoena", 0);
- if (pdata->ldoena < 0) {
- dev_warn(config->dev,
- "LDOENA GPIO property missing/malformed: %d\n",
- pdata->ldoena);
- pdata->ldoena = 0;
- } else {
- config->ena_gpio_initialized = true;
- }
-
init_node = of_get_child_by_name(np, "ldo1");
dcvdd_node = of_parse_phandle(np, "DCVDD-supply", 0);
@@ -264,7 +253,11 @@ static int arizona_ldo1_common_init(struct platform_device *pdev,
}
}
- config.ena_gpio = pdata->ldoena;
+ /* We assume that high output = regulator off */
+ config.ena_gpiod = devm_gpiod_get_optional(&pdev->dev, "wlf,ldoena",
+ GPIOD_OUT_HIGH);
+ if (IS_ERR(config.ena_gpiod))
+ return PTR_ERR(config.ena_gpiod);
if (pdata->init_data)
config.init_data = pdata->init_data;