diff options
author | fengqi <fengqi@xiaomi.com> | 2023-02-16 11:48:30 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2023-03-10 17:21:11 +0300 |
commit | 740b2f03f80e8f50c3f96309bc123bea040de8d0 (patch) | |
tree | 4994ea2bd0c0cc921622e971ad6823086b8c9d9e /drivers/hid/hid-input.c | |
parent | 2653e3fe33f411227296552b2e5f9c2640924900 (diff) | |
download | linux-740b2f03f80e8f50c3f96309bc123bea040de8d0.tar.xz |
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/hid-input.c')
-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); |