[PATCH 21/21] gpiolib: turn off legacy interface by default

Arnd Bergmann posted 21 patches 1 month, 3 weeks ago
[PATCH 21/21] gpiolib: turn off legacy interface by default
Posted by Arnd Bergmann 1 month, 3 weeks ago
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.

Allow turning it on manually for compile testing, in order to keep
the build coverage of the legacy drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpio/Kconfig | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index e43abb322fa6..2b57ba776c13 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -12,10 +12,17 @@ menuconfig GPIOLIB
 
 	  If unsure, say N.
 
+if GPIOLIB
+
 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 GPIOLIB
+	  If unsure, say N.
 
 config GPIOLIB_FASTPATH_LIMIT
 	int "Maximum number of GPIOs for fast path"
-- 
2.39.5
Re: [PATCH 21/21] gpiolib: turn off legacy interface by default
Posted by Andy Shevchenko 1 month, 3 weeks ago
On Fri, Aug 08, 2025 at 05:18:06PM +0200, Arnd Bergmann wrote:

> All users of the legacy interface now select CONFIG_GPIOLIB_LEGACY,
> so it can be turned off by default.
> 
> Allow turning it on manually for compile testing, in order to keep
> the build coverage of the legacy drivers.

...

>  config GPIOLIB_LEGACY
> -	def_bool y
> +	bool "Legacy GPIO interfaces" if COMPILE_TEST

Maybe I'm missing something, but how does it supposed to be compiled for old
platforms? (No, COMPILE_TEST is not a correct option for that)
Perhaps you meant EXPERT ?

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH 21/21] gpiolib: turn off legacy interface by default
Posted by Arnd Bergmann 1 month, 3 weeks ago
On Sat, Aug 9, 2025, at 12:18, Andy Shevchenko wrote:
> On Fri, Aug 08, 2025 at 05:18:06PM +0200, Arnd Bergmann wrote:
>
>> All users of the legacy interface now select CONFIG_GPIOLIB_LEGACY,
>> so it can be turned off by default.
>> 
>> Allow turning it on manually for compile testing, in order to keep
>> the build coverage of the legacy drivers.
>
>>  config GPIOLIB_LEGACY
>> -	def_bool y
>> +	bool "Legacy GPIO interfaces" if COMPILE_TEST
>
> Maybe I'm missing something, but how does it supposed to be compiled for old
> platforms? (No, COMPILE_TEST is not a correct option for that)
> Perhaps you meant EXPERT ?

The COMPILE_TEST is really just meant for enabling some drivers
that would otherwise be skipped in allmodconfig builds.

All the old platforms that use one of the GPIOLIB_LEGACY drivers
select that symbol once the first six patches are merged.

    Arnd
Re: [PATCH 21/21] gpiolib: turn off legacy interface by default
Posted by Andy Shevchenko 1 month, 3 weeks ago
On Sat, Aug 09, 2025 at 09:47:31PM +0200, Arnd Bergmann wrote:
> On Sat, Aug 9, 2025, at 12:18, Andy Shevchenko wrote:
> > On Fri, Aug 08, 2025 at 05:18:06PM +0200, Arnd Bergmann wrote:
> >
> >> All users of the legacy interface now select CONFIG_GPIOLIB_LEGACY,
> >> so it can be turned off by default.
> >> 
> >> Allow turning it on manually for compile testing, in order to keep
> >> the build coverage of the legacy drivers.
> >
> >>  config GPIOLIB_LEGACY
> >> -	def_bool y
> >> +	bool "Legacy GPIO interfaces" if COMPILE_TEST
> >
> > Maybe I'm missing something, but how does it supposed to be compiled for old
> > platforms? (No, COMPILE_TEST is not a correct option for that)
> > Perhaps you meant EXPERT ?
> 
> The COMPILE_TEST is really just meant for enabling some drivers
> that would otherwise be skipped in allmodconfig builds.
> 
> All the old platforms that use one of the GPIOLIB_LEGACY drivers
> select that symbol once the first six patches are merged.

Ah, that makes sense. Perhaps a word to be added into commit message?

-- 
With Best Regards,
Andy Shevchenko