* [PATCH 0/2 v8] gpiolib: finish the legacy cleanup
@ 2026-11-23 8:57 Arnd Bergmann
2026-11-23 8:57 ` [PATCH 1/2] [v8] gpiolib: turn off legacy interface by default Arnd Bergmann
2026-11-23 8:57 ` [PATCH 2/2] [v8] gpiolib: remove linux/gpio.h Arnd Bergmann
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-11-23 8:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Arnd Bergmann, Dmitry Torokhov, Johannes Berg,
John Paul Adrian Glaubitz, Kent Gibson, Thomas Bogendoerfer,
linux-kernel, linux-mips, linux-sh, linux-gpio, linux-wireless
From: Arnd Bergmann <arnd@arndb.de>
These two patches are left from my cleanup series, finishing off the
work to turn off CONFIG_GPIOLIB_LEGACY by default, and removing the
include/linux/gpio.h header.
This was planned for 7.3 originally[1], but kept conflicting with
ongoing cleanups for the broken rsk7203 board. I've skipped the
oneline rsk change now, which will be fixed properly by Dmitry's
patch [2].
Arnd
[1] https://lore.kernel.org/all/20260907090956.2825703-1-arnd@kernel.org/
[2] https://lore.kernel.org/all/20260929-rsk7203-properties-v3-0-02f84aeb8e47@gmail.com/
Arnd Bergmann (2):
[v8] gpiolib: turn off legacy interface by default
[v8] gpiolib: remove linux/gpio.h
MAINTAINERS | 1 -
arch/mips/txx9/rbtx4927/setup.c | 2 +-
drivers/gpio/Kconfig | 9 +++++++-
drivers/gpio/TODO | 4 +---
drivers/gpio/gpiolib-cdev.c | 2 +-
drivers/gpio/gpiolib-legacy.c | 3 +--
drivers/gpio/gpiolib.c | 2 +-
drivers/net/wireless/morsemicro/mm81x/hw.c | 1 -
drivers/net/wireless/morsemicro/mm81x/yaps.c | 1 -
include/linux/gpio.h | 22 --------------------
10 files changed, 13 insertions(+), 34 deletions(-)
delete mode 100644 include/linux/gpio.h
--
2.53.0
Cc: Bartosz Golaszewski <brgl@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Kent Gibson <warthog618@gmail.com>
Cc: Linus Walleij <linusw@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] [v8] gpiolib: turn off legacy interface by default
2026-11-23 8:57 [PATCH 0/2 v8] gpiolib: finish the legacy cleanup Arnd Bergmann
@ 2026-11-23 8:57 ` Arnd Bergmann
2026-11-23 8:57 ` [PATCH 2/2] [v8] gpiolib: remove linux/gpio.h Arnd Bergmann
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-11-23 8:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Arnd Bergmann, Dmitry Torokhov, Johannes Berg,
John Paul Adrian Glaubitz, Kent Gibson, Thomas Bogendoerfer,
linux-kernel, linux-mips, linux-sh, linux-gpio, linux-wireless,
Bartosz Golaszewski, Geert Uytterhoeven
From: Arnd Bergmann <arnd@arndb.de>
All users of the legacy interface now select CONFIG_GPIOLIB_LEGACY,
so it can be turned off by default and only get built on platforms
that still have one unconverted driver.
Allow turning it on manually for compile testing, in order to keep
the build coverage of the legacy drivers in allmodconfig and
randconfig.
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> # for input
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpio/Kconfig | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 9db764a3bcfd..56b5553b51de 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -4,7 +4,14 @@
#
config GPIOLIB_LEGACY
- def_bool y
+ bool "Legacy GPIO interfaces" if COMPILE_TEST
+ help
+ There are a few legacy platforms that use the traditional GPIO
+ number based interfaces instead of GPIO descriptors.
+ Say Y here to enable build testing drivers that are specific
+ to those platforms.
+
+ If unsure, say N.
config HAVE_SHARED_GPIOS
bool
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] [v8] gpiolib: remove linux/gpio.h
2026-11-23 8:57 [PATCH 0/2 v8] gpiolib: finish the legacy cleanup Arnd Bergmann
2026-11-23 8:57 ` [PATCH 1/2] [v8] gpiolib: turn off legacy interface by default Arnd Bergmann
@ 2026-11-23 8:57 ` Arnd Bergmann
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-11-23 8:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Arnd Bergmann, Dmitry Torokhov, Johannes Berg,
John Paul Adrian Glaubitz, Kent Gibson, Thomas Bogendoerfer,
linux-kernel, linux-mips, linux-sh, linux-gpio, linux-wireless,
Bartosz Golaszewski
From: Arnd Bergmann <arnd@arndb.de>
After all other drivers have converted to linux/gpio/consumer.h
or linux/gpio/legacy.h, remove the final leftover bits here.
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
MAINTAINERS | 1 -
arch/mips/txx9/rbtx4927/setup.c | 2 +-
drivers/gpio/TODO | 4 +---
drivers/gpio/gpiolib-cdev.c | 2 +-
drivers/gpio/gpiolib-legacy.c | 3 +--
drivers/gpio/gpiolib.c | 2 +-
drivers/net/wireless/morsemicro/mm81x/hw.c | 1 -
drivers/net/wireless/morsemicro/mm81x/yaps.c | 1 -
include/linux/gpio.h | 22 --------------------
9 files changed, 5 insertions(+), 33 deletions(-)
delete mode 100644 include/linux/gpio.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 829c795c13b3..7efa1e6446a7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11589,7 +11589,6 @@ F: Documentation/devicetree/bindings/gpio/
F: Documentation/driver-api/gpio/
F: drivers/gpio/
F: include/dt-bindings/gpio/
-F: include/linux/gpio.h
F: include/linux/gpio/
K: (devm_)?gpio_(request|free|direction|get|set)
K: GPIOD_FLAGS_BIT_NONEXCLUSIVE
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c
index 223889c03186..fdbe2bd87979 100644
--- a/arch/mips/txx9/rbtx4927/setup.c
+++ b/arch/mips/txx9/rbtx4927/setup.c
@@ -48,7 +48,7 @@
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/leds.h>
#include <asm/io.h>
diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
index 7ce80fde1f17..4fce4a7e4704 100644
--- a/drivers/gpio/TODO
+++ b/drivers/gpio/TODO
@@ -52,9 +52,7 @@ Work items:
base can be made dynamic (set to -1) if CONFIG_GPIO_SYSFS is disabled.
- When this work is complete (will require some of the items in the
- following ongoing work as well) we can delete the old global
- numberspace accessors from <linux/gpio.h> and eventually delete
- <linux/gpio.h> altogether.
+ following ongoing work as well) we can delete <linux/gpio/legacy.h>.
-------------------------------------------------------------------------------
diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index d877f2de506c..795f7df5b540 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -11,7 +11,7 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/file.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/hte.h>
#include <linux/interrupt.h>
diff --git a/drivers/gpio/gpiolib-legacy.c b/drivers/gpio/gpiolib-legacy.c
index c2b04605b203..a841208dc19a 100644
--- a/drivers/gpio/gpiolib-legacy.c
+++ b/drivers/gpio/gpiolib-legacy.c
@@ -7,8 +7,7 @@
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
-
-#include <linux/gpio.h>
+#include <linux/gpio/legacy.h>
#include "gpiolib.h"
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index c09342fc52cb..c16d69761e04 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -30,7 +30,7 @@
#include <linux/string_choices.h>
#include <linux/workqueue.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/gpio/machine.h>
diff --git a/drivers/net/wireless/morsemicro/mm81x/hw.c b/drivers/net/wireless/morsemicro/mm81x/hw.c
index 9293f4094db1..e48eaf151faa 100644
--- a/drivers/net/wireless/morsemicro/mm81x/hw.c
+++ b/drivers/net/wireless/morsemicro/mm81x/hw.c
@@ -7,7 +7,6 @@
#include <linux/stringify.h>
#include <linux/types.h>
#include <linux/unaligned.h>
-#include <linux/gpio.h>
#include "hif.h"
#include "mac.h"
#include "bus.h"
diff --git a/drivers/net/wireless/morsemicro/mm81x/yaps.c b/drivers/net/wireless/morsemicro/mm81x/yaps.c
index 2d1728c1a6de..a843c1c16216 100644
--- a/drivers/net/wireless/morsemicro/mm81x/yaps.c
+++ b/drivers/net/wireless/morsemicro/mm81x/yaps.c
@@ -2,7 +2,6 @@
/*
* Copyright (c) 2017-2026 Morse Micro
*/
-#include <linux/gpio.h>
#include <linux/random.h>
#include <linux/timer.h>
#include <linux/bitops.h>
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
deleted file mode 100644
index b0d4942a65de..000000000000
--- a/include/linux/gpio.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * NOTE: This header *must not* be included.
- *
- * If you're implementing a GPIO driver, only include <linux/gpio/driver.h>
- * If you're implementing a GPIO consumer, only include <linux/gpio/consumer.h>
- * If you're using the legacy interfaces, include <linux/gpio/legacy.h>
- */
-
-#ifndef __LINUX_GPIO_H
-#define __LINUX_GPIO_H
-
-#include <linux/types.h>
-#ifdef CONFIG_GPIOLIB
-#include <linux/gpio/consumer.h>
-#endif
-
-#ifdef CONFIG_GPIOLIB_LEGACY
-#include <linux/gpio/legacy.h>
-#endif /* CONFIG_GPIOLIB_LEGACY */
-
-#endif /* __LINUX_GPIO_H */
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-23 8:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 8:57 [PATCH 0/2 v8] gpiolib: finish the legacy cleanup Arnd Bergmann
2026-11-23 8:57 ` [PATCH 1/2] [v8] gpiolib: turn off legacy interface by default Arnd Bergmann
2026-11-23 8:57 ` [PATCH 2/2] [v8] gpiolib: remove linux/gpio.h Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox