diff options
author | fengqi <fengqi@xiaomi.com> | 2023-02-16 09:48:30 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2023-03-10 15:21:11 +0100 |
commit | 740b2f03f80e8f50c3f96309bc123bea040de8d0 (patch) | |
tree | 4994ea2bd0c0cc921622e971ad6823086b8c9d9e /drivers/hid | |
parent | Merge tag 'for-linus-2023030901' of git://git.kernel.org/pub/scm/linux/kernel... (diff) | |
download | linux-740b2f03f80e8f50c3f96309bc123bea040de8d0.tar.xz linux-740b2f03f80e8f50c3f96309bc123bea040de8d0.zip |
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 <fengqi@xiaomi.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-input.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |