summaryrefslogtreecommitdiff
path: root/include/linux/regulator/gpio-regulator.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-01-29 13:31:52 +0300
committerMark Brown <broonie@kernel.org>2019-02-06 18:58:15 +0300
commitd6cd33ad71029a3f77ba1686caf55d4dea58d916 (patch)
treec487971ab5c2bf8709c572b45187339ab29108ce /include/linux/regulator/gpio-regulator.h
parent4f297062b288e9434280dd3a2f0ba7424d7a7224 (diff)
downloadlinux-d6cd33ad71029a3f77ba1686caf55d4dea58d916.tar.xz
regulator: gpio: Convert to use descriptors
This converts the GPIO regulator driver to use decriptors only. We have to let go of the array gpio handling: the fetched descriptors are handled individually anyway, and the array retrieveal function does not make it possible to retrieve each GPIO descriptor with unique flags. Instead get them one by one. We request the "enable" GPIO separately as before, and make sure that this line is requested as nonexclusive since enable lines can be shared and the regulator core expects this. Most users of the GPIO regulator are using device tree. There are two boards in the kernel using the gpio regulator from a non-devicetree path: PXA hx4700 and magician. Make sure to switch these over to use descriptors as well. Cc: Philipp Zabel <p.zabel@pengutronix.de> # Magician Cc: Petr Cvek <petr.cvek@tul.cz> # Magician Cc: Robert Jarzmik <robert.jarzmik@free.fr> # PXA Cc: Paul Parsons <lost.distance@yahoo.com> # hx4700 Cc: Kevin Hilman <khilman@baylibre.com> # Meson Cc: Neil Armstrong <narmstrong@baylibre.com> # Meson Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regulator/gpio-regulator.h')
-rw-r--r--include/linux/regulator/gpio-regulator.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/regulator/gpio-regulator.h b/include/linux/regulator/gpio-regulator.h
index 19fbd267406d..49c407afb944 100644
--- a/include/linux/regulator/gpio-regulator.h
+++ b/include/linux/regulator/gpio-regulator.h
@@ -21,6 +21,8 @@
#ifndef __REGULATOR_GPIO_H
#define __REGULATOR_GPIO_H
+#include <linux/gpio/consumer.h>
+
struct regulator_init_data;
enum regulator_type;
@@ -53,9 +55,9 @@ struct gpio_regulator_state {
* This is used to keep the regulator at
* the default state
* @startup_delay: Start-up time in microseconds
- * @gpios: Array containing the gpios needed to control
- * the setting of the regulator
- * @nr_gpios: Number of gpios
+ * @gflags: Array of GPIO configuration flags for initial
+ * states
+ * @ngpios: Number of GPIOs and configurations available
* @states: Array of gpio_regulator_state entries describing
* the gpio state for specific voltages
* @nr_states: Number of states available
@@ -74,8 +76,8 @@ struct gpio_regulator_config {
unsigned enabled_at_boot:1;
unsigned startup_delay;
- struct gpio *gpios;
- int nr_gpios;
+ enum gpiod_flags *gflags;
+ int ngpios;
struct gpio_regulator_state *states;
int nr_states;