* [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID
@ 2023-02-16 8:48 Qi Feng
2023-02-16 9:26 ` qi feng
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Qi Feng @ 2023-02-16 8:48 UTC (permalink / raw)
To: jikos; +Cc: benjamin.tissoires, 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.
So we add this event in hid-input.c.
Signed-off-by: fengqi <fengqi@xiaomi.com>
---
changes in v4:
-add HID_UP_CAMERA in HID usage tables , Then add the mapping under HID_UP_CAMERA
-modify the commit log of patch
-Link to v3:https://lore.kernel.org/linux-input/9a85b268c7636ef2e4e3bbbe318561ba2842a591.1676536357.git.fengqi@xiaomi.com/T/#u
-Link to v2:https://lore.kernel.org/linux-input/CACOZ=ZU0zgRmoRu8X5bMUzUrXA9x-qoDJqrQroUs=+qKR58MQA@mail.gmail.com/T/#t
-Link to v1:https://lore.kernel.org/linux-input/CACOZ=ZWB3grJKn7wAZEZ0BDyN7KJF4VWUTNs-mPxeoW_oiR7=g@mail.gmail.com/T/#t
---
drivers/hid/hid-input.c | 10 ++++++++++
include/linux/hid.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 77c8c49852b5..c6098ae2fac7 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1225,6 +1225,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);
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 8677ae38599e..88793b77bd63 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] 7+ messages in thread
* Re: [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID
2023-02-16 8:48 [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID Qi Feng
@ 2023-02-16 9:26 ` qi feng
2023-02-16 10:15 ` Greg KH
2023-02-16 10:18 ` Greg KH
2023-03-10 14:21 ` Jiri Kosina
2 siblings, 1 reply; 7+ messages in thread
From: qi feng @ 2023-02-16 9:26 UTC (permalink / raw)
To: jikos; +Cc: benjamin.tissoires, linux-input, linux-kernel, fengqi, gregkh
loop more
Qi Feng <fengqi706@gmail.com> 于2023年2月16日周四 16:48写道:
>
> 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.
> So we add this event in hid-input.c.
>
> Signed-off-by: fengqi <fengqi@xiaomi.com>
>
> ---
> changes in v4:
>
> -add HID_UP_CAMERA in HID usage tables , Then add the mapping under HID_UP_CAMERA
> -modify the commit log of patch
> -Link to v3:https://lore.kernel.org/linux-input/9a85b268c7636ef2e4e3bbbe318561ba2842a591.1676536357.git.fengqi@xiaomi.com/T/#u
> -Link to v2:https://lore.kernel.org/linux-input/CACOZ=ZU0zgRmoRu8X5bMUzUrXA9x-qoDJqrQroUs=+qKR58MQA@mail.gmail.com/T/#t
> -Link to v1:https://lore.kernel.org/linux-input/CACOZ=ZWB3grJKn7wAZEZ0BDyN7KJF4VWUTNs-mPxeoW_oiR7=g@mail.gmail.com/T/#t
> ---
> drivers/hid/hid-input.c | 10 ++++++++++
> include/linux/hid.h | 1 +
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 77c8c49852b5..c6098ae2fac7 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -1225,6 +1225,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);
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index 8677ae38599e..88793b77bd63 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] 7+ messages in thread
* Re: [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID
2023-02-16 9:26 ` qi feng
@ 2023-02-16 10:15 ` Greg KH
0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2023-02-16 10:15 UTC (permalink / raw)
To: qi feng; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel, fengqi
On Thu, Feb 16, 2023 at 05:26:16PM +0800, qi feng wrote:
> loop more
????
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID
2023-02-16 8:48 [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID Qi Feng
2023-02-16 9:26 ` qi feng
@ 2023-02-16 10:18 ` Greg KH
2023-02-16 11:37 ` qi feng
2023-03-10 14:21 ` Jiri Kosina
2 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2023-02-16 10:18 UTC (permalink / raw)
To: Qi Feng; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel, fengqi
On Thu, Feb 16, 2023 at 04:48:30PM +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.
> So we add this event in hid-input.c.
>
> Signed-off-by: fengqi <fengqi@xiaomi.com>
>
> ---
> changes in v4:
>
> -add HID_UP_CAMERA in HID usage tables , Then add the mapping under HID_UP_CAMERA
> -modify the commit log of patch
> -Link to v3:https://lore.kernel.org/linux-input/9a85b268c7636ef2e4e3bbbe318561ba2842a591.1676536357.git.fengqi@xiaomi.com/T/#u
> -Link to v2:https://lore.kernel.org/linux-input/CACOZ=ZU0zgRmoRu8X5bMUzUrXA9x-qoDJqrQroUs=+qKR58MQA@mail.gmail.com/T/#t
> -Link to v1:https://lore.kernel.org/linux-input/CACOZ=ZWB3grJKn7wAZEZ0BDyN7KJF4VWUTNs-mPxeoW_oiR7=g@mail.gmail.com/T/#t
> ---
> drivers/hid/hid-input.c | 10 ++++++++++
> include/linux/hid.h | 1 +
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 77c8c49852b5..c6098ae2fac7 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -1225,6 +1225,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);
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index 8677ae38599e..88793b77bd63 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
>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID
2023-02-16 10:18 ` Greg KH
@ 2023-02-16 11:37 ` qi feng
2023-02-16 11:50 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: qi feng @ 2023-02-16 11:37 UTC (permalink / raw)
To: Greg KH; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel, fengqi
Is there something wrong with this, I can correct it
Greg KH <gregkh@linuxfoundation.org> 于2023年2月16日周四 18:18写道:
>
> On Thu, Feb 16, 2023 at 04:48:30PM +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.
> > So we add this event in hid-input.c.
> >
> > Signed-off-by: fengqi <fengqi@xiaomi.com>
> >
> > ---
> > changes in v4:
> >
> > -add HID_UP_CAMERA in HID usage tables , Then add the mapping under HID_UP_CAMERA
> > -modify the commit log of patch
> > -Link to v3:https://lore.kernel.org/linux-input/9a85b268c7636ef2e4e3bbbe318561ba2842a591.1676536357.git.fengqi@xiaomi.com/T/#u
> > -Link to v2:https://lore.kernel.org/linux-input/CACOZ=ZU0zgRmoRu8X5bMUzUrXA9x-qoDJqrQroUs=+qKR58MQA@mail.gmail.com/T/#t
> > -Link to v1:https://lore.kernel.org/linux-input/CACOZ=ZWB3grJKn7wAZEZ0BDyN7KJF4VWUTNs-mPxeoW_oiR7=g@mail.gmail.com/T/#t
> > ---
> > drivers/hid/hid-input.c | 10 ++++++++++
> > include/linux/hid.h | 1 +
> > 2 files changed, 11 insertions(+)
> >
> > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> > index 77c8c49852b5..c6098ae2fac7 100644
> > --- a/drivers/hid/hid-input.c
> > +++ b/drivers/hid/hid-input.c
> > @@ -1225,6 +1225,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);
> > diff --git a/include/linux/hid.h b/include/linux/hid.h
> > index 8677ae38599e..88793b77bd63 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
> >
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID
2023-02-16 11:37 ` qi feng
@ 2023-02-16 11:50 ` Greg KH
0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2023-02-16 11:50 UTC (permalink / raw)
To: qi feng; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel, fengqi
A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
On Thu, Feb 16, 2023 at 07:37:51PM +0800, qi feng wrote:
> Is there something wrong with this, I can correct it
Nothing wrong at all, look at the bottom of the email where I wrote:
> Greg KH <gregkh@linuxfoundation.org> 于2023年2月16日周四 18:18写道:
> >
> > Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID
2023-02-16 8:48 [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID Qi Feng
2023-02-16 9:26 ` qi feng
2023-02-16 10:18 ` Greg KH
@ 2023-03-10 14:21 ` Jiri Kosina
2 siblings, 0 replies; 7+ messages in thread
From: Jiri Kosina @ 2023-03-10 14:21 UTC (permalink / raw)
To: Qi Feng; +Cc: benjamin.tissoires, linux-input, linux-kernel, fengqi
On Thu, 16 Feb 2023, 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.
> So we add this event in hid-input.c.
>
> Signed-off-by: fengqi <fengqi@xiaomi.com>
Applied, thank you.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-03-10 14:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-16 8:48 [PATCH v4] HID: add KEY_CAMERA_FOCUS event in HID Qi Feng
2023-02-16 9:26 ` qi feng
2023-02-16 10:15 ` Greg KH
2023-02-16 10:18 ` Greg KH
2023-02-16 11:37 ` qi feng
2023-02-16 11:50 ` Greg KH
2023-03-10 14:21 ` Jiri Kosina
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).