Commit 740b2f03 authored by fengqi's avatar fengqi Committed by Jiri Kosina

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: default avatarfengqi <fengqi@xiaomi.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 2653e3fe
......@@ -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);
......
......@@ -156,6 +156,7 @@ struct hid_item {
#define HID_UP_DIGITIZER 0x000d0000
#define HID_UP_PID 0x000f0000
#define HID_UP_BATTERY 0x00850000
#define HID_UP_CAMERA 0x00900000
#define HID_UP_HPVENDOR 0xff7f0000
#define HID_UP_HPVENDOR2 0xff010000
#define HID_UP_MSVENDOR 0xff000000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment