aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/magician.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-05-14 10:06:23 +0200
committerMark Brown <broonie@kernel.org>2018-05-29 15:55:12 +0100
commit37bed97f00734ce329495823d9682181028b51e4 (patch)
treed320f47ce4a7a7c657cc87a79e3953a7928a9869 /arch/arm/mach-pxa/magician.c
parentregulator: fixed: Convert to use GPIO descriptor only (diff)
downloadlinux-dev-37bed97f00734ce329495823d9682181028b51e4.tar.xz
linux-dev-37bed97f00734ce329495823d9682181028b51e4.zip
regulator: gpio: Get enable GPIO using GPIO descriptor
We augment the GPIO regulator to get the *enable* regulator GPIO line (not the other lines) using a descriptor rather than a global number. We then pass this into the regulator core which has been prepared to hande enable descriptors in a separate patch. Switch over the two boardfiles using this facility and clean up so we only pass descriptors around. Cc: Philipp Zabel <philipp.zabel@gmail.com> # HX4700/Magician maintainer Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r--arch/arm/mach-pxa/magician.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 14c0f80bc9e7..9a5bda3ea194 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -657,7 +657,6 @@ static struct gpio_regulator_state bq24022_states[] = {
static struct gpio_regulator_config bq24022_info = {
.supply_name = "bq24022",
- .enable_gpio = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
.enable_high = 0,
.enabled_at_boot = 1,
@@ -679,6 +678,15 @@ static struct platform_device bq24022 = {
},
};
+static struct gpiod_lookup_table bq24022_gpiod_table = {
+ .dev_id = "gpio-regulator",
+ .table = {
+ GPIO_LOOKUP("gpio-pxa", GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
+ "enable", GPIO_ACTIVE_HIGH),
+ { },
+ },
+};
+
/*
* fixed regulator for ads7846
*/
@@ -1007,6 +1015,7 @@ static void __init magician_init(void)
regulator_register_always_on(0, "power", pwm_backlight_supply,
ARRAY_SIZE(pwm_backlight_supply), 5000000);
+ gpiod_add_lookup_table(&bq24022_gpiod_table);
platform_add_devices(ARRAY_AND_SIZE(devices));
}