HID: add KEY_CAMERA_FOCUS event in HID
PATCH v2 1/1 HID: add KEY_CAMERA_FOCUS event in HID
From: fengqi <[email protected]>
Our HID device need KEY_CAMERA_FOCUS event to control camera, but this event is non-existent in current HID driver.we add this event in hid-input.c We committed this v2 version following your previous suggestion
--- drivers/hid/hid-input.c | 7 +++++++ include/linux/hid.h | 1 + 2 files changed, 8 insertions(+)
drivers/hid/hid-input.c +7 -0
@@ -1221,6 +1221,13 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielreturn ; } 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);
include/linux/hid.h +1 -0
@@ -155,6 +155,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
Signature · 1 line
2.39.0
Hi,
Please help to review this v2 code
thanks a lot
Quoted 46 lines · Qi Feng <[email protected]> 于2023年1月31日周二 19:46写道:
From: fengqi <[email protected]>
Our HID device need
KEY_CAMERA_FOCUSevent to control camera, but this event is non-existent in current HID driver.we add this event inhid-input.cWe committed this v2 version following your previous suggestionSigned-off-by fengqi <[email protected]>--- drivers/hid/hid-input.c | 7 +++++++ include/linux/hid.h | 1 + 2 files changed, 8 insertions(+)drivers/hid/hid-input.c +7
-0@@ -1221,6 +1221,13 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielreturn ; } 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);include/linux/hid.h +1
-1@@ -155,6 +155,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 --2.39.0
Thanks for your help to review
loop more
Quoted 54 lines · qi feng <[email protected]> 于2023年2月7日周二 10:35写道:
Hi,
Please help to review this v2 code
thanks a lot
Quoted 46 lines · Qi Feng <[email protected]> 于2023年1月31日周二 19:46写道:
From: fengqi <[email protected]>
Our HID device need
KEY_CAMERA_FOCUSevent to control camera, but this event is non-existent in current HID driver.we add this event inhid-input.cWe committed this v2 version following your previous suggestionSigned-off-by fengqi <[email protected]>--- drivers/hid/hid-input.c | 7 +++++++ include/linux/hid.h | 1 + 2 files changed, 8 insertions(+)drivers/hid/hid-input.c +7
-0@@ -1221,6 +1221,13 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielreturn ; } 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);include/linux/hid.h +1
-1@@ -155,6 +155,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 --2.39.0
Quoted 4 lines · Qi Feng
From: fengqi <[email protected]>
Our HID device need
KEY_CAMERA_FOCUSevent to control camera, but this event is non-existent in current HID driver.we add this event inhid-input.c
Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what is needed in order to properly describe the change.
Quoted 1 line
We committed this v2 version following your previous suggestion
This line is not needed in a changelog text.
Quoted 12 lines
Signed-off-by fengqi <[email protected]>--- drivers/hid/hid-input.c | 7 +++++++ include/linux/hid.h | 1 + 2 files changed, 8 insertions(+)drivers/hid/hid-input.c +0
-0
drivers/hid/hid-input.c static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · line 1230
Quoted 10 lines
drivers/hid/hid-input.c +7
-0@@ -1221,6 +1221,13 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielreturn ; } 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 ;
Always run checkpatch.pl on your submission before sending it out, otherwise it obviously can not be accepted.
thanks,
greg k-h