summaryrefslogtreecommitdiff
path: root/include/linux/gpio.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2025-07-22 17:35:43 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-07-24 16:24:49 +0200
commit678bae2eaa812662929a83b3de399645e9de93ad (patch)
tree13b602005e207ccdeb8e43db06813e3da917c02a /include/linux/gpio.h
parent8c7a86088a3eb6f874cc5c46a447787d3a193ff5 (diff)
gpiolib: make legacy interfaces optional
The traditional interfaces are only used on a small number of ancient boards. Make these optional now so they can be disabled by default. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Link: https://lore.kernel.org/r/20250722153634.3683927-1-arnd@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r--include/linux/gpio.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index ff99ed76fdc3..8f85ddb26429 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -13,6 +13,11 @@
#define __LINUX_GPIO_H
#include <linux/types.h>
+#ifdef CONFIG_GPIOLIB
+#include <linux/gpio/consumer.h>
+#endif
+
+#ifdef CONFIG_GPIOLIB_LEGACY
struct device;
@@ -22,9 +27,6 @@ struct device;
#define GPIOF_OUT_INIT_HIGH ((0 << 0) | (1 << 1))
#ifdef CONFIG_GPIOLIB
-
-#include <linux/gpio/consumer.h>
-
/*
* "valid" GPIO numbers are nonnegative and may be passed to
* setup routines like gpio_request(). Only some valid numbers
@@ -170,5 +172,5 @@ static inline int devm_gpio_request_one(struct device *dev, unsigned gpio,
}
#endif /* ! CONFIG_GPIOLIB */
-
+#endif /* CONFIG_GPIOLIB_LEGACY */
#endif /* __LINUX_GPIO_H */