diff mbox

[v2,3/5] gpio: Change ISA_BUS_API dependency to selection

Message ID 1534276cb63d1e9e6dd139b4edceedbe728f65f5.1514578085.git.vilhelm.gray@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

William Breathitt Gray Dec. 29, 2017, 8:13 p.m. UTC
The ISA_BUS_API Kconfig option enables the compilation of the ISA bus
driver. The ISA bus driver does not perform any hardware interaction,
and is instead just a thin layer of software abstraction to eliminate
boilerplate code common to ISA-style device drivers. Since ISA_BUS_API
has no dependencies and does not jeopardize the integrity of the system
when enabled, drivers should select it when the ISA bus driver
functionality is needed.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
 drivers/gpio/Kconfig | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comments

Linus Walleij Feb. 22, 2018, 3:16 p.m. UTC | #1
On Fri, Dec 29, 2017 at 9:13 PM, William Breathitt Gray
<vilhelm.gray@gmail.com> wrote:

> The ISA_BUS_API Kconfig option enables the compilation of the ISA bus
> driver. The ISA bus driver does not perform any hardware interaction,
> and is instead just a thin layer of software abstraction to eliminate
> boilerplate code common to ISA-style device drivers. Since ISA_BUS_API
> has no dependencies and does not jeopardize the integrity of the system
> when enabled, drivers should select it when the ISA bus driver
> functionality is needed.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>

Patch applied to the GPIO tree for v4.17.

Can you confirm that we don't have any dangling ISA
drivers not using this?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
William Breathitt Gray Feb. 22, 2018, 8:30 p.m. UTC | #2
On Thu, Feb 22, 2018 at 04:16:17PM +0100, Linus Walleij wrote:
>On Fri, Dec 29, 2017 at 9:13 PM, William Breathitt Gray
><vilhelm.gray@gmail.com> wrote:
>
>> The ISA_BUS_API Kconfig option enables the compilation of the ISA bus
>> driver. The ISA bus driver does not perform any hardware interaction,
>> and is instead just a thin layer of software abstraction to eliminate
>> boilerplate code common to ISA-style device drivers. Since ISA_BUS_API
>> has no dependencies and does not jeopardize the integrity of the system
>> when enabled, drivers should select it when the ISA bus driver
>> functionality is needed.
>>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
>
>Patch applied to the GPIO tree for v4.17.
>
>Can you confirm that we don't have any dangling ISA
>drivers not using this?
>
>Yours,
>Linus Walleij

Hi Linus,

This patchset should cover all current mainline drivers depending on
ISA_BUS_API.

However, there are existing drivers for ISA compatible devices that
would benefit from utilizing struct isa_driver rather than struct
platform_driver as was done for the Winbond GPIO driver; for example,
a number of the drivers under the "Port-mapped I/O GPIO drivers" menu
are also for Super I/O devices and may benefit from using struct
isa_driver. I thought it best to let the respective maintainers of those
drivers make the changes if they so desire, since the primary benefit of
struct isa_driver over struct platform_driver is code clarity in my
opinion.

I may submit patches myself for some of the low-hanging fruit later this
year if I find the time. Right now implementing the counter subsystem
has been my priority, but perhaps some downtime will be available soon
enough for me to add ISA driver improvements to my plate -- we'll just
have to see how it all goes. :)

William Breathitt Gray
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Maciej S. Szmigiero Feb. 22, 2018, 8:44 p.m. UTC | #3
Hi William,
Hi Linus,

On 22.02.2018 21:30, William Breathitt Gray wrote:
> On Thu, Feb 22, 2018 at 04:16:17PM +0100, Linus Walleij wrote:
>> On Fri, Dec 29, 2017 at 9:13 PM, William Breathitt Gray
>> <vilhelm.gray@gmail.com> wrote:
>>
>>> The ISA_BUS_API Kconfig option enables the compilation of the ISA bus
>>> driver. The ISA bus driver does not perform any hardware interaction,
>>> and is instead just a thin layer of software abstraction to eliminate
>>> boilerplate code common to ISA-style device drivers. Since ISA_BUS_API
>>> has no dependencies and does not jeopardize the integrity of the system
>>> when enabled, drivers should select it when the ISA bus driver
>>> functionality is needed.
>>>
>>> Cc: Linus Walleij <linus.walleij@linaro.org>
>>> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
>>
>> Patch applied to the GPIO tree for v4.17.
>>
>> Can you confirm that we don't have any dangling ISA
>> drivers not using this?
>>
>> Yours,
>> Linus Walleij
> 
> Hi Linus,
> 
> This patchset should cover all current mainline drivers depending on
> ISA_BUS_API.
> 

Thanks for merging this series!

Note that gpio-winbond (CONFIG_GPIO_WINBOND) driver was originally
merged using ISA_BUS_API selection as done for other ISA bus gpio drivers
by this patch, then temporary switched to the previous ("depends on")
style by commit 92a8046c9d952a to fix a circular Kconfig dependency.
So now this commit (92...) should be reverted to make gpio-winbond
driver Kconfig dependency / selection consistent with the remaining ISA
bus gpio drivers.

Unfortunately, I can't test the reversion myself because it looks like
Linus didn't push his trees yet to git.kernel.org after applying this
series (or I am not looking at the right place - linusw/linux-gpio.git?).

