summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-input.c
diff options
context:
space:
mode:
authorfengqi <fengqi@xiaomi.com>2023-02-16 16:48:30 +0800
committerJiri Kosina <jkosina@suse.cz>2023-03-10 15:21:11 +0100
commit740b2f03f80e8f50c3f96309bc123bea040de8d0 (patch)
tree4994ea2bd0c0cc921622e971ad6823086b8c9d9e /drivers/hid/hid-input.c
parent2653e3fe33f411227296552b2e5f9c2640924900 (diff)
downloadlinux-stable-740b2f03f80e8f50c3f96309bc123bea040de8d0.tar.gz
linux-stable-740b2f03f80e8f50c3f96309bc123bea040de8d0.tar.bz2
linux-stable-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/hid-input.c')
-rw-r--r--drivers/hid/hid-input.c10
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);