From 740b2f03f80e8f50c3f96309bc123bea040de8d0 Mon Sep 17 00:00:00 2001 From: fengqi Date: Thu, 16 Feb 2023 16:48:30 +0800 Subject: HID: add KEY_CAMERA_FOCUS event in HID Our HID device need KEY_CAMERA_FOCUS event to control camera, but this event is non-existent in current HID driver. So we add this event in hid-input.c. Signed-off-by: fengqi Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jiri Kosina --- drivers/hid/hid-input.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/hid') diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 7fc967964dd8..fbf5db9a0d67 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1261,6 +1261,16 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel return; } goto unknown; + case HID_UP_CAMERA: + switch (usage->hid & HID_USAGE) { + case 0x020: + map_key_clear(KEY_CAMERA_FOCUS); break; + case 0x021: + map_key_clear(KEY_CAMERA); break; + default: + goto ignore; + } + break; case HID_UP_HPVENDOR: /* Reported on a Dutch layout HP5308 */ set_bit(EV_REP, input->evbit); -- cgit v1.2.3