linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hid: intel-thc: fix CONFIG_HID dependency
@ 2025-01-23 13:48 Arnd Bergmann
  2025-01-24 12:20 ` Ilpo Järvinen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Arnd Bergmann @ 2025-01-23 13:48 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, Srinivas Pandruvada,
	Mark Pearson
  Cc: Arnd Bergmann, Basavaraj Natikar, Even Xu, Xinpeng Sun,
	Maximilian Luz, Marcel Holtmann, Johan Hedberg,
	Luiz Augusto von Dentz, Dmitry Torokhov, linux-input,
	linux-kernel, platform-driver-x86, linux-usb, linux-bluetooth

From: Arnd Bergmann <arnd@arndb.de>

In drivers/hid/, most drivers depend on CONFIG_HID, while a couple of the
drivers in subdirectories instead depend on CONFIG_HID_SUPPORT and use
'select HID'. With the newly added INTEL_THC_HID, this causes a build
warning for a circular dependency:

WARNING: unmet direct dependencies detected for HID
  Depends on [m]: HID_SUPPORT [=y] && INPUT [=m]
  Selected by [y]:
  - INTEL_THC_HID [=y] && HID_SUPPORT [=y] && X86_64 [=y] && PCI [=y] && ACPI [=y]

WARNING: unmet direct dependencies detected for INPUT_FF_MEMLESS
  Depends on [m]: INPUT [=m]
  Selected by [y]:
  - HID_MICROSOFT [=y] && HID_SUPPORT [=y] && HID [=y]
  - GREENASIA_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_GREENASIA [=y]
  - HID_WIIMOTE [=y] && HID_SUPPORT [=y] && HID [=y] && LEDS_CLASS [=y]
  - ZEROPLUS_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ZEROPLUS [=y]
  Selected by [m]:
  - HID_ACRUX_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ACRUX [=m]
  - HID_EMS_FF [=m] && HID_SUPPORT [=y] && HID [=y]
  - HID_GOOGLE_STADIA_FF [=m] && HID_SUPPORT [=y] && HID [=y]
  - PANTHERLORD_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_PANTHERLORD [=m]

It's better to be consistent and always use 'depends on HID' for HID
drivers. The notable exception here is USB_KBD/USB_MOUSE, which are
alternative implementations that do not depend on the HID subsystem.

Do this by extending the "if HID" section below, which means that a few
of the duplicate "depends on HID" and "depends on INPUT" statements
can be removed in the process.

Fixes: 1b2d05384c29 ("HID: intel-thc-hid: Add basic THC driver skeleton")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/hid/Kconfig               | 10 ++++++----
 drivers/hid/amd-sfh-hid/Kconfig   |  1 -
 drivers/hid/i2c-hid/Kconfig       |  2 +-
 drivers/hid/intel-ish-hid/Kconfig |  1 -
 drivers/hid/intel-thc-hid/Kconfig |  1 -
 drivers/hid/surface-hid/Kconfig   |  2 --
 drivers/hid/usbhid/Kconfig        |  3 +--
 net/bluetooth/hidp/Kconfig        |  3 +--
 8 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 8adb745c5b28..ed657ef7281c 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -1376,10 +1376,6 @@ endmenu
 
 source "drivers/hid/bpf/Kconfig"
 
-endif # HID
-
-source "drivers/hid/usbhid/Kconfig"
-
 source "drivers/hid/i2c-hid/Kconfig"
 
 source "drivers/hid/intel-ish-hid/Kconfig"
@@ -1390,4 +1386,10 @@ source "drivers/hid/surface-hid/Kconfig"
 
 source "drivers/hid/intel-thc-hid/Kconfig"
 
+endif # HID
+
+# USB support may be used with HID disabled
+
+source "drivers/hid/usbhid/Kconfig"
+
 endif # HID_SUPPORT
diff --git a/drivers/hid/amd-sfh-hid/Kconfig b/drivers/hid/amd-sfh-hid/Kconfig
index 329de5e12c1a..3291786a5ee6 100644
--- a/drivers/hid/amd-sfh-hid/Kconfig
+++ b/drivers/hid/amd-sfh-hid/Kconfig
@@ -5,7 +5,6 @@ menu "AMD SFH HID Support"
 
 config AMD_SFH_HID
 	tristate "AMD Sensor Fusion Hub"
-	depends on HID
 	depends on X86
 	help
 	  If you say yes to this option, support will be included for the
diff --git a/drivers/hid/i2c-hid/Kconfig b/drivers/hid/i2c-hid/Kconfig
index ef7c595c9403..e8d51f410cc1 100644
--- a/drivers/hid/i2c-hid/Kconfig
+++ b/drivers/hid/i2c-hid/Kconfig
@@ -2,7 +2,7 @@
 menuconfig I2C_HID
 	tristate "I2C HID support"
 	default y
-	depends on I2C && INPUT && HID
+	depends on I2C
 
 if I2C_HID
 
diff --git a/drivers/hid/intel-ish-hid/Kconfig b/drivers/hid/intel-ish-hid/Kconfig
index 253dc10d35ef..568c8688784e 100644
--- a/drivers/hid/intel-ish-hid/Kconfig
+++ b/drivers/hid/intel-ish-hid/Kconfig
@@ -6,7 +6,6 @@ config INTEL_ISH_HID
 	tristate "Intel Integrated Sensor Hub"
 	default n
 	depends on X86
-	depends on HID
 	help
 	  The Integrated Sensor Hub (ISH) enables the ability to offload
 	  sensor polling and algorithm processing to a dedicated low power
diff --git a/drivers/hid/intel-thc-hid/Kconfig b/drivers/hid/intel-thc-hid/Kconfig
index 91ec84902db8..0351d1137607 100644
--- a/drivers/hid/intel-thc-hid/Kconfig
+++ b/drivers/hid/intel-thc-hid/Kconfig
@@ -7,7 +7,6 @@ menu "Intel THC HID Support"
 config INTEL_THC_HID
 	tristate "Intel Touch Host Controller"
 	depends on ACPI
-	select HID
 	help
 	  THC (Touch Host Controller) is the name of the IP block in PCH that
 	  interfaces with Touch Devices (ex: touchscreen, touchpad etc.). It
diff --git a/drivers/hid/surface-hid/Kconfig b/drivers/hid/surface-hid/Kconfig
index 7ce9b5d641eb..d0cfd0d29926 100644
--- a/drivers/hid/surface-hid/Kconfig
+++ b/drivers/hid/surface-hid/Kconfig
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 menu "Surface System Aggregator Module HID support"
 	depends on SURFACE_AGGREGATOR
-	depends on INPUT
 
 config SURFACE_HID
 	tristate "HID transport driver for Surface System Aggregator Module"
@@ -39,4 +38,3 @@ endmenu
 
 config SURFACE_HID_CORE
 	tristate
-	select HID
diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig
index 7c2032f7f44d..f3194767a45e 100644
--- a/drivers/hid/usbhid/Kconfig
+++ b/drivers/hid/usbhid/Kconfig
@@ -5,8 +5,7 @@ menu "USB HID support"
 config USB_HID
 	tristate "USB HID transport layer"
 	default y
-	depends on USB && INPUT
-	select HID
+	depends on HID
 	help
 	  Say Y here if you want to connect USB keyboards,
 	  mice, joysticks, graphic tablets, or any other HID based devices
diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig
index 6746be07e222..e08aae35351a 100644
--- a/net/bluetooth/hidp/Kconfig
+++ b/net/bluetooth/hidp/Kconfig
@@ -1,8 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config BT_HIDP
 	tristate "HIDP protocol support"
-	depends on BT_BREDR && INPUT && HID_SUPPORT
-	select HID
+	depends on BT_BREDR && HID
 	help
 	  HIDP (Human Interface Device Protocol) is a transport layer
 	  for HID reports.  HIDP is required for the Bluetooth Human
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] hid: intel-thc: fix CONFIG_HID dependency
  2025-01-23 13:48 [PATCH] hid: intel-thc: fix CONFIG_HID dependency Arnd Bergmann
@ 2025-01-24 12:20 ` Ilpo Järvinen
  2025-01-25 16:35 ` Maximilian Luz
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ilpo Järvinen @ 2025-01-24 12:20 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jiri Kosina, Benjamin Tissoires, Srinivas Pandruvada,
	Mark Pearson, Arnd Bergmann, Basavaraj Natikar, Even Xu,
	Xinpeng Sun, Maximilian Luz, Marcel Holtmann, Johan Hedberg,
	Luiz Augusto von Dentz, Dmitry Torokhov, linux-input, LKML,
	platform-driver-x86, linux-usb, linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 6628 bytes --]

On Thu, 23 Jan 2025, Arnd Bergmann wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> In drivers/hid/, most drivers depend on CONFIG_HID, while a couple of the
> drivers in subdirectories instead depend on CONFIG_HID_SUPPORT and use
> 'select HID'. With the newly added INTEL_THC_HID, this causes a build
> warning for a circular dependency:
> 
> WARNING: unmet direct dependencies detected for HID
>   Depends on [m]: HID_SUPPORT [=y] && INPUT [=m]
>   Selected by [y]:
>   - INTEL_THC_HID [=y] && HID_SUPPORT [=y] && X86_64 [=y] && PCI [=y] && ACPI [=y]
> 
> WARNING: unmet direct dependencies detected for INPUT_FF_MEMLESS
>   Depends on [m]: INPUT [=m]
>   Selected by [y]:
>   - HID_MICROSOFT [=y] && HID_SUPPORT [=y] && HID [=y]
>   - GREENASIA_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_GREENASIA [=y]
>   - HID_WIIMOTE [=y] && HID_SUPPORT [=y] && HID [=y] && LEDS_CLASS [=y]
>   - ZEROPLUS_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ZEROPLUS [=y]
>   Selected by [m]:
>   - HID_ACRUX_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ACRUX [=m]
>   - HID_EMS_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>   - HID_GOOGLE_STADIA_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>   - PANTHERLORD_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_PANTHERLORD [=m]
> 
> It's better to be consistent and always use 'depends on HID' for HID
> drivers. The notable exception here is USB_KBD/USB_MOUSE, which are
> alternative implementations that do not depend on the HID subsystem.
> 
> Do this by extending the "if HID" section below, which means that a few
> of the duplicate "depends on HID" and "depends on INPUT" statements
> can be removed in the process.
> 
> Fixes: 1b2d05384c29 ("HID: intel-thc-hid: Add basic THC driver skeleton")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/hid/Kconfig               | 10 ++++++----
>  drivers/hid/amd-sfh-hid/Kconfig   |  1 -
>  drivers/hid/i2c-hid/Kconfig       |  2 +-
>  drivers/hid/intel-ish-hid/Kconfig |  1 -
>  drivers/hid/intel-thc-hid/Kconfig |  1 -
>  drivers/hid/surface-hid/Kconfig   |  2 --
>  drivers/hid/usbhid/Kconfig        |  3 +--
>  net/bluetooth/hidp/Kconfig        |  3 +--
>  8 files changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 8adb745c5b28..ed657ef7281c 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -1376,10 +1376,6 @@ endmenu
>  
>  source "drivers/hid/bpf/Kconfig"
>  
> -endif # HID
> -
> -source "drivers/hid/usbhid/Kconfig"
> -
>  source "drivers/hid/i2c-hid/Kconfig"
>  
>  source "drivers/hid/intel-ish-hid/Kconfig"
> @@ -1390,4 +1386,10 @@ source "drivers/hid/surface-hid/Kconfig"
>  
>  source "drivers/hid/intel-thc-hid/Kconfig"
>  
> +endif # HID
> +
> +# USB support may be used with HID disabled
> +
> +source "drivers/hid/usbhid/Kconfig"
> +
>  endif # HID_SUPPORT
> diff --git a/drivers/hid/amd-sfh-hid/Kconfig b/drivers/hid/amd-sfh-hid/Kconfig
> index 329de5e12c1a..3291786a5ee6 100644
> --- a/drivers/hid/amd-sfh-hid/Kconfig
> +++ b/drivers/hid/amd-sfh-hid/Kconfig
> @@ -5,7 +5,6 @@ menu "AMD SFH HID Support"
>  
>  config AMD_SFH_HID
>  	tristate "AMD Sensor Fusion Hub"
> -	depends on HID
>  	depends on X86
>  	help
>  	  If you say yes to this option, support will be included for the
> diff --git a/drivers/hid/i2c-hid/Kconfig b/drivers/hid/i2c-hid/Kconfig
> index ef7c595c9403..e8d51f410cc1 100644
> --- a/drivers/hid/i2c-hid/Kconfig
> +++ b/drivers/hid/i2c-hid/Kconfig
> @@ -2,7 +2,7 @@
>  menuconfig I2C_HID
>  	tristate "I2C HID support"
>  	default y
> -	depends on I2C && INPUT && HID
> +	depends on I2C
>  
>  if I2C_HID
>  
> diff --git a/drivers/hid/intel-ish-hid/Kconfig b/drivers/hid/intel-ish-hid/Kconfig
> index 253dc10d35ef..568c8688784e 100644
> --- a/drivers/hid/intel-ish-hid/Kconfig
> +++ b/drivers/hid/intel-ish-hid/Kconfig
> @@ -6,7 +6,6 @@ config INTEL_ISH_HID
>  	tristate "Intel Integrated Sensor Hub"
>  	default n
>  	depends on X86
> -	depends on HID
>  	help
>  	  The Integrated Sensor Hub (ISH) enables the ability to offload
>  	  sensor polling and algorithm processing to a dedicated low power
> diff --git a/drivers/hid/intel-thc-hid/Kconfig b/drivers/hid/intel-thc-hid/Kconfig
> index 91ec84902db8..0351d1137607 100644
> --- a/drivers/hid/intel-thc-hid/Kconfig
> +++ b/drivers/hid/intel-thc-hid/Kconfig
> @@ -7,7 +7,6 @@ menu "Intel THC HID Support"
>  config INTEL_THC_HID
>  	tristate "Intel Touch Host Controller"
>  	depends on ACPI
> -	select HID
>  	help
>  	  THC (Touch Host Controller) is the name of the IP block in PCH that
>  	  interfaces with Touch Devices (ex: touchscreen, touchpad etc.). It
> diff --git a/drivers/hid/surface-hid/Kconfig b/drivers/hid/surface-hid/Kconfig
> index 7ce9b5d641eb..d0cfd0d29926 100644
> --- a/drivers/hid/surface-hid/Kconfig
> +++ b/drivers/hid/surface-hid/Kconfig
> @@ -1,7 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0+
>  menu "Surface System Aggregator Module HID support"
>  	depends on SURFACE_AGGREGATOR
> -	depends on INPUT
>  
>  config SURFACE_HID
>  	tristate "HID transport driver for Surface System Aggregator Module"
> @@ -39,4 +38,3 @@ endmenu
>  
>  config SURFACE_HID_CORE
>  	tristate
> -	select HID
> diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig
> index 7c2032f7f44d..f3194767a45e 100644
> --- a/drivers/hid/usbhid/Kconfig
> +++ b/drivers/hid/usbhid/Kconfig
> @@ -5,8 +5,7 @@ menu "USB HID support"
>  config USB_HID
>  	tristate "USB HID transport layer"
>  	default y
> -	depends on USB && INPUT
> -	select HID
> +	depends on HID

I didn't exactly like the unrelated removal of USB totally without 
a prior warning. I suggest you at minimum mention in the commit message 
that menu covers it.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

-- 
 i.

>  	help
>  	  Say Y here if you want to connect USB keyboards,
>  	  mice, joysticks, graphic tablets, or any other HID based devices
> diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig
> index 6746be07e222..e08aae35351a 100644
> --- a/net/bluetooth/hidp/Kconfig
> +++ b/net/bluetooth/hidp/Kconfig
> @@ -1,8 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config BT_HIDP
>  	tristate "HIDP protocol support"
> -	depends on BT_BREDR && INPUT && HID_SUPPORT
> -	select HID
> +	depends on BT_BREDR && HID
>  	help
>  	  HIDP (Human Interface Device Protocol) is a transport layer
>  	  for HID reports.  HIDP is required for the Bluetooth Human
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] hid: intel-thc: fix CONFIG_HID dependency
  2025-01-23 13:48 [PATCH] hid: intel-thc: fix CONFIG_HID dependency Arnd Bergmann
  2025-01-24 12:20 ` Ilpo Järvinen
