* [PATCH v2] HID: add KEY_CAMERA_FOCUS event in HID
@ 2023-01-31 11:46 Qi Feng
2023-02-07 2:35 ` qi feng
2023-02-16 7:19 ` Greg KH
0 siblings, 2 replies; 4+ messages in thread
From: Qi Feng @ 2023-01-31 11:46 UTC (permalink / raw)
To: jikos; +Cc: benjamin.tissoires, rydberg, linux-input, linux-kernel, fengqi
From: fengqi <fengqi@xiaomi.com>
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
Signed-off-by: fengqi <fengqi@xiaomi.com>
---
drivers/hid/hid-input.c | 7 +++++++
include/linux/hid.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 9b59e436df0a..05fa3e191574 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1221,6 +1221,13 @@ 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);
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 8677ae38599e..e3daf2c7739c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] HID: add KEY_CAMERA_FOCUS event in HID
2023-01-31 11:46 [PATCH v2] HID: add KEY_CAMERA_FOCUS event in HID Qi Feng
@ 2023-02-07 2:35 ` qi feng
2023-02-13 6:09 ` qi feng
2023-02-16 7:19 ` Greg KH
1 sibling, 1 reply; 4+ messages in thread
From: qi feng @ 2023-02-07 2:35 UTC (permalink / raw)
To: jikos; +Cc: benjamin.tissoires, rydberg, linux-input, linux-kernel, fengqi
Hi,
Please help to review this v2 code
thanks a lot
Qi Feng <fengqi706@gmail.com> 于2023年1月31日周二 19:46写道:
>
> From: fengqi <fengqi@xiaomi.com>
>
> 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
>
> Signed-off-by: fengqi <fengqi@xiaomi.com>
> ---
> drivers/hid/hid-input.c | 7 +++++++
> include/linux/hid.h | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 9b59e436df0a..05fa3e191574 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -1221,6 +1221,13 @@ 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);
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index 8677ae38599e..e3daf2c7739c 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] HID: add KEY_CAMERA_FOCUS event in HID
2023-02-07 2:35 ` qi feng
@ 2023-02-13 6:09 ` qi feng
0 siblings, 0 replies; 4+ messages in thread
From: qi feng @ 2023-02-13 6:09 UTC (permalink / raw)
To: jikos; +Cc: benjamin.tissoires, rydberg, linux-input, linux-kernel, fengqi
Thanks for your help to review
loop more
qi feng <fengqi706@gmail.com> 于2023年2月7日周二 10:35写道:
>
> Hi,
>
> Please help to review this v2 code
>
> thanks a lot
>
> Qi Feng <fengqi706@gmail.com> 于2023年1月31日周二 19:46写道:
> >
> > From: fengqi <fengqi@xiaomi.com>
> >
> > 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
> >
> > Signed-off-by: fengqi <fengqi@xiaomi.com>
> > ---
> > drivers/hid/hid-input.c | 7 +++++++
> > include/linux/hid.h | 1 +
> > 2 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> > index 9b59e436df0a..05fa3e191574 100644
> > --- a/drivers/hid/hid-input.c
> > +++ b/drivers/hid/hid-input.c
> > @@ -1221,6 +1221,13 @@ 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);
> > diff --git a/include/linux/hid.h b/include/linux/hid.h
> > index 8677ae38599e..e3daf2c7739c 100644
> > --- a/include/linux/hid.h
> > +++ b/include/linux/hid.h
> > @@ -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
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] HID: add KEY_CAMERA_FOCUS event in HID
2023-01-31 11:46 [PATCH v2] HID: add KEY_CAMERA_FOCUS event in HID Qi Feng
2023-02-07 2:35 ` qi feng
@ 2023-02-16 7:19 ` Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-02-16 7:19 UTC (permalink / raw)
To: Qi Feng
Cc: jikos, benjamin.tissoires, rydberg, linux-input, linux-kernel,
fengqi
On Tue, Jan 31, 2023 at 07:46:32PM +0800, Qi Feng wrote:
> From: fengqi <fengqi@xiaomi.com>
>
> 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
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.
> We committed this v2 version following your previous suggestion
This line is not needed in a changelog text.
>
> Signed-off-by: fengqi <fengqi@xiaomi.com>
> ---
> drivers/hid/hid-input.c | 7 +++++++
> include/linux/hid.h | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 9b59e436df0a..05fa3e191574 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -1221,6 +1221,13 @@ 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;
Always run checkpatch.pl on your submission before sending it out,
otherwise it obviously can not be accepted.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-16 7:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-31 11:46 [PATCH v2] HID: add KEY_CAMERA_FOCUS event in HID Qi Feng
2023-02-07 2:35 ` qi feng
2023-02-13 6:09 ` qi feng
2023-02-16 7:19 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).