* [PATCH 00/21] gpiolib: fence off legacy interfaces
@ 2025-08-08 15:17 Arnd Bergmann
2025-08-08 15:17 ` [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional Arnd Bergmann
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Arnd Bergmann @ 2025-08-08 15:17 UTC (permalink / raw)
To: Bartosz Golaszewski, Linus Walleij, linux-gpio
Cc: Arnd Bergmann, Andrew Lunn, Sebastian Hesselbarth,
Gregory Clement, Russell King, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Krzysztof Kozlowski, Alim Akhtar,
Geert Uytterhoeven, Thomas Bogendoerfer, Yoshinori Sato,
Rich Felker, John Paul Adrian Glaubitz, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Dmitry Torokhov, Lee Jones, Pavel Machek, Mauro Carvalho Chehab,
Matti Vaittinen, Florian Fainelli, Jeff Johnson, Hans de Goede,
Ilpo Järvinen, Greg Kroah-Hartman, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Mark Brown, Andy Shevchenko,
Dr. David Alan Gilbert, linux-arm-kernel, linux-kernel,
linux-samsung-soc, linux-m68k, linux-mips, linux-sh, linux-input,
linux-leds, linux-media, patches, netdev, linux-wireless, ath10k,
platform-driver-x86, linux-usb, linux-sound
From: Arnd Bergmann <arnd@arndb.de>
Commit 678bae2eaa81 ("gpiolib: make legacy interfaces optional") was
merged for linux-6.17, so now it is possible to use the legacy interfaces
conditionally and eventually have the support left out of the kernel
whenever it is not needed.
I created six patches to force-enable CONFIG_GPIOLIB_LEGACY on the
few (mostly ancient) platforms that still require this, plus a set of
patches to either add the corresponding Kconfig dependencies that make
the device drivers conditional on that symbol, or change them to no
longer require it.
The final patch ends up turning the Kconfig symbol off by default,
which of course depends on everything else getting merged first to avoid
build errors.
I would suggest that patches 1-20 can just get merged through the
respective maintainer trees independently when they are deemed ready,
and the final patch can wait another merge window.
Arnd
Arnd Bergmann (21):
ARM: select legacy gpiolib interfaces where used
m68k: coldfire: select legacy gpiolib interface for mcfqspi
mips: select legacy gpiolib interfaces where used
sh: select legacy gpiolib interface
x86/platform: select legacy gpiolib interfaces where used
x86/olpc: select GPIOLIB_LEGACY
mfd: wm8994: remove dead legacy-gpio code
ASoC: add GPIOLIB_LEGACY dependency where needed
input: gpio-keys: make legacy gpiolib optional
leds: gpio: make legacy gpiolib interface optional
media: em28xx: add special case for legacy gpiolib interface
mfd: arizona: make legacy gpiolib interface optional
mfd: si476x: add GPIOLIB_LEGACY dependency
mfd: aat2870: add GPIOLIB_LEGACY dependency
dsa: b53: hide legacy gpiolib usage on non-mips
ath10k: remove gpio number assignment
nfc: marvell: convert to gpio descriptors
nfc: s3fwrn5: convert to gpio descriptors
usb: udc: pxa: remove unused platform_data
ASoC: pxa: add GPIOLIB_LEGACY dependency
gpiolib: turn off legacy interface by default
arch/arm/mach-mv78xx0/Kconfig | 1 +
arch/arm/mach-orion5x/Kconfig | 1 +
arch/arm/mach-pxa/Kconfig | 1 +
arch/arm/mach-pxa/devices.c | 7 --
arch/arm/mach-pxa/gumstix.c | 1 -
arch/arm/mach-pxa/udc.h | 8 --
arch/arm/mach-s3c/Kconfig.s3c64xx | 1 +
arch/arm/mach-sa1100/Kconfig | 1 +
arch/m68k/Kconfig.cpu | 1 +
arch/mips/Kconfig | 5 +
arch/mips/alchemy/Kconfig | 1 -
arch/mips/txx9/Kconfig | 1 +
arch/sh/Kconfig | 1 +
arch/sh/boards/Kconfig | 8 ++
arch/sh/boards/mach-highlander/Kconfig | 1 +
arch/sh/boards/mach-rsk/Kconfig | 3 +
arch/x86/Kconfig | 1 +
drivers/gpio/Kconfig | 11 ++-
drivers/input/keyboard/gpio_keys.c | 5 +-
drivers/input/keyboard/gpio_keys_polled.c | 2 +
drivers/input/misc/Kconfig | 3 +
drivers/leds/leds-gpio.c | 8 +-
drivers/media/usb/em28xx/Kconfig | 1 +
drivers/media/usb/em28xx/em28xx-dvb.c | 4 +-
drivers/mfd/Kconfig | 2 +
drivers/mfd/arizona-irq.c | 5 +-
drivers/mfd/rohm-bd71828.c | 2 +
drivers/mfd/rohm-bd718x7.c | 2 +
drivers/mfd/wm8994-irq.c | 94 +------------------
drivers/net/dsa/b53/b53_common.c | 17 +---
drivers/net/dsa/b53/b53_priv.h | 24 +++--
drivers/net/wireless/ath/ath10k/leds.c | 3 +-
drivers/nfc/nfcmrvl/main.c | 47 +++-------
drivers/nfc/nfcmrvl/nfcmrvl.h | 5 +-
drivers/nfc/nfcmrvl/uart.c | 5 -
drivers/nfc/nfcmrvl/usb.c | 1 -
drivers/nfc/s3fwrn5/i2c.c | 42 +++------
drivers/nfc/s3fwrn5/phy_common.c | 12 +--
drivers/nfc/s3fwrn5/phy_common.h | 4 +-
drivers/nfc/s3fwrn5/uart.c | 30 ++----
drivers/platform/x86/Kconfig | 3 +
.../platform/x86/x86-android-tablets/Kconfig | 1 +
drivers/usb/gadget/udc/pxa25x_udc.c | 41 +++-----
drivers/usb/gadget/udc/pxa25x_udc.h | 2 +-
drivers/usb/gadget/udc/pxa27x_udc.c | 35 +------
drivers/usb/gadget/udc/pxa27x_udc.h | 2 -
include/linux/gpio_keys.h | 2 +
include/linux/leds.h | 2 +
include/linux/mfd/arizona/pdata.h | 6 ++
include/linux/mfd/wm8994/pdata.h | 5 -
include/linux/platform_data/pxa2xx_udc.h | 15 ---
sound/pci/Kconfig | 1 +
sound/soc/codecs/Kconfig | 4 +
sound/soc/codecs/arizona-jack.c | 17 +++-
sound/soc/pxa/Kconfig | 4 +-
55 files changed, 192 insertions(+), 320 deletions(-)
delete mode 100644 arch/arm/mach-pxa/udc.h
--
2.39.5
Cc: Linus Walleij <linus.walleij@linaro.org> (maintainer:GPIO SUBSYSTEM,commit_signer:1/2=50%)
Cc: Bartosz Golaszewski <brgl@bgdev.pl> (maintainer:GPIO SUBSYSTEM,commit_signer:1/7=14%,commit_signer:1/2=50%)
Cc: linux-gpio@vger.kernel.org (open list:GPIO SUBSYSTEM)
Cc: Andrew Lunn <andrew@lunn.ch> (maintainer:ARM/Marvell Dove/MV78xx0/Orion SOC support)
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> (maintainer:ARM/Marvell Dove/MV78xx0/Orion SOC support)
Cc: Gregory Clement <gregory.clement@bootlin.com> (maintainer:ARM/Marvell Dove/MV78xx0/Orion SOC support)
Cc: Russell King <linux@armlinux.org.uk> (maintainer:ARM PORT)
Cc: Daniel Mack <daniel@zonque.org> (maintainer:PXA2xx/PXA3xx SUPPORT)
Cc: Haojian Zhuang <haojian.zhuang@gmail.com> (maintainer:PXA2xx/PXA3xx SUPPORT)
Cc: Robert Jarzmik <robert.jarzmik@free.fr> (maintainer:PXA2xx/PXA3xx SUPPORT)
Cc: Krzysztof Kozlowski <krzk@kernel.org> (maintainer:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES,commit_signer:1/2=50%)
Cc: Alim Akhtar <alim.akhtar@samsung.com> (reviewer:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES)
Cc: Geert Uytterhoeven <geert@linux-m68k.org> (maintainer:M68K ARCHITECTURE,commit_signer:1/4=25%,authored:1/4=25%,added_lines:2/13=15%,removed_lines:2/6=33%)
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> (maintainer:MIPS)
Cc: Yoshinori Sato <ysato@users.sourceforge.jp> (maintainer:SUPERH)
Cc: Rich Felker <dalias@libc.org> (maintainer:SUPERH)
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> (maintainer:SUPERH,commit_signer:2/4=50%)
Cc: Thomas Gleixner <tglx@linutronix.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),added_lines:4/36=11%,removed_lines:6/49=12%)
Cc: Ingo Molnar <mingo@redhat.com> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT))
Cc: Borislav Petkov <bp@alien8.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT))
Cc: Dave Hansen <dave.hansen@linux.intel.com> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT))
Cc: x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT))
Cc: "H. Peter Anvin" <hpa@zytor.com> (reviewer:X86 ARCHITECTURE (32-BIT AND 64-BIT))
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> (maintainer:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...,commit_signer:5/7=71%,authored:1/7=14%,added_lines:17/36=47%,removed_lines:27/49=55%,commit_signer:1/2=50%,commit_signer:3/5=60%)
Cc: Lee Jones <lee@kernel.org> (maintainer:LED SUBSYSTEM,commit_signer:2/5=40%)
Cc: Pavel Machek <pavel@kernel.org> (maintainer:LED SUBSYSTEM)
Cc: Mauro Carvalho Chehab <mchehab@kernel.org> (maintainer:EM28XX VIDEO4LINUX DRIVER)
Cc: Matti Vaittinen <mazziesaccount@gmail.com> (maintainer:ROHM POWER MANAGEMENT IC DEVICE DRIVERS)
Cc: Florian Fainelli <florian.fainelli@broadcom.com> (maintainer:BROADCOM B53/SF2 ETHERNET SWITCH DRIVER)
Cc: Jeff Johnson <jjohnson@kernel.org> (maintainer:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER)
Cc: Hans de Goede <hansg@kernel.org> (maintainer:X86 PLATFORM DRIVERS,commit_signer:1/7=14%)
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com> (maintainer:X86 PLATFORM DRIVERS)
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (maintainer:USB SUBSYSTEM)
Cc: Jaroslav Kysela <perex@perex.cz> (maintainer:SOUND)
Cc: Takashi Iwai <tiwai@suse.com> (maintainer:SOUND,commit_signer:1/3=33%,authored:1/3=33%,removed_lines:2/2=100%)
Cc: Liam Girdwood <lgirdwood@gmail.com> (maintainer:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...)
Cc: Mark Brown <broonie@kernel.org> (maintainer:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,commit_signer:26/29=90%,commit_signer:1/3=33%)
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> (authored:1/7=14%,added_lines:4/36=11%,removed_lines:6/49=12%,commit_signer:1/2=50%,authored:1/2=50%,added_lines:5/7=71%,removed_lines:7/7=100%,added_lines:7/7=100%,removed_lines:2/7=29%)
Cc: "Dr. David Alan Gilbert" <linux@treblig.org> (commit_signer:1/5=20%,authored:1/5=20%,removed_lines:7/10=70%)
Cc: linux-arm-kernel@lists.infradead.org (moderated list:ARM/Marvell Dove/MV78xx0/Orion SOC support)
Cc: linux-kernel@vger.kernel.org (open list)
Cc: linux-samsung-soc@vger.kernel.org (open list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES)
Cc: linux-m68k@lists.linux-m68k.org (open list:M68K ARCHITECTURE)
Cc: linux-mips@vger.kernel.org (open list:MIPS)
Cc: linux-sh@vger.kernel.org (open list:SUPERH)
Cc: linux-input@vger.kernel.org (open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...)
Cc: linux-leds@vger.kernel.org (open list:LED SUBSYSTEM)
Cc: linux-media@vger.kernel.org (open list:EM28XX VIDEO4LINUX DRIVER)
Cc: patches@opensource.cirrus.com (open list:WOLFSON MICROELECTRONICS DRIVERS)
Cc: netdev@vger.kernel.org (open list:BROADCOM B53/SF2 ETHERNET SWITCH DRIVER)
Cc: linux-wireless@vger.kernel.org (open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER)
Cc: ath10k@lists.infradead.org (open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER)
Cc: platform-driver-x86@vger.kernel.org (open list:X86 PLATFORM DRIVERS)
Cc: linux-usb@vger.kernel.org (open list:USB SUBSYSTEM)
Cc: linux-sound@vger.kernel.org (open list:SOUND)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-08 15:17 [PATCH 00/21] gpiolib: fence off legacy interfaces Arnd Bergmann
@ 2025-08-08 15:17 ` Arnd Bergmann
2025-08-18 15:37 ` Linus Walleij
2025-08-19 12:19 ` Lee Jones
2025-08-11 13:10 ` [PATCH 00/21] gpiolib: fence off legacy interfaces Bartosz Golaszewski
` (2 subsequent siblings)
3 siblings, 2 replies; 12+ messages in thread
From: Arnd Bergmann @ 2025-08-08 15:17 UTC (permalink / raw)
To: Bartosz Golaszewski, Linus Walleij, linux-gpio, Lee Jones,
Pavel Machek
Cc: Arnd Bergmann, Javier Carrasco, Gustavo A. R. Silva,
Andy Shevchenko, Kees Cook, Anish Kumar, Mukesh Ojha,
Thomas Zimmermann, Dmitry Rokosov, linux-leds, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
There are still a handful of ancient mips/armv5/sh boards that use the
gpio_led:gpio member to pass an old-style gpio number, but all modern
users have been converted to gpio descriptors.
Make the code that deals with this optional so the legacy interfaces
can be left out for all normal builds.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/leds/leds-gpio.c | 8 ++++++--
include/linux/leds.h | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index a3428b22de3a..e43accfa78e9 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -212,7 +212,9 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx,
const struct gpio_led *template)
{
struct gpio_desc *gpiod;
+#ifdef CONFIG_GPIOLIB_LEGACY
int ret;
+#endif
/*
* This means the LED does not come from the device tree
@@ -228,6 +230,7 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx,
return gpiod;
}
+#ifdef CONFIG_GPIOLIB_LEGACY
/*
* This is the legacy code path for platform code that
* still uses GPIO numbers. Ultimately we would like to get
@@ -244,6 +247,7 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx,
return ERR_PTR(ret);
gpiod = gpio_to_desc(template->gpio);
+#endif
if (!gpiod)
return ERR_PTR(-EINVAL);
@@ -276,8 +280,8 @@ static int gpio_led_probe(struct platform_device *pdev)
led_dat->gpiod =
gpio_led_get_gpiod(dev, i, template);
if (IS_ERR(led_dat->gpiod)) {
- dev_info(dev, "Skipping unavailable LED gpio %d (%s)\n",
- template->gpio, template->name);
+ dev_info(dev, "Skipping unavailable LED gpio %s\n",
+ template->name);
continue;
}
diff --git a/include/linux/leds.h b/include/linux/leds.h
index b16b803cc1ac..034643f40152 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -676,7 +676,9 @@ typedef int (*gpio_blink_set_t)(struct gpio_desc *desc, int state,
struct gpio_led {
const char *name;
const char *default_trigger;
+#ifdef CONFIG_GPIOLIB_LEGACY
unsigned gpio;
+#endif
unsigned active_low : 1;
unsigned retain_state_suspended : 1;
unsigned panic_indicator : 1;
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 00/21] gpiolib: fence off legacy interfaces
2025-08-08 15:17 [PATCH 00/21] gpiolib: fence off legacy interfaces Arnd Bergmann
2025-08-08 15:17 ` [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional Arnd Bergmann
@ 2025-08-11 13:10 ` Bartosz Golaszewski
2025-08-12 16:23 ` (subset) " Mark Brown
2025-09-02 12:56 ` Lee Jones
3 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2025-08-11 13:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arnd Bergmann, Andrew Lunn, Sebastian Hesselbarth,
Gregory Clement, Russell King, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Krzysztof Kozlowski, Alim Akhtar,
Geert Uytterhoeven, Thomas Bogendoerfer, Yoshinori Sato,
Rich Felker, John Paul Adrian Glaubitz, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Dmitry Torokhov, Lee Jones, Pavel Machek, Mauro Carvalho Chehab,
Matti Vaittinen, Florian Fainelli, Jeff Johnson, Hans de Goede,
Ilpo Järvinen, Greg Kroah-Hartman, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Mark Brown, Andy Shevchenko,
Dr. David Alan Gilbert, linux-arm-kernel, linux-kernel,
linux-samsung-soc, linux-m68k, linux-mips, linux-sh, linux-input,
linux-leds, linux-media, patches, netdev, linux-wireless, ath10k,
platform-driver-x86, linux-usb, linux-sound, Bartosz Golaszewski,
Linus Walleij, linux-gpio
On Fri, 8 Aug 2025 17:17:44 +0200, Arnd Bergmann <arnd@kernel.org> said:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Commit 678bae2eaa81 ("gpiolib: make legacy interfaces optional") was
> merged for linux-6.17, so now it is possible to use the legacy interfaces
> conditionally and eventually have the support left out of the kernel
> whenever it is not needed.
>
> I created six patches to force-enable CONFIG_GPIOLIB_LEGACY on the
> few (mostly ancient) platforms that still require this, plus a set of
> patches to either add the corresponding Kconfig dependencies that make
> the device drivers conditional on that symbol, or change them to no
> longer require it.
>
> The final patch ends up turning the Kconfig symbol off by default,
> which of course depends on everything else getting merged first to avoid
> build errors.
>
> I would suggest that patches 1-20 can just get merged through the
> respective maintainer trees independently when they are deemed ready,
> and the final patch can wait another merge window.
>
Oh, not at all, I'm fine sending a second PR late into the merge window to
get that done in a single cycle.
Thanks for doing this, awesome work!
Bartosz
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: (subset) [PATCH 00/21] gpiolib: fence off legacy interfaces
2025-08-08 15:17 [PATCH 00/21] gpiolib: fence off legacy interfaces Arnd Bergmann
2025-08-08 15:17 ` [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional Arnd Bergmann
2025-08-11 13:10 ` [PATCH 00/21] gpiolib: fence off legacy interfaces Bartosz Golaszewski
@ 2025-08-12 16:23 ` Mark Brown
2025-09-02 12:56 ` Lee Jones
3 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2025-08-12 16:23 UTC (permalink / raw)
To: Bartosz Golaszewski, Linus Walleij, linux-gpio, Arnd Bergmann
Cc: Arnd Bergmann, Andrew Lunn, Sebastian Hesselbarth,
Gregory Clement, Russell King, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Krzysztof Kozlowski, Alim Akhtar,
Geert Uytterhoeven, Thomas Bogendoerfer, Yoshinori Sato,
Rich Felker, John Paul Adrian Glaubitz, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Dmitry Torokhov, Lee Jones, Pavel Machek, Mauro Carvalho Chehab,
Matti Vaittinen, Florian Fainelli, Jeff Johnson, Hans de Goede,
Ilpo Järvinen, Greg Kroah-Hartman, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Andy Shevchenko,
Dr. David Alan Gilbert, linux-arm-kernel, linux-kernel,
linux-samsung-soc, linux-m68k, linux-mips, linux-sh, linux-input,
linux-leds, linux-media, patches, netdev, linux-wireless, ath10k,
platform-driver-x86, linux-usb, linux-sound
On Fri, 08 Aug 2025 17:17:44 +0200, Arnd Bergmann wrote:
> Commit 678bae2eaa81 ("gpiolib: make legacy interfaces optional") was
> merged for linux-6.17, so now it is possible to use the legacy interfaces
> conditionally and eventually have the support left out of the kernel
> whenever it is not needed.
>
> I created six patches to force-enable CONFIG_GPIOLIB_LEGACY on the
> few (mostly ancient) platforms that still require this, plus a set of
> patches to either add the corresponding Kconfig dependencies that make
> the device drivers conditional on that symbol, or change them to no
> longer require it.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[08/21] ASoC: add GPIOLIB_LEGACY dependency where needed
commit: 5383d67e2430822fa7bd20dcbbebbd8ae808e386
[20/21] ASoC: pxa: add GPIOLIB_LEGACY dependency
commit: 2d86d2585ab929a143d1e6f8963da1499e33bf13
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-08 15:17 ` [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional Arnd Bergmann
@ 2025-08-18 15:37 ` Linus Walleij
2025-08-19 12:19 ` Lee Jones
1 sibling, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2025-08-18 15:37 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Bartosz Golaszewski, linux-gpio, Lee Jones, Pavel Machek,
Arnd Bergmann, Javier Carrasco, Gustavo A. R. Silva,
Andy Shevchenko, Kees Cook, Anish Kumar, Mukesh Ojha,
Thomas Zimmermann, Dmitry Rokosov, linux-leds, linux-kernel
On Fri, Aug 8, 2025 at 5:22 PM Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> There are still a handful of ancient mips/armv5/sh boards that use the
> gpio_led:gpio member to pass an old-style gpio number, but all modern
> users have been converted to gpio descriptors.
>
> Make the code that deals with this optional so the legacy interfaces
> can be left out for all normal builds.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
I like this, it cleans up things for current systems so they do not need
to carry around so much legacy.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-08 15:17 ` [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional Arnd Bergmann
2025-08-18 15:37 ` Linus Walleij
@ 2025-08-19 12:19 ` Lee Jones
2025-08-19 12:59 ` Arnd Bergmann
1 sibling, 1 reply; 12+ messages in thread
From: Lee Jones @ 2025-08-19 12:19 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Bartosz Golaszewski, Linus Walleij, linux-gpio, Pavel Machek,
Arnd Bergmann, Javier Carrasco, Gustavo A. R. Silva,
Andy Shevchenko, Kees Cook, Anish Kumar, Mukesh Ojha,
Thomas Zimmermann, Dmitry Rokosov, linux-leds, linux-kernel
On Fri, 08 Aug 2025, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> There are still a handful of ancient mips/armv5/sh boards that use the
> gpio_led:gpio member to pass an old-style gpio number, but all modern
> users have been converted to gpio descriptors.
>
> Make the code that deals with this optional so the legacy interfaces
> can be left out for all normal builds.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/leds/leds-gpio.c | 8 ++++++--
> include/linux/leds.h | 2 ++
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index a3428b22de3a..e43accfa78e9 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -212,7 +212,9 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx,
> const struct gpio_led *template)
> {
> struct gpio_desc *gpiod;
> +#ifdef CONFIG_GPIOLIB_LEGACY
> int ret;
> +#endif
Isn't there another way to do his that doesn't entail sprinkling #ifery
around C-files?
> /*
> * This means the LED does not come from the device tree
> @@ -228,6 +230,7 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx,
> return gpiod;
> }
>
> +#ifdef CONFIG_GPIOLIB_LEGACY
> /*
> * This is the legacy code path for platform code that
> * still uses GPIO numbers. Ultimately we would like to get
> @@ -244,6 +247,7 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx,
> return ERR_PTR(ret);
>
> gpiod = gpio_to_desc(template->gpio);
> +#endif
> if (!gpiod)
> return ERR_PTR(-EINVAL);
>
> @@ -276,8 +280,8 @@ static int gpio_led_probe(struct platform_device *pdev)
> led_dat->gpiod =
> gpio_led_get_gpiod(dev, i, template);
> if (IS_ERR(led_dat->gpiod)) {
> - dev_info(dev, "Skipping unavailable LED gpio %d (%s)\n",
> - template->gpio, template->name);
> + dev_info(dev, "Skipping unavailable LED gpio %s\n",
> + template->name);
> continue;
> }
>
> diff --git a/include/linux/leds.h b/include/linux/leds.h
> index b16b803cc1ac..034643f40152 100644
> --- a/include/linux/leds.h
> +++ b/include/linux/leds.h
> @@ -676,7 +676,9 @@ typedef int (*gpio_blink_set_t)(struct gpio_desc *desc, int state,
> struct gpio_led {
> const char *name;
> const char *default_trigger;
> +#ifdef CONFIG_GPIOLIB_LEGACY
> unsigned gpio;
> +#endif
> unsigned active_low : 1;
> unsigned retain_state_suspended : 1;
> unsigned panic_indicator : 1;
> --
> 2.39.5
>
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-19 12:19 ` Lee Jones
@ 2025-08-19 12:59 ` Arnd Bergmann
2025-08-20 7:16 ` Lee Jones
0 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2025-08-19 12:59 UTC (permalink / raw)
To: Lee Jones, Arnd Bergmann
Cc: Bartosz Golaszewski, Linus Walleij, open list:GPIO SUBSYSTEM,
Pavel Machek, Javier Carrasco, Gustavo A. R. Silva,
Andy Shevchenko, Kees Cook, Anish Kumar, Mukesh Ojha,
Thomas Zimmermann, Dmitry Rokosov, linux-leds, linux-kernel
On Tue, Aug 19, 2025, at 14:19, Lee Jones wrote:
> On Fri, 08 Aug 2025, Arnd Bergmann wrote:
>> {
>> struct gpio_desc *gpiod;
>> +#ifdef CONFIG_GPIOLIB_LEGACY
>> int ret;
>> +#endif
>
> Isn't there another way to do his that doesn't entail sprinkling #ifery
> around C-files?
>
An alternativew would be to duplicate the driver and have
one modern variant and an additional legacy variant that
is only used on the few remaining platforms that select CONFIG_GPIOLIB_LEGACY and define platform data. See below
for the list of files that reference struct gpio_led.
There are already patches to convert some of those to
software nodes, and a lot of the others can probably be
removed, in particular the orion5x ones.
The leds-gpio driver with just the legacy interfaces left
would be a really small driver, and removing those bits from
the normal one would make that a bit simpler as well, but
there would be some amount of duplication.
Arnd
$ git grep -wl struct.gpio_led
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-orion5x/board-d2net.c
arch/arm/mach-orion5x/dns323-setup.c
arch/arm/mach-orion5x/mv2120-setup.c
arch/arm/mach-orion5x/net2big-setup.c
arch/arm/mach-orion5x/ts409-setup.c
arch/arm/mach-s3c/mach-crag6410.c
arch/arm/mach-sa1100/assabet.c
arch/mips/alchemy/board-gpr.c
arch/mips/alchemy/board-mtx1.c
arch/mips/bcm47xx/leds.c
arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
arch/mips/loongson32/ls1b/board.c
arch/mips/txx9/generic/setup.c
arch/mips/txx9/rbtx4927/setup.c
arch/powerpc/platforms/44x/warp.c
arch/sh/boards/mach-rsk/devices-rsk7203.c
drivers/leds/leds-gpio.c
drivers/leds/simatic/simatic-ipc-leds-gpio-core.c
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/leds.c
drivers/platform/x86/barco-p50-gpio.c
drivers/platform/x86/intel/atomisp2/led.c
drivers/platform/x86/meraki-mx100.c
drivers/platform/x86/pcengines-apuv2.c
drivers/platform/x86/sel3350-platform.c
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-19 12:59 ` Arnd Bergmann
@ 2025-08-20 7:16 ` Lee Jones
2025-08-20 12:00 ` Arnd Bergmann
0 siblings, 1 reply; 12+ messages in thread
From: Lee Jones @ 2025-08-20 7:16 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arnd Bergmann, Bartosz Golaszewski, Linus Walleij,
open list:GPIO SUBSYSTEM, Pavel Machek, Javier Carrasco,
Gustavo A. R. Silva, Andy Shevchenko, Kees Cook, Anish Kumar,
Mukesh Ojha, Thomas Zimmermann, Dmitry Rokosov, linux-leds,
linux-kernel
On Tue, 19 Aug 2025, Arnd Bergmann wrote:
> On Tue, Aug 19, 2025, at 14:19, Lee Jones wrote:
> > On Fri, 08 Aug 2025, Arnd Bergmann wrote:
> >> {
> >> struct gpio_desc *gpiod;
> >> +#ifdef CONFIG_GPIOLIB_LEGACY
> >> int ret;
> >> +#endif
> >
> > Isn't there another way to do his that doesn't entail sprinkling #ifery
> > around C-files?
> >
>
> An alternativew would be to duplicate the driver and have
> one modern variant and an additional legacy variant that
> is only used on the few remaining platforms that select CONFIG_GPIOLIB_LEGACY and define platform data. See below
> for the list of files that reference struct gpio_led.
>
> There are already patches to convert some of those to
> software nodes, and a lot of the others can probably be
> removed, in particular the orion5x ones.
>
> The leds-gpio driver with just the legacy interfaces left
> would be a really small driver, and removing those bits from
> the normal one would make that a bit simpler as well, but
> there would be some amount of duplication.
Sounds like we're between a rock and a hard place with this.
Will the legacy parts be removed at some point or do you foresee us
supporting this forever?
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-20 7:16 ` Lee Jones
@ 2025-08-20 12:00 ` Arnd Bergmann
2025-08-20 13:15 ` Andy Shevchenko
0 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2025-08-20 12:00 UTC (permalink / raw)
To: Lee Jones
Cc: Arnd Bergmann, Bartosz Golaszewski, Linus Walleij,
open list:GPIO SUBSYSTEM, Pavel Machek, Javier Carrasco,
Gustavo A. R. Silva, Andy Shevchenko, Kees Cook, Anish Kumar,
Mukesh Ojha, Thomas Zimmermann, Dmitry Rokosov, linux-leds,
linux-kernel
On Wed, Aug 20, 2025, at 09:16, Lee Jones wrote:
> On Tue, 19 Aug 2025, Arnd Bergmann wrote:
>
> Sounds like we're between a rock and a hard place with this.
I don't think either variant is that bad to be honest, as it
gets us a long way towards removing the legacy interface from
default builds without having to update or remove the holdouts
immediately. It's mainly led-gpio and gpio-keys that need
a change like this.
Splitting out the entire gpio_led_platform_data handling
into a single #ifdef function block would be a little cleaner,
but that would in turn require changing over a couple of
files that got converted from legacy gpio numbers to passing
gpio descriptors or lookup tables (ppc44x/warp, x86/sel3350,
arm/omap1), making them use device properties instead.
> Will the legacy parts be removed at some point or do you foresee us
> supporting this forever?
It's hard to predict an timeline here, there is certainly a lot of
interest in minimizing the legacy users as much as possible and
patches are getting written for x86 and arm, but I don't see much
movement on the mips and sh platforms. These are also the ones
that have been holdouts for CONFIG_LEGACY_CLK for years, and I
hope we can eventually drop support for those boards.
That said, I first need to get my own act together and refresh
my patches to drop the old arm board files so we can merge that.
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-20 12:00 ` Arnd Bergmann
@ 2025-08-20 13:15 ` Andy Shevchenko
2025-08-20 13:15 ` Andy Shevchenko
0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2025-08-20 13:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Lee Jones, Arnd Bergmann, Bartosz Golaszewski, Linus Walleij,
open list:GPIO SUBSYSTEM, Pavel Machek, Javier Carrasco,
Gustavo A. R. Silva, Kees Cook, Anish Kumar, Mukesh Ojha,
Thomas Zimmermann, Dmitry Rokosov, linux-leds, linux-kernel
On Wed, Aug 20, 2025 at 02:00:56PM +0200, Arnd Bergmann wrote:
> On Wed, Aug 20, 2025, at 09:16, Lee Jones wrote:
> > On Tue, 19 Aug 2025, Arnd Bergmann wrote:
> >
> > Sounds like we're between a rock and a hard place with this.
>
> I don't think either variant is that bad to be honest, as it
> gets us a long way towards removing the legacy interface from
> default builds without having to update or remove the holdouts
> immediately. It's mainly led-gpio and gpio-keys that need
> a change like this.
And I believe Dmitry is working on gpio-keys this cycle to get rid of legacy
GPIO APIs.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
2025-08-20 13:15 ` Andy Shevchenko
@ 2025-08-20 13:15 ` Andy Shevchenko
0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2025-08-20 13:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Lee Jones, Arnd Bergmann, Bartosz Golaszewski, Linus Walleij,
open list:GPIO SUBSYSTEM, Pavel Machek, Javier Carrasco,
Gustavo A. R. Silva, Kees Cook, Anish Kumar, Mukesh Ojha,
Thomas Zimmermann, Dmitry Rokosov, linux-leds, linux-kernel
On Wed, Aug 20, 2025 at 04:15:05PM +0300, Andy Shevchenko wrote:
> On Wed, Aug 20, 2025 at 02:00:56PM +0200, Arnd Bergmann wrote:
> > On Wed, Aug 20, 2025, at 09:16, Lee Jones wrote:
> > > On Tue, 19 Aug 2025, Arnd Bergmann wrote:
> > >
> > > Sounds like we're between a rock and a hard place with this.
> >
> > I don't think either variant is that bad to be honest, as it
> > gets us a long way towards removing the legacy interface from
> > default builds without having to update or remove the holdouts
> > immediately. It's mainly led-gpio and gpio-keys that need
> > a change like this.
>
> And I believe Dmitry is working on gpio-keys this cycle to get rid of legacy
> GPIO APIs.
I just realize that this might be odd, I meant Dmitry Torokhov in this context.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: (subset) [PATCH 00/21] gpiolib: fence off legacy interfaces
2025-08-08 15:17 [PATCH 00/21] gpiolib: fence off legacy interfaces Arnd Bergmann
` (2 preceding siblings ...)
2025-08-12 16:23 ` (subset) " Mark Brown
@ 2025-09-02 12:56 ` Lee Jones
3 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2025-09-02 12:56 UTC (permalink / raw)
To: Bartosz Golaszewski, Linus Walleij, linux-gpio, Arnd Bergmann
Cc: Arnd Bergmann, Andrew Lunn, Sebastian Hesselbarth,
Gregory Clement, Russell King, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Krzysztof Kozlowski, Alim Akhtar,
Geert Uytterhoeven, Thomas Bogendoerfer, Yoshinori Sato,
Rich Felker, John Paul Adrian Glaubitz, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Dmitry Torokhov, Lee Jones, Pavel Machek, Mauro Carvalho Chehab,
Matti Vaittinen, Florian Fainelli, Jeff Johnson, Hans de Goede,
Ilpo Järvinen, Greg Kroah-Hartman, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Mark Brown, Andy Shevchenko,
Dr. David Alan Gilbert, linux-arm-kernel, linux-kernel,
linux-samsung-soc, linux-m68k, linux-mips, linux-sh, linux-input,
linux-leds, linux-media, patches, netdev, linux-wireless, ath10k,
platform-driver-x86, linux-usb, linux-sound
On Fri, 08 Aug 2025 17:17:44 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Commit 678bae2eaa81 ("gpiolib: make legacy interfaces optional") was
> merged for linux-6.17, so now it is possible to use the legacy interfaces
> conditionally and eventually have the support left out of the kernel
> whenever it is not needed.
>
> [...]
Applied, thanks!
[12/21] mfd: arizona: make legacy gpiolib interface optional
commit: 12f6c0afc8987d72017a3ecf7c1183cb951b0d24
[13/21] mfd: si476x: add GPIOLIB_LEGACY dependency
commit: 1ae250257e43b3fba225e4f8ea7d87125dc861ae
[14/21] mfd: aat2870: add GPIOLIB_LEGACY dependency
commit: 3144986f37911f131f373743f294b2941a8ef37c
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-09-02 12:56 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08 15:17 [PATCH 00/21] gpiolib: fence off legacy interfaces Arnd Bergmann
2025-08-08 15:17 ` [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional Arnd Bergmann
2025-08-18 15:37 ` Linus Walleij
2025-08-19 12:19 ` Lee Jones
2025-08-19 12:59 ` Arnd Bergmann
2025-08-20 7:16 ` Lee Jones
2025-08-20 12:00 ` Arnd Bergmann
2025-08-20 13:15 ` Andy Shevchenko
2025-08-20 13:15 ` Andy Shevchenko
2025-08-11 13:10 ` [PATCH 00/21] gpiolib: fence off legacy interfaces Bartosz Golaszewski
2025-08-12 16:23 ` (subset) " Mark Brown
2025-09-02 12:56 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).