Skip to contentSkip to conversation

platform/x86: pcengines-apu2 needs gpiolib

PATCH In review Arnd Bergmann 3 participants 4 messages Jul 12, 2019 – Jul 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: pcengines-apu2 needs gpiolib

I ran into another build issue in randconfig testing for this driver, when CONFIG_GPIOLIB is not set:

WARNING: unmet direct dependencies detected for GPIO_AMD_FCH
Depends on [n]: GPIOLIB [=n] && HAS_IOMEM [=y]
Selected by [y]:
- PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]

WARNING: unmet direct dependencies detected for KEYBOARD_GPIO_POLLED
Depends on [n]: !UML && INPUT [=y] && INPUT_KEYBOARD [=y] && GPIOLIB [=n]
Selected by [y]:
- PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]

Make the 'select' statements conditional on that so we don't have to introduce another 'select'.

Fixes f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
Fixes a422bf11bdb4 ("platform/x86: fix PCENGINES_APU2 Kconfig warning")
---
 drivers/platform/x86/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/Kconfig +2 -2
index e869a5c760b6..cf48b9068843 100644
@@ -1324,8 +1324,8 @@ config PCENGINES_APU2
 	tristate "PC Engines APUv2/3 front button and LEDs driver"
 	depends on INPUT && INPUT_KEYBOARD
 	depends on LEDS_CLASS
-	select GPIO_AMD_FCH
-	select KEYBOARD_GPIO_POLLED
+	select GPIO_AMD_FCH if GPIOLIB
+	select KEYBOARD_GPIO_POLLED if GPIOLIB
 	select LEDS_GPIO
 	help
 	  This driver provides support for the front button and LEDs on
Signature · 1 line
2.20.0
#1 lore raw

On 12.07.19 10:54, Arnd Bergmann wrote:

Hi,

Quoted 5 lines
drivers/platform/x86/Kconfig +0 -0
index e869a5c760b6..cf48b9068843 100644

drivers/platform/x86/Kconfig config PCENGINES_APU2 · line 1331

Quoted 10 lines
drivers/platform/x86/Kconfig +2 -2
@@ -1324,8 +1324,8 @@ config PCENGINES_APU2
 	tristate "PC Engines APUv2/3 front button and LEDs driver"
 	depends on INPUT && INPUT_KEYBOARD
 	depends on LEDS_CLASS
-	select GPIO_AMD_FCH
-	select KEYBOARD_GPIO_POLLED
+	select GPIO_AMD_FCH if GPIOLIB
+	select KEYBOARD_GPIO_POLLED if GPIOLIB
 	select LEDS_GPIO
 	help
 	  This driver provides support for the front button and LEDs on

That might compile but the driver won't work, if KEYBOARD_GPIO_POLLED or GPIO_AMD_FCH isn't there.

--mtx

Signature · 3 lines
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
[email protected] -- +49-151-27565287
#2 lore raw
Quoted 11 lines · metux IT consult
Quoted 10 lines · Arnd Bergmann
drivers/platform/x86/Kconfig +0 -2
index e869a5c760b6..cf48b9068843 100644
@@ -1324,8 +1324,8 @@ config PCENGINES_APU2
      tristate "PC Engines APUv2/3 front button and LEDs driver"
      depends on INPUT && INPUT_KEYBOARD
      depends on LEDS_CLASS
-     select GPIO_AMD_FCH
-     select KEYBOARD_GPIO_POLLED
Quoted 8 lines

drivers/platform/x86/Kconfig config PCENGINES_APU2 · line 1331

Quoted 5 lines
drivers/platform/x86/Kconfig +2 -0
+     select GPIO_AMD_FCH if GPIOLIB
+     select KEYBOARD_GPIO_POLLED if GPIOLIB
      select LEDS_GPIO
      help
        This driver provides support for the front button and LEDs on

That might compile but the driver won't work, if KEYBOARD_GPIO_POLLED or GPIO_AMD_FCH isn't there.

Right, I agree it's a bit inconsistent. A better way would probably be to turn all of the 'select' statements into 'depends on' here, or possibly just remove them and document in the help text what others are required.

Generally using 'select' in order to save users from thinking causes more problems than it helps, as the build problems in this driver have already illustrated.

Arnd

#3 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

I ran into another build issue in randconfig testing for this driver, when CONFIG_GPIOLIB is not set:

WARNING: unmet direct dependencies detected for GPIO_AMD_FCH
Depends on [n]: GPIOLIB [=n] && HAS_IOMEM [=y]
Selected by [y]:
- PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]

Quoted 8 lines

WARNING: unmet direct dependencies detected for KEYBOARD_GPIO_POLLED
Depends on [n]: !UML && INPUT [=y] && INPUT_KEYBOARD [=y] && GPIOLIB [=n]
Selected by [y]:
- PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]

Make the 'select' statements conditional on that so we don't have to introduce another 'select'.

Thanks, I have applied the fix from YueHaibing, the idea is to depened on GPIOLIB.

Quoted 25 lines
Fixes f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
Fixes a422bf11bdb4 ("platform/x86: fix PCENGINES_APU2 Kconfig warning")
---
 drivers/platform/x86/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/Kconfig +2 -3
index e869a5c760b6..cf48b9068843 100644
@@ -1324,8 +1324,8 @@ config PCENGINES_APU2
        tristate "PC Engines APUv2/3 front button and LEDs driver"
        depends on INPUT && INPUT_KEYBOARD
        depends on LEDS_CLASS
-       select GPIO_AMD_FCH
-       select KEYBOARD_GPIO_POLLED
+       select GPIO_AMD_FCH if GPIOLIB
+       select KEYBOARD_GPIO_POLLED if GPIOLIB
        select LEDS_GPIO
        help
          This driver provides support for the front button and LEDs on
--

2.20.0

Signature · 2 lines
With Best Regards,
Andy Shevchenko