diff mbox series

HID: add KEY_CAMERA_FOCUS event in HID

Message ID 20230109123216.4974-1-fengqi706@gmail.com
State New
Headers show
Series HID: add KEY_CAMERA_FOCUS event in HID | expand

Commit Message

Qi Feng Jan. 9, 2023, 12:32 p.m. UTC
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>
---
 drivers/hid/hid-input.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Qi Feng Jan. 10, 2023, 9:53 a.m. UTC | #1
loop more


Qi Feng <fengqi706@gmail.com> 于2023年1月9日周一 20:32写道:
>
> 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>
> ---
>  drivers/hid/hid-input.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 9b59e436df0a..22cca3406b5c 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -1105,6 +1105,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
>                 case 0x0e5: map_key_clear(KEY_BASSBOOST);       break;
>                 case 0x0e9: map_key_clear(KEY_VOLUMEUP);        break;
>                 case 0x0ea: map_key_clear(KEY_VOLUMEDOWN);      break;
> +               case 0x0ee: map_key_clear(KEY_CAMERA_FOCUS);    break;
>                 case 0x0f5: map_key_clear(KEY_SLOW);            break;
>
>                 case 0x181: map_key_clear(KEY_BUTTONCONFIG);    break;
> --
> 2.39.0
>
Qi Feng Jan. 12, 2023, 2:46 a.m. UTC | #2
please help me review this code

thanks a lot

qi feng <fengqi706@gmail.com> 于2023年1月10日周二 17:53写道:
>
> loop more
>
>
> Qi Feng <fengqi706@gmail.com> 于2023年1月9日周一 20:32写道:
> >
> > 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>
> > ---
> >  drivers/hid/hid-input.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> > index 9b59e436df0a..22cca3406b5c 100644
> > --- a/drivers/hid/hid-input.c
> > +++ b/drivers/hid/hid-input.c
> > @@ -1105,6 +1105,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
> >                 case 0x0e5: map_key_clear(KEY_BASSBOOST);       break;
> >                 case 0x0e9: map_key_clear(KEY_VOLUMEUP);        break;
> >                 case 0x0ea: map_key_clear(KEY_VOLUMEDOWN);      break;
> > +               case 0x0ee: map_key_clear(KEY_CAMERA_FOCUS);    break;
> >                 case 0x0f5: map_key_clear(KEY_SLOW);            break;
> >
> >                 case 0x181: map_key_clear(KEY_BUTTONCONFIG);    break;
> > --
> > 2.39.0
> >
Jiri Kosina Jan. 20, 2023, 5:51 p.m. UTC | #3
On Mon, 9 Jan 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>
> ---
>  drivers/hid/hid-input.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 9b59e436df0a..22cca3406b5c 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -1105,6 +1105,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
>  		case 0x0e5: map_key_clear(KEY_BASSBOOST);	break;
>  		case 0x0e9: map_key_clear(KEY_VOLUMEUP);	break;
>  		case 0x0ea: map_key_clear(KEY_VOLUMEDOWN);	break;
> +		case 0x0ee: map_key_clear(KEY_CAMERA_FOCUS);	break;
>  		case 0x0f5: map_key_clear(KEY_SLOW);		break;
>  
>  		case 0x181: map_key_clear(KEY_BUTTONCONFIG);	break;

[ CCing Benjamin ]

Hi,

so according to HUT 1.3.0, 0xeb-0xef are Reserved for now, so I'd be a 
little bit hesitatnt to but this into the generic mapping, as later HUT 
revision might define this in a different way.

Which devices are known to be producing this?
Qi Feng Feb. 2, 2023, 9:56 a.m. UTC | #4
I resubmitted V2 according to the standard, please help me to review it

thanks a lot

Jiri Kosina <jikos@kernel.org> 于2023年1月30日周一 22:28写道:
>
> On Sun, 29 Jan 2023, qi feng wrote:
>
> > Hi,
> > Our Bluetooth Handle needs the focus function, which is missing in the
> > current map
> > If our setting is unreasonable, do you have other suggested values
>
> If the device is under your control, wouldn't it be better to let it
> produce something more defined by HID standard? (see e.g. 0x90 -- Camera
> Control Page).
>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs
>
diff mbox series

Patch

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 9b59e436df0a..22cca3406b5c 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1105,6 +1105,7 @@  static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		case 0x0e5: map_key_clear(KEY_BASSBOOST);	break;
 		case 0x0e9: map_key_clear(KEY_VOLUMEUP);	break;
 		case 0x0ea: map_key_clear(KEY_VOLUMEDOWN);	break;
+		case 0x0ee: map_key_clear(KEY_CAMERA_FOCUS);	break;
 		case 0x0f5: map_key_clear(KEY_SLOW);		break;
 
 		case 0x181: map_key_clear(KEY_BUTTONCONFIG);	break;