gpio: vf610: allow disabling the vf610 driver

Message ID 20240111150429.681567-1-martin@kaiser.cx
State New
Headers
Series gpio: vf610: allow disabling the vf610 driver |

Commit Message

Martin Kaiser Jan. 11, 2024, 3:04 p.m. UTC
  The vf610 gpio driver is enabled by default for all i.MX machines,
without any option to disable it in a board-specific config file.

Most i.MX chipsets have no hardware for this driver. Change the default
to enable GPIO_VF610 for SOC_VF610 and disable it otherwise.

Add a text description after the bool type, this makes the driver
selectable by make config etc. i.MX chips other than SOC_VF610 can now
enable the driver from their board config.

Fixes: 30a35c07d9e9 ("gpio: vf610: drop the SOC_VF610 dependency for GPIO_VF610")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/gpio/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Linus Walleij Jan. 11, 2024, 7:46 p.m. UTC | #1
On Thu, Jan 11, 2024 at 4:05 PM Martin Kaiser <martin@kaiser.cx> wrote:

> The vf610 gpio driver is enabled by default for all i.MX machines,
> without any option to disable it in a board-specific config file.
>
> Most i.MX chipsets have no hardware for this driver. Change the default
> to enable GPIO_VF610 for SOC_VF610 and disable it otherwise.
>
> Add a text description after the bool type, this makes the driver
> selectable by make config etc. i.MX chips other than SOC_VF610 can now
> enable the driver from their board config.
>
> Fixes: 30a35c07d9e9 ("gpio: vf610: drop the SOC_VF610 dependency for GPIO_VF610")
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
  
Peng Fan Jan. 12, 2024, 12:44 a.m. UTC | #2
Thanks Linus for Ccing me.

> Subject: [PATCH] gpio: vf610: allow disabling the vf610 driver
> 
> The vf610 gpio driver is enabled by default for all i.MX machines, without any
> option to disable it in a board-specific config file.
> 
> Most i.MX chipsets have no hardware for this driver. Change the default to
> enable GPIO_VF610 for SOC_VF610 and disable it otherwise.
> 
> Add a text description after the bool type, this makes the driver selectable by
> make config etc. i.MX chips other than SOC_VF610 can now enable the driver
> from their board config.

This will break i.MX8QM,DXL,ULP/i.MX93 boot. You could add text description
to make it selectable, but please not drop def y. Or you need update defconfig.

Thanks,
Peng.

> 
> Fixes: 30a35c07d9e9 ("gpio: vf610: drop the SOC_VF610 dependency for
> GPIO_VF610")
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/gpio/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index
> 1301cec94f12..353af1a4d0ac 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -711,7 +711,8 @@ config GPIO_UNIPHIER
>  	  Say yes here to support UniPhier GPIOs.
> 
>  config GPIO_VF610
> -	def_bool y
> +	bool "VF610 GPIO support"
> +	default y if SOC_VF610
>  	depends on ARCH_MXC
>  	select GPIOLIB_IRQCHIP
>  	help
> --
> 2.39.2
  
Martin Kaiser Jan. 15, 2024, 9:52 a.m. UTC | #3
Hi Peng,

Thus wrote Peng Fan (peng.fan@nxp.com):

> Thanks Linus for Ccing me.

I did already Cc you on the initial patch. My hope was to get feedback about
unwanted side effects.

> > Subject: [PATCH] gpio: vf610: allow disabling the vf610 driver

> > The vf610 gpio driver is enabled by default for all i.MX machines, without any
> > option to disable it in a board-specific config file.

> > Most i.MX chipsets have no hardware for this driver. Change the default to
> > enable GPIO_VF610 for SOC_VF610 and disable it otherwise.

> > Add a text description after the bool type, this makes the driver selectable by
> > make config etc. i.MX chips other than SOC_VF610 can now enable the driver
> > from their board config.

> This will break i.MX8QM,DXL,ULP/i.MX93 boot. You could add text description
> to make it selectable, but please not drop def y. Or you need update defconfig.

Thanks for bringing this up.

It seems to me that other gpio drivers are disabled by default and enabled
where needed. I suggest adding CONFIG_GPIO_VF610=y to
arch/arm64/configs/defconfig and probably also to
arch/arm/configs/imx_v6_v7_defconfig.

I'll send a v2 with these changes unless you (or someone else) disagree.

Thanks,
Martin
  

Patch

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 1301cec94f12..353af1a4d0ac 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -711,7 +711,8 @@  config GPIO_UNIPHIER
 	  Say yes here to support UniPhier GPIOs.
 
 config GPIO_VF610
-	def_bool y
+	bool "VF610 GPIO support"
+	default y if SOC_VF610
 	depends on ARCH_MXC
 	select GPIOLIB_IRQCHIP
 	help