@ 2025-01-25 16:35 ` Maximilian Luz
  2025-01-26  1:10 ` Xu, Even
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Maximilian Luz @ 2025-01-25 16:35 UTC (permalink / raw)
  To: Arnd Bergmann, Jiri Kosina, Benjamin Tissoires,
	Srinivas Pandruvada, Mark Pearson
  Cc: Arnd Bergmann, Basavaraj Natikar, Even Xu, Xinpeng Sun,
	Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	Dmitry Torokhov, linux-input, linux-kernel, platform-driver-x86,
	linux-usb, linux-bluetooth

On 1/23/25 2:48 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> In drivers/hid/, most drivers depend on CONFIG_HID, while a couple of the
> drivers in subdirectories instead depend on CONFIG_HID_SUPPORT and use
> 'select HID'. With the newly added INTEL_THC_HID, this causes a build
> warning for a circular dependency:
> 
> WARNING: unmet direct dependencies detected for HID
>    Depends on [m]: HID_SUPPORT [=y] && INPUT [=m]
>    Selected by [y]:
>    - INTEL_THC_HID [=y] && HID_SUPPORT [=y] && X86_64 [=y] && PCI [=y] && ACPI [=y]
> 
> WARNING: unmet direct dependencies detected for INPUT_FF_MEMLESS
>    Depends on [m]: INPUT [=m]
>    Selected by [y]:
>    - HID_MICROSOFT [=y] && HID_SUPPORT [=y] && HID [=y]
>    - GREENASIA_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_GREENASIA [=y]
>    - HID_WIIMOTE [=y] && HID_SUPPORT [=y] && HID [=y] && LEDS_CLASS [=y]
>    - ZEROPLUS_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ZEROPLUS [=y]
>    Selected by [m]:
>    - HID_ACRUX_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ACRUX [=m]
>    - HID_EMS_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>    - HID_GOOGLE_STADIA_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>    - PANTHERLORD_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_PANTHERLORD [=m]
> 
> It's better to be consistent and always use 'depends on HID' for HID
> drivers. The notable exception here is USB_KBD/USB_MOUSE, which are
> alternative implementations that do not depend on the HID subsystem.
> 
> Do this by extending the "if HID" section below, which means that a few
> of the duplicate "depends on HID" and "depends on INPUT" statements
> can be removed in the process.
> 
> Fixes: 1b2d05384c29 ("HID: intel-thc-hid: Add basic THC driver skeleton")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

