Skip to content

Commit

Permalink
HID: Kconfig: split HID support and hid-core compilation
Browse files Browse the repository at this point in the history
Currently, we step into drivers/hid/ based on the value of
CONFIG_HID.

However, that value is a tristate, meaning that it can be a module.

As per the documentation, if we jump into the subdirectory by
following an obj-m, we can not compile anything inside that
subdirectory in vmlinux. It is considered as a bug.

To make things more friendly to HID-BPF, split HID (the HID core
parameter) from HID_SUPPORT (do we want any kind of HID support in the
system?), and make this new config a boolean.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Nov 15, 2022
1 parent 9c730fe commit 25621bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ obj-$(CONFIG_CRYPTO) += crypto/
obj-$(CONFIG_SUPERH) += sh/
obj-y += clocksource/
obj-$(CONFIG_DCA) += dca/
obj-$(CONFIG_HID) += hid/
obj-$(CONFIG_HID_SUPPORT) += hid/
obj-$(CONFIG_PPC_PS3) += ps3/
obj-$(CONFIG_OF) += of/
obj-$(CONFIG_SSB) += ssb/
Expand Down
16 changes: 11 additions & 5 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
#
# HID driver configuration
#
menu "HID support"
depends on INPUT
menuconfig HID_SUPPORT
bool "HID bus support"
default y
depends on INPUT
help
This option adds core support for human interface device (HID).
You will also need drivers from the following menu to make use of it.

if HID_SUPPORT

config HID
tristate "HID bus support"
depends on INPUT
tristate "HID bus core support"
default y
help
A human interface device (HID) is a type of computer device that
Expand Down Expand Up @@ -1290,4 +1296,4 @@ source "drivers/hid/amd-sfh-hid/Kconfig"

source "drivers/hid/surface-hid/Kconfig"

endmenu
endif # HID_SUPPORT
2 changes: 1 addition & 1 deletion drivers/hid/amd-sfh-hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
menu "AMD SFH HID Support"
depends on X86_64 || COMPILE_TEST
depends on PCI
depends on HID

config AMD_SFH_HID
tristate "AMD Sensor Fusion Hub"
select HID
help
If you say yes to this option, support will be included for the
AMD Sensor Fusion Hub.
Expand Down

0 comments on commit 25621bc

Please sign in to comment.