Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: da9055: Pass descriptor instead of GPIO number

When setting up a fixed regulator on the DA9055, pass a descriptor
instead of a global GPIO number. This facility is not used in the
kernel so we can easily just say that this should be a descriptor
if/when put to use.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Linus Walleij and committed by
Mark Brown
8d05560d e45e290a

+5 -4
+2 -2
drivers/regulator/da9055-regulator.c
··· 16 16 #include <linux/init.h> 17 17 #include <linux/err.h> 18 18 #include <linux/gpio.h> 19 + #include <linux/gpio/consumer.h> 19 20 #include <linux/platform_device.h> 20 21 #include <linux/regulator/driver.h> 21 22 #include <linux/regulator/machine.h> ··· 456 455 char name[18]; 457 456 int gpio_mux = pdata->gpio_ren[id]; 458 457 459 - config->ena_gpio = pdata->ena_gpio[id]; 460 - config->ena_gpio_flags = GPIOF_OUT_INIT_HIGH; 458 + config->ena_gpiod = pdata->ena_gpiods[id]; 461 459 config->ena_gpio_invert = 1; 462 460 463 461 /*
+3 -2
include/linux/mfd/da9055/pdata.h
··· 12 12 #define DA9055_MAX_REGULATORS 8 13 13 14 14 struct da9055; 15 + struct gpio_desc; 15 16 16 17 enum gpio_select { 17 18 NO_GPIO = 0, ··· 48 47 * controls the regulator set A/B, 0 if not available. 49 48 */ 50 49 enum gpio_select *reg_rsel; 51 - /* GPIOs to enable regulator, 0 if not available */ 52 - int *ena_gpio; 50 + /* GPIO descriptors to enable regulator, NULL if not available */ 51 + struct gpio_desc **ena_gpiods; 53 52 }; 54 53 #endif /* __DA9055_PDATA_H */