From 33bbe04a15f292998298cdb5751788c15acd60df Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Mon, 14 Mar 2022 21:04:39 -0700 Subject: HID: google: extract Vivaldi hid feature mapping for use in hid-hammer We need to support parsing the HID device in both the Vivaldi and the Hammer drivers so that we can properly expose the function row physmap to userspace when a hammer device uses a vivaldi keyboard layout for the function row keys. Extract the feature mapping logic from the vivaldi driver into an hid specific vivaldi library so we can use it from both HID drivers. To allow more code sharing we mandate that vivaldi data must be placed at the very beginning of the driver data attached to the HID device instance. Signed-off-by: Stephen Boyd Tested-by: Stephen Boyd # coachz, wormdingler Link: https://lore.kernel.org/r/20220228075446.466016-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/hid/hid-vivaldi-common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 drivers/hid/hid-vivaldi-common.h (limited to 'drivers/hid/hid-vivaldi-common.h') diff --git a/drivers/hid/hid-vivaldi-common.h b/drivers/hid/hid-vivaldi-common.h new file mode 100644 index 000000000000..d42e82d77825 --- /dev/null +++ b/drivers/hid/hid-vivaldi-common.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _HID_VIVALDI_COMMON_H +#define _HID_VIVALDI_COMMON_H + +struct hid_device; +struct hid_field; +struct hid_input; +struct hid_usage; + +void vivaldi_feature_mapping(struct hid_device *hdev, + struct hid_field *field, struct hid_usage *usage); + +int vivaldi_input_configured(struct hid_device *hdev, + struct hid_input *hidinput); + +#endif /* _HID_VIVALDI_COMMON_H */ -- cgit