Best regards,
Maciej
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Maciej S. Szmigiero Feb. 23, 2018, 1:50 p.m. UTC | #4
On 22.02.2018 21:44, Maciej S. Szmigiero wrote:
> Hi William,
> Hi Linus,
> 
> On 22.02.2018 21:30, William Breathitt Gray wrote:
>> On Thu, Feb 22, 2018 at 04:16:17PM +0100, Linus Walleij wrote:
>>> On Fri, Dec 29, 2017 at 9:13 PM, William Breathitt Gray
>>> <vilhelm.gray@gmail.com> wrote:
>>>
>>>> The ISA_BUS_API Kconfig option enables the compilation of the ISA bus
>>>> driver. The ISA bus driver does not perform any hardware interaction,
>>>> and is instead just a thin layer of software abstraction to eliminate
>>>> boilerplate code common to ISA-style device drivers. Since ISA_BUS_API
>>>> has no dependencies and does not jeopardize the integrity of the system
>>>> when enabled, drivers should select it when the ISA bus driver
>>>> functionality is needed.
>>>>
>>>> Cc: Linus Walleij <linus.walleij@linaro.org>
>>>> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
>>>
>>> Patch applied to the GPIO tree for v4.17.
>>>
>>> Can you confirm that we don't have any dangling ISA
>>> drivers not using this?
>>>
>>> Yours,
>>> Linus Walleij
>>
>> Hi Linus,
>>
>> This patchset should cover all current mainline drivers depending on
>> ISA_BUS_API.
>>
> 
> Thanks for merging this series!
> 
> Note that gpio-winbond (CONFIG_GPIO_WINBOND) driver was originally
> merged using ISA_BUS_API selection as done for other ISA bus gpio drivers
> by this patch, then temporary switched to the previous ("depends on")
> style by commit 92a8046c9d952a to fix a circular Kconfig dependency.
> So now this commit (92...) should be reverted to make gpio-winbond
> driver Kconfig dependency / selection consistent with the remaining ISA
> bus gpio drivers.
> 
> Unfortunately, I can't test the reversion myself because it looks like
> Linus didn't push his trees yet to git.kernel.org after applying this
> series (or I am not looking at the right place - linusw/linux-gpio.git?).

It looks like the series has been pushed to git.kernel.org now.
I have tested the reversion of commit 92a8046c9d952a and can confirm
that the ISA_BUS_API dependency / selection for gpio-winbond works
then as intended (in a way that is consistent with other ISA bus gpio
drivers).

@Linus:
Will you revert that commit or should I submit a patch that does it?

Maciej
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Feb. 23, 2018, 2:09 p.m. UTC | #5
On Fri, Feb 23, 2018 at 2:50 PM, Maciej S. Szmigiero
<mail@maciej.szmigiero.name> wrote:
> On 22.02.2018 21:44, Maciej S. Szmigiero wrote:

>> Note that gpio-winbond (CONFIG_GPIO_WINBOND) driver was originally
>> merged using ISA_BUS_API selection as done for other ISA bus gpio drivers
>> by this patch, then temporary switched to the previous ("depends on")
>> style by commit 92a8046c9d952a to fix a circular Kconfig dependency.
>> So now this commit (92...) should be reverted to make gpio-winbond
>> driver Kconfig dependency / selection consistent with the remaining ISA
>> bus gpio drivers.
>>
>> Unfortunately, I can't test the reversion myself because it looks like
>> Linus didn't push his trees yet to git.kernel.org after applying this
>> series (or I am not looking at the right place - linusw/linux-gpio.git?).
>
> It looks like the series has been pushed to git.kernel.org now.
> I have tested the reversion of commit 92a8046c9d952a and can confirm
> that the ISA_BUS_API dependency / selection for gpio-winbond works
> then as intended (in a way that is consistent with other ISA bus gpio
> drivers).
>
> @Linus:
> Will you revert that commit or should I submit a patch that does it?

Oh send me a patch, that's easiest.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 395669bfcc26..36ad9ce3dc58 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -590,7 +590,8 @@  menu "Port-mapped I/O GPIO drivers"
 
 config GPIO_104_DIO_48E
 	tristate "ACCES 104-DIO-48E GPIO support"
-	depends on PC104 && ISA_BUS_API
+	depends on PC104
+	select ISA_BUS_API
 	select GPIOLIB_IRQCHIP
 	help
 	  Enables GPIO support for the ACCES 104-DIO-48E series (104-DIO-48E,
@@ -600,7 +601,8 @@  config GPIO_104_DIO_48E
 
 config GPIO_104_IDIO_16
 	tristate "ACCES 104-IDIO-16 GPIO support"
-	depends on PC104 && ISA_BUS_API
+	depends on PC104
+	select ISA_BUS_API
 	select GPIOLIB_IRQCHIP
 	help
 	  Enables GPIO support for the ACCES 104-IDIO-16 family (104-IDIO-16,
@@ -611,7 +613,8 @@  config GPIO_104_IDIO_16
 
 config GPIO_104_IDI_48
 	tristate "ACCES 104-IDI-48 GPIO support"
-	depends on PC104 && ISA_BUS_API
+	depends on PC104
+	select ISA_BUS_API
 	select GPIOLIB_IRQCHIP
 	help
 	  Enables GPIO support for the ACCES 104-IDI-48 family (104-IDI-48A,
@@ -631,7 +634,8 @@  config GPIO_F7188X
 
 config GPIO_GPIO_MM
 	tristate "Diamond Systems GPIO-MM GPIO support"
-	depends on PC104 && ISA_BUS_API
+	depends on PC104
+	select ISA_BUS_API
 	help
 	  Enables GPIO support for the Diamond Systems GPIO-MM and GPIO-MM-12.
 
@@ -700,7 +704,7 @@  config GPIO_TS5500
 
 config GPIO_WS16C48
 	tristate "WinSystems WS16C48 GPIO support"
-	depends on ISA_BUS_API
+	select ISA_BUS_API
 	select GPIOLIB_IRQCHIP
 	help
 	  Enables GPIO support for the WinSystems WS16C48. The base port