diff mbox

[v4,1/5] input: event-codes: reserve some space for REL_MISC events

Message ID 34b4f3e6baedde818516ceb1d009f6568b953345.1491917052.git.mchehab@s-opensource.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab April 11, 2017, 1:29 p.m. UTC
The HID input layer has a tendency to map usages to REL_MISC
+1, +2, +3, etc... When it doesn't know how to map an
usage, the core layer maps it to the next one.

So, reserve some space for such events.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 include/linux/mod_devicetable.h        | 2 +-
 include/uapi/linux/input-event-codes.h | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

Comments

Dmitry Torokhov April 15, 2017, 5:55 p.m. UTC | #1
On Tue, Apr 11, 2017 at 10:29:38AM -0300, Mauro Carvalho Chehab wrote:
> The HID input layer has a tendency to map usages to REL_MISC
> +1, +2, +3, etc... When it doesn't know how to map an
> usage, the core layer maps it to the next one.

We should wean HID off this habit. We should not be adding placeholder
events without defined meaning.

> 
> So, reserve some space for such events.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
>  include/linux/mod_devicetable.h        | 2 +-
>  include/uapi/linux/input-event-codes.h | 8 +++++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index 8850fcaf50db..a3e8c572a046 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -286,7 +286,7 @@ struct pcmcia_device_id {
>  #define INPUT_DEVICE_ID_EV_MAX		0x1f
>  #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING	0x71
>  #define INPUT_DEVICE_ID_KEY_MAX		0x2ff
> -#define INPUT_DEVICE_ID_REL_MAX		0x0f
> +#define INPUT_DEVICE_ID_REL_MAX		0x1f
>  #define INPUT_DEVICE_ID_ABS_MAX		0x3f
>  #define INPUT_DEVICE_ID_MSC_MAX		0x07
>  #define INPUT_DEVICE_ID_LED_MAX		0x0f
> diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> index f5a8d96e1e09..444956ba832c 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -704,7 +704,13 @@
>  #define REL_DIAL		0x07
>  #define REL_WHEEL		0x08
>  #define REL_MISC		0x09
> -#define REL_MAX			0x0f
> +#define REL_MISC_1		0x0a
> +#define REL_MISC_2		0x0b
> +#define REL_MISC_3		0x0c
> +#define REL_MISC_4		0x0d
> +#define REL_MISC_5		0x0e
> +#define REL_MISC_6		0x0f
> +#define REL_MAX			0x1f
>  #define REL_CNT			(REL_MAX+1)
>  
>  /*
> -- 
> 2.9.3
>
Benjamin Tissoires June 21, 2017, 12:05 p.m. UTC | #2
On Apr 15 2017 or thereabouts, Dmitry Torokhov wrote:
> On Tue, Apr 11, 2017 at 10:29:38AM -0300, Mauro Carvalho Chehab wrote:
> > The HID input layer has a tendency to map usages to REL_MISC
> > +1, +2, +3, etc... When it doesn't know how to map an
> > usage, the core layer maps it to the next one.
> 
> We should wean HID off this habit. We should not be adding placeholder
> events without defined meaning.

See https://patchwork.kernel.org/patch/9795625/ for such patch.

Feedbacks welcome :)

Cheers,
Benjamin

> 
> > 
> > So, reserve some space for such events.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> > ---
> >  include/linux/mod_devicetable.h        | 2 +-
> >  include/uapi/linux/input-event-codes.h | 8 +++++++-
> >  2 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> > index 8850fcaf50db..a3e8c572a046 100644
> > --- a/include/linux/mod_devicetable.h
> > +++ b/include/linux/mod_devicetable.h
> > @@ -286,7 +286,7 @@ struct pcmcia_device_id {
> >  #define INPUT_DEVICE_ID_EV_MAX		0x1f
> >  #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING	0x71
> >  #define INPUT_DEVICE_ID_KEY_MAX		0x2ff
> > -#define INPUT_DEVICE_ID_REL_MAX		0x0f
> > +#define INPUT_DEVICE_ID_REL_MAX		0x1f
> >  #define INPUT_DEVICE_ID_ABS_MAX		0x3f
> >  #define INPUT_DEVICE_ID_MSC_MAX		0x07
> >  #define INPUT_DEVICE_ID_LED_MAX		0x0f
> > diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> > index f5a8d96e1e09..444956ba832c 100644
> > --- a/include/uapi/linux/input-event-codes.h
> > +++ b/include/uapi/linux/input-event-codes.h
> > @@ -704,7 +704,13 @@
> >  #define REL_DIAL		0x07
> >  #define REL_WHEEL		0x08
> >  #define REL_MISC		0x09
> > -#define REL_MAX			0x0f
> > +#define REL_MISC_1		0x0a
> > +#define REL_MISC_2		0x0b
> > +#define REL_MISC_3		0x0c
> > +#define REL_MISC_4		0x0d
> > +#define REL_MISC_5		0x0e
> > +#define REL_MISC_6		0x0f
> > +#define REL_MAX			0x1f
> >  #define REL_CNT			(REL_MAX+1)
> >  
> >  /*
> > -- 
> > 2.9.3
> > 
> 
> -- 
> Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 8850fcaf50db..a3e8c572a046 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -286,7 +286,7 @@  struct pcmcia_device_id {
 #define INPUT_DEVICE_ID_EV_MAX		0x1f
 #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING	0x71
 #define INPUT_DEVICE_ID_KEY_MAX		0x2ff
-#define INPUT_DEVICE_ID_REL_MAX		0x0f
+#define INPUT_DEVICE_ID_REL_MAX		0x1f
 #define INPUT_DEVICE_ID_ABS_MAX		0x3f
 #define INPUT_DEVICE_ID_MSC_MAX		0x07
 #define INPUT_DEVICE_ID_LED_MAX		0x0f
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index f5a8d96e1e09..444956ba832c 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -704,7 +704,13 @@ 
 #define REL_DIAL		0x07
 #define REL_WHEEL		0x08
 #define REL_MISC		0x09
-#define REL_MAX			0x0f
+#define REL_MISC_1		0x0a
+#define REL_MISC_2		0x0b
+#define REL_MISC_3		0x0c
+#define REL_MISC_4		0x0d
+#define REL_MISC_5		0x0e
+#define REL_MISC_6		0x0f
+#define REL_MAX			0x1f
 #define REL_CNT			(REL_MAX+1)
 
 /*