summaryrefslogtreecommitdiffstats
path: root/include/linux/hid.h
diff options
context:
space:
mode:
authorKerem Karabay <kekrby@gmail.com>2024-07-05 11:17:42 +0000
committerJiri Kosina <jkosina@suse.com>2024-08-02 12:42:23 +0200
commit6edb8cd87cca5dd4389d4ea2d84b66ea94341bbd (patch)
tree80d6ee0630e7da4ee8ca454a0cb66046e69f21c4 /include/linux/hid.h
parent6b5faec9f564ea627c66064a4a6a5904fe5a07dd (diff)
downloadlinux-6edb8cd87cca5dd4389d4ea2d84b66ea94341bbd.tar.gz
linux-6edb8cd87cca5dd4389d4ea2d84b66ea94341bbd.tar.bz2
linux-6edb8cd87cca5dd4389d4ea2d84b66ea94341bbd.zip
HID: core: add helper for finding a field with a certain usage
This helper will allow HID drivers to easily determine if they should bind to a hid_device by checking for the prescence of a certain field when its ID is not enough, which can be the case on USB devices with multiple interfaces and/or configurations. Convert google-hammer driver to use it, and remove now superfluous hammer_has_usage(). [jkosina@suse.com: expand changelog with the information about google-hammer being added as user of this API ] Signed-off-by: Kerem Karabay <kekrby@gmail.com> Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 1533c9dcd3a6..2deff79f39a1 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -940,6 +940,8 @@ extern void hidinput_report_event(struct hid_device *hid, struct hid_report *rep
extern int hidinput_connect(struct hid_device *hid, unsigned int force);
extern void hidinput_disconnect(struct hid_device *);
+struct hid_field *hid_find_field(struct hid_device *hdev, unsigned int report_type,
+ unsigned int application, unsigned int usage);
int hid_set_field(struct hid_field *, unsigned, __s32);
int hid_input_report(struct hid_device *hid, enum hid_report_type type, u8 *data, u32 size,
int interrupt);