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>
This commit is contained in:
Linus Walleij
2018-05-14 10:06:23 +02:00
committed by Mark Brown
parent 6059577cb2
commit 37bed97f00
4 changed files with 32 additions and 17 deletions

View File

@@ -44,8 +44,6 @@ struct gpio_regulator_state {
/**
* struct gpio_regulator_config - config structure
* @supply_name: Name of the regulator supply
* @enable_gpio: GPIO to use for enable control
* set to -EINVAL if not used
* @enable_high: Polarity of enable GPIO
* 1 = Active high, 0 = Active low
* @enabled_at_boot: Whether regulator has been enabled at
@@ -69,7 +67,6 @@ struct gpio_regulator_state {
struct gpio_regulator_config {
const char *supply_name;
int enable_gpio;
unsigned enable_high:1;
unsigned enabled_at_boot:1;
unsigned startup_delay;