For hid/surface-hid:

Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] hid: intel-thc: fix CONFIG_HID dependency
  2025-01-23 13:48 [PATCH] hid: intel-thc: fix CONFIG_HID dependency Arnd Bergmann
  2025-01-24 12:20 ` Ilpo Järvinen
  2025-01-25 16:35 ` Maximilian Luz
@ 2025-01-26  1:10 ` Xu, Even
  2025-02-03  9:56 ` Jiri Kosina
  2025-02-20 18:31 ` patchwork-bot+bluetooth
  4 siblings, 0 replies; 6+ messages in thread
From: Xu, Even @ 2025-01-26  1:10 UTC (permalink / raw)
  To: Arnd Bergmann, Jiri Kosina, Benjamin Tissoires,
	Srinivas Pandruvada, Mark Pearson
  Cc: Arnd Bergmann, Basavaraj Natikar, Sun, Xinpeng, Maximilian Luz,
	Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	Dmitry Torokhov, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Thursday, January 23, 2025 9:48 PM
> To: Jiri Kosina <jikos@kernel.org>; Benjamin Tissoires <bentiss@kernel.org>;
> Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>; Mark Pearson
> <mpearson-lenovo@squebb.ca>
> Cc: Arnd Bergmann <arnd@arndb.de>; Basavaraj Natikar
> <basavaraj.natikar@amd.com>; Xu, Even <even.xu@intel.com>; Sun, Xinpeng
> <xinpeng.sun@intel.com>; Maximilian Luz <luzmaximilian@gmail.com>; Marcel
> Holtmann <marcel@holtmann.org>; Johan Hedberg
> <johan.hedberg@gmail.com>; Luiz Augusto von Dentz <luiz.dentz@gmail.com>;
> Dmitry Torokhov <dmitry.torokhov@gmail.com>; linux-input@vger.kernel.org;
> linux-kernel@vger.kernel.org; platform-driver-x86@vger.kernel.org; linux-
> usb@vger.kernel.org; linux-bluetooth@vger.kernel.org
> Subject: [PATCH] hid: intel-thc: fix CONFIG_HID dependency
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> In drivers/hid/, most drivers depend on CONFIG_HID, while a couple of the drivers
> in subdirectories instead depend on CONFIG_HID_SUPPORT and use 'select HID'.
> With the newly added INTEL_THC_HID, this causes a build warning for a circular
> dependency:
> 
> WARNING: unmet direct dependencies detected for HID
>   Depends on [m]: HID_SUPPORT [=y] && INPUT [=m]
>   Selected by [y]:
>   - INTEL_THC_HID [=y] && HID_SUPPORT [=y] && X86_64 [=y] && PCI [=y] &&
> ACPI [=y]
> 
> WARNING: unmet direct dependencies detected for INPUT_FF_MEMLESS
>   Depends on [m]: INPUT [=m]
>   Selected by [y]:
>   - HID_MICROSOFT [=y] && HID_SUPPORT [=y] && HID [=y]
>   - GREENASIA_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_GREENASIA
> [=y]
>   - HID_WIIMOTE [=y] && HID_SUPPORT [=y] && HID [=y] && LEDS_CLASS [=y]
>   - ZEROPLUS_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ZEROPLUS
> [=y]
>   Selected by [m]:
>   - HID_ACRUX_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ACRUX [=m]
>   - HID_EMS_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>   - HID_GOOGLE_STADIA_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>   - PANTHERLORD_FF [=y] && HID_SUPPORT [=y] && HID [=y] &&
> HID_PANTHERLORD [=m]
> 
> It's better to be consistent and always use 'depends on HID' for HID drivers. The
> notable exception here is USB_KBD/USB_MOUSE, which are alternative
> implementations that do not depend on the HID subsystem.
> 
> Do this by extending the "if HID" section below, which means that a few of the
> duplicate "depends on HID" and "depends on INPUT" statements can be removed
> in the process.
> 
> Fixes: 1b2d05384c29 ("HID: intel-thc-hid: Add basic THC driver skeleton")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/hid/Kconfig               | 10 ++++++----
>  drivers/hid/amd-sfh-hid/Kconfig   |  1 -
>  drivers/hid/i2c-hid/Kconfig       |  2 +-
>  drivers/hid/intel-ish-hid/Kconfig |  1 -  drivers/hid/intel-thc-hid/Kconfig |  1 -
>  drivers/hid/surface-hid/Kconfig   |  2 --
>  drivers/hid/usbhid/Kconfig        |  3 +--
>  net/bluetooth/hidp/Kconfig        |  3 +--
>  8 files changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index
> 8adb745c5b28..ed657ef7281c 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -1376,10 +1376,6 @@ endmenu
> 
>  source "drivers/hid/bpf/Kconfig"
> 
> -endif # HID
> -
> -source "drivers/hid/usbhid/Kconfig"
> -
>  source "drivers/hid/i2c-hid/Kconfig"
> 
>  source "drivers/hid/intel-ish-hid/Kconfig"
> @@ -1390,4 +1386,10 @@ source "drivers/hid/surface-hid/Kconfig"
> 
>  source "drivers/hid/intel-thc-hid/Kconfig"
> 
> +endif # HID
> +
> +# USB support may be used with HID disabled
> +
> +source "drivers/hid/usbhid/Kconfig"
> +
>  endif # HID_SUPPORT
> diff --git a/drivers/hid/amd-sfh-hid/Kconfig b/drivers/hid/amd-sfh-hid/Kconfig
> index 329de5e12c1a..3291786a5ee6 100644
> --- a/drivers/hid/amd-sfh-hid/Kconfig
> +++ b/drivers/hid/amd-sfh-hid/Kconfig
> @@ -5,7 +5,6 @@ menu "AMD SFH HID Support"
> 
>  config AMD_SFH_HID
>  	tristate "AMD Sensor Fusion Hub"
> -	depends on HID
>  	depends on X86
>  	help
>  	  If you say yes to this option, support will be included for the diff --git
> a/drivers/hid/i2c-hid/Kconfig b/drivers/hid/i2c-hid/Kconfig index
> ef7c595c9403..e8d51f410cc1 100644
> --- a/drivers/hid/i2c-hid/Kconfig
> +++ b/drivers/hid/i2c-hid/Kconfig
> @@ -2,7 +2,7 @@
>  menuconfig I2C_HID
>  	tristate "I2C HID support"
>  	default y
> -	depends on I2C && INPUT && HID
> +	depends on I2C
> 
>  if I2C_HID
> 
> diff --git a/drivers/hid/intel-ish-hid/Kconfig b/drivers/hid/intel-ish-hid/Kconfig
> index 253dc10d35ef..568c8688784e 100644
> --- a/drivers/hid/intel-ish-hid/Kconfig
> +++ b/drivers/hid/intel-ish-hid/Kconfig
> @@ -6,7 +6,6 @@ config INTEL_ISH_HID
>  	tristate "Intel Integrated Sensor Hub"
>  	default n
>  	depends on X86
> -	depends on HID
>  	help
>  	  The Integrated Sensor Hub (ISH) enables the ability to offload
>  	  sensor polling and algorithm processing to a dedicated low power diff --
> git a/drivers/hid/intel-thc-hid/Kconfig b/drivers/hid/intel-thc-hid/Kconfig
> index 91ec84902db8..0351d1137607 100644
> --- a/drivers/hid/intel-thc-hid/Kconfig
> +++ b/drivers/hid/intel-thc-hid/Kconfig
> @@ -7,7 +7,6 @@ menu "Intel THC HID Support"
>  config INTEL_THC_HID
>  	tristate "Intel Touch Host Controller"
>  	depends on ACPI
> -	select HID
>  	help
>  	  THC (Touch Host Controller) is the name of the IP block in PCH that
>  	  interfaces with Touch Devices (ex: touchscreen, touchpad etc.). It diff --
> git a/drivers/hid/surface-hid/Kconfig b/drivers/hid/surface-hid/Kconfig index
> 7ce9b5d641eb..d0cfd0d29926 100644
> --- a/drivers/hid/surface-hid/Kconfig
> +++ b/drivers/hid/surface-hid/Kconfig
> @@ -1,7 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0+
>  menu "Surface System Aggregator Module HID support"
>  	depends on SURFACE_AGGREGATOR
> -	depends on INPUT
> 
>  config SURFACE_HID
>  	tristate "HID transport driver for Surface System Aggregator Module"
> @@ -39,4 +38,3 @@ endmenu
> 
>  config SURFACE_HID_CORE
>  	tristate
> -	select HID
> diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig index
> 7c2032f7f44d..f3194767a45e 100644
> --- a/drivers/hid/usbhid/Kconfig
> +++ b/drivers/hid/usbhid/Kconfig
> @@ -5,8 +5,7 @@ menu "USB HID support"
>  config USB_HID
>  	tristate "USB HID transport layer"
>  	default y
> -	depends on USB && INPUT
> -	select HID
> +	depends on HID
>  	help
>  	  Say Y here if you want to connect USB keyboards,
>  	  mice, joysticks, graphic tablets, or any other HID based devices diff --git
> a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig index
> 6746be07e222..e08aae35351a 100644
> --- a/net/bluetooth/hidp/Kconfig
> +++ b/net/bluetooth/hidp/Kconfig
> @@ -1,8 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only  config BT_HIDP
>  	tristate "HIDP protocol support"
> -	depends on BT_BREDR && INPUT && HID_SUPPORT
> -	select HID
> +	depends on BT_BREDR && HID
>  	help
>  	  HIDP (Human Interface Device Protocol) is a transport layer
>  	  for HID reports.  HIDP is required for the Bluetooth Human
> --
> 2.39.5

For hid/intel-thc-hid:

Reviewed-by: Even Xu <even.xu@intel.com>

Best Regards,
Even Xu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] hid: intel-thc: fix CONFIG_HID dependency
  2025-01-23 13:48 [PATCH] hid: intel-thc: fix CONFIG_HID dependency Arnd Bergmann
                   ` (2 preceding siblings ...)
  2025-01-26  1:10 ` Xu, Even
@ 2025-02-03  9:56 ` Jiri Kosina
  2025-02-20 18:31 ` patchwork-bot+bluetooth
  4 siblings, 0 replies; 6+ messages in thread
From: Jiri Kosina @ 2025-02-03  9:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Benjamin Tissoires, Srinivas Pandruvada, Mark Pearson,
	Arnd Bergmann, Basavaraj Natikar, Even Xu, Xinpeng Sun,
	Maximilian Luz, Marcel Holtmann, Johan Hedberg,
	Luiz Augusto von Dentz, Dmitry Torokhov, linux-input,
	linux-kernel, platform-driver-x86, linux-usb, linux-bluetooth

On Thu, 23 Jan 2025, Arnd Bergmann wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> In drivers/hid/, most drivers depend on CONFIG_HID, while a couple of the
> drivers in subdirectories instead depend on CONFIG_HID_SUPPORT and use
> 'select HID'. With the newly added INTEL_THC_HID, this causes a build
> warning for a circular dependency:
> 
> WARNING: unmet direct dependencies detected for HID
>   Depends on [m]: HID_SUPPORT [=y] && INPUT [=m]
>   Selected by [y]:
>   - INTEL_THC_HID [=y] && HID_SUPPORT [=y] && X86_64 [=y] && PCI [=y] && ACPI [=y]
> 
> WARNING: unmet direct dependencies detected for INPUT_FF_MEMLESS
>   Depends on [m]: INPUT [=m]
>   Selected by [y]:
>   - HID_MICROSOFT [=y] && HID_SUPPORT [=y] && HID [=y]
>   - GREENASIA_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_GREENASIA [=y]
>   - HID_WIIMOTE [=y] && HID_SUPPORT [=y] && HID [=y] && LEDS_CLASS [=y]
>   - ZEROPLUS_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ZEROPLUS [=y]
>   Selected by [m]:
>   - HID_ACRUX_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_ACRUX [=m]
>   - HID_EMS_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>   - HID_GOOGLE_STADIA_FF [=m] && HID_SUPPORT [=y] && HID [=y]
>   - PANTHERLORD_FF [=y] && HID_SUPPORT [=y] && HID [=y] && HID_PANTHERLORD [=m]
> 
> It's better to be consistent and always use 'depends on HID' for HID
> drivers. The notable exception here is USB_KBD/USB_MOUSE, which are
> alternative implementations that do not depend on the HID subsystem.
> 
> Do this by extending the "if HID" section below, which means that a few
> of the duplicate "depends on HID" and "depends on INPUT" statements
> can be removed in the process.
> 
> Fixes: 1b2d05384c29 ("HID: intel-thc-hid: Add basic THC driver skeleton")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to hid.git#for-6.14/upstream-fixes, thanks!

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] hid: intel-thc: fix CONFIG_HID dependency
  2025-01-23 13:48 [PATCH] hid: intel-thc: fix CONFIG_HID dependency Arnd Bergmann
                   ` (3 preceding siblings ...)
  2025-02-03  9:56 ` Jiri Kosina
@ 2025-02-20 18:31 ` patchwork-bot+bluetooth
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2025-02-20 18:31 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: jikos, bentiss, srinivas.pandruvada, mpearson-lenovo, arnd,
	basavaraj.natikar, even.xu, xinpeng.sun, luzmaximilian, marcel,
	johan.hedberg, luiz.dentz, dmitry.torokhov, linux-input,
	linux-kernel, platform-driver-x86, linux-usb, linux-bluetooth

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Jiri Kosina <jkosina@suse.com>:

On Thu, 23 Jan 2025 14:48:12 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> In drivers/hid/, most drivers depend on CONFIG_HID, while a couple of the
> drivers in subdirectories instead depend on CONFIG_HID_SUPPORT and use
> 'select HID'. With the newly added INTEL_THC_HID, this causes a build
> warning for a circular dependency:
> 
> [...]

Here is the summary with links:
  - hid: intel-thc: fix CONFIG_HID dependency
    https://git.kernel.org/bluetooth/bluetooth-next/c/a5a056c8d2ba

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-20 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-23 13:48 [PATCH] hid: intel-thc: fix CONFIG_HID dependency Arnd Bergmann
2025-01-24 12:20 ` Ilpo Järvinen
2025-01-25 16:35 ` Maximilian Luz
2025-01-26  1:10 ` Xu, Even
2025-02-03  9:56 ` Jiri Kosina
2025-02-20 18:31 ` patchwork-bot+bluetooth

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).