diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
commit | b4b7ff4b08e691656c9d77c758fc355833128ac0 (patch) | |
tree | 82fcb00e6b918026dc9f2d1f05ed8eee83874cc0 /drivers/regulator/arizona-ldo1.c | |
parent | 35acfa0fc609f2a2cd95cef4a6a9c3a5c38f1778 (diff) |
Linux-libre 4.4-gnupck-4.4-gnu
Diffstat (limited to 'drivers/regulator/arizona-ldo1.c')
-rw-r--r-- | drivers/regulator/arizona-ldo1.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c index 5e947a8dd..f7c88ff90 100644 --- a/drivers/regulator/arizona-ldo1.c +++ b/drivers/regulator/arizona-ldo1.c @@ -17,6 +17,7 @@ #include <linux/bitops.h> #include <linux/err.h> #include <linux/of.h> +#include <linux/of_gpio.h> #include <linux/platform_device.h> #include <linux/regulator/driver.h> #include <linux/regulator/machine.h> @@ -189,13 +190,22 @@ static int arizona_ldo1_of_get_pdata(struct arizona *arizona, { struct arizona_pdata *pdata = &arizona->pdata; struct arizona_ldo1 *ldo1 = config->driver_data; + struct device_node *np = arizona->dev->of_node; struct device_node *init_node, *dcvdd_node; struct regulator_init_data *init_data; - pdata->ldoena = arizona_of_get_named_gpio(arizona, "wlf,ldoena", true); + pdata->ldoena = of_get_named_gpio(np, "wlf,ldoena", 0); + if (pdata->ldoena < 0) { + dev_warn(arizona->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(arizona->dev->of_node, "ldo1"); - dcvdd_node = of_parse_phandle(arizona->dev->of_node, "DCVDD-supply", 0); + init_node = of_get_child_by_name(np, "ldo1"); + dcvdd_node = of_parse_phandle(np, "DCVDD-supply", 0); if (init_node) { config->of_node = init_node; @@ -245,6 +255,8 @@ static int arizona_ldo1_probe(struct platform_device *pdev) switch (arizona->type) { case WM5102: case WM8997: + case WM8998: + case WM1814: desc = &arizona_ldo1_hc; ldo1->init_data = arizona_ldo1_dvfs; break; @@ -272,8 +284,6 @@ static int arizona_ldo1_probe(struct platform_device *pdev) ret = arizona_ldo1_of_get_pdata(arizona, &config, desc); if (ret < 0) return ret; - - config.ena_gpio_initialized = true; } } |