linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: Add MT_TOOL_PALM
@ 2015-03-18 22:26 Charlie Mooney
  2015-03-19 22:41 ` Peter Hutterer
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Mooney @ 2015-03-18 22:26 UTC (permalink / raw)
  To: linux-input
  Cc: Benjamin Tissoires, Hans de Goede, Peter Hutterer,
	Andrew De Los Reyes, Henrik Rydberg, Jonathan Corbet,
	Dmitry Torokhov, Charlie Mooney, Masanari Iida, Jiri Kosina,
	linux-doc, linux-kernel, linux-api

Currently there are only two "tools" that can be specified by a
multi-touch driver: MT_TOOL_FINGER and MT_TOOL_PEN.  In working with
Elan (The touch vendor) and discussing their next-gen devices it
seems that it will be useful to have more tools so that their devices
can give the upper layers of the stack hints as to what is touching
the sensor.

In particular they have new experimental firmware that can better
differentiate between palms vs fingertips and would like to plumb a
patch so that we can use their hints in higher-level gesture soft-
ware.  The firmware on the device can reasonably do a better job of
palm detection because it has access to all of the raw sensor readings
as opposed to just the width/pressure/etc that are exposed by the
driver.  As such, the firmware can characterize what a palm looks like
in much finer-grained detail and this change would allow such a
device to share its findings with the kernel.

Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
---
 Documentation/input/multi-touch-protocol.txt | 9 ++++++---
 include/uapi/linux/input.h                   | 3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index 7b4f59c..b85d000 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -312,9 +312,12 @@ ABS_MT_TOOL_TYPE
 
 The type of approaching tool. A lot of kernel drivers cannot distinguish
 between different tool types, such as a finger or a pen. In such cases, the
-event should be omitted. The protocol currently supports MT_TOOL_FINGER and
-MT_TOOL_PEN [2]. For type B devices, this event is handled by input core;
-drivers should instead use input_mt_report_slot_state().
+event should be omitted. The protocol currently supports MT_TOOL_FINGER,
+MT_TOOL_PEN, and MT_TOOL_PALM [2]. For type B devices, this event is handled
+by input core; drivers should instead use input_mt_report_slot_state().
+A contact's ABS_MT_TOOL_TYPE may change over time while still touching the
+device, because the firmware may not be able to determine which tool is being
+used when it first appears.
 
 ABS_MT_BLOB_ID
 
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index b0a8130..2f62ab2 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -973,7 +973,8 @@ struct input_keymap_entry {
  */
 #define MT_TOOL_FINGER		0
 #define MT_TOOL_PEN		1
-#define MT_TOOL_MAX		1
+#define MT_TOOL_PALM		2
+#define MT_TOOL_MAX		2
 
 /*
  * Values describing the status of a force-feedback effect
-- 
2.1.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: Add MT_TOOL_PALM
  2015-03-18 22:26 [PATCH] Input: Add MT_TOOL_PALM Charlie Mooney
@ 2015-03-19 22:41 ` Peter Hutterer
  2015-03-20 16:44   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Hutterer @ 2015-03-19 22:41 UTC (permalink / raw)
  To: Charlie Mooney
  Cc: linux-input, Benjamin Tissoires, Hans de Goede,
	Andrew De Los Reyes, Henrik Rydberg, Jonathan Corbet,
	Dmitry Torokhov, Masanari Iida, Jiri Kosina, linux-doc,
	linux-kernel, linux-api

On Wed, Mar 18, 2015 at 03:26:35PM -0700, Charlie Mooney wrote:
> Currently there are only two "tools" that can be specified by a
> multi-touch driver: MT_TOOL_FINGER and MT_TOOL_PEN.  In working with
> Elan (The touch vendor) and discussing their next-gen devices it
> seems that it will be useful to have more tools so that their devices
> can give the upper layers of the stack hints as to what is touching
> the sensor.
> 
> In particular they have new experimental firmware that can better
> differentiate between palms vs fingertips and would like to plumb a
> patch so that we can use their hints in higher-level gesture soft-
> ware.  The firmware on the device can reasonably do a better job of
> palm detection because it has access to all of the raw sensor readings
> as opposed to just the width/pressure/etc that are exposed by the
> driver.  As such, the firmware can characterize what a palm looks like
> in much finer-grained detail and this change would allow such a
> device to share its findings with the kernel.
> 
> Signed-off-by: Charlie Mooney <charliemooney@chromium.org>

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>

Cheers,
   Peter

> ---
>  Documentation/input/multi-touch-protocol.txt | 9 ++++++---
>  include/uapi/linux/input.h                   | 3 ++-
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
> index 7b4f59c..b85d000 100644
> --- a/Documentation/input/multi-touch-protocol.txt
> +++ b/Documentation/input/multi-touch-protocol.txt
> @@ -312,9 +312,12 @@ ABS_MT_TOOL_TYPE
>  
>  The type of approaching tool. A lot of kernel drivers cannot distinguish
>  between different tool types, such as a finger or a pen. In such cases, the
> -event should be omitted. The protocol currently supports MT_TOOL_FINGER and
> -MT_TOOL_PEN [2]. For type B devices, this event is handled by input core;
> -drivers should instead use input_mt_report_slot_state().
> +event should be omitted. The protocol currently supports MT_TOOL_FINGER,
> +MT_TOOL_PEN, and MT_TOOL_PALM [2]. For type B devices, this event is handled
> +by input core; drivers should instead use input_mt_report_slot_state().
> +A contact's ABS_MT_TOOL_TYPE may change over time while still touching the
> +device, because the firmware may not be able to determine which tool is being
> +used when it first appears.
>  
>  ABS_MT_BLOB_ID
>  
> diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
> index b0a8130..2f62ab2 100644
> --- a/include/uapi/linux/input.h
> +++ b/include/uapi/linux/input.h
> @@ -973,7 +973,8 @@ struct input_keymap_entry {
>   */
>  #define MT_TOOL_FINGER		0
>  #define MT_TOOL_PEN		1
> -#define MT_TOOL_MAX		1
> +#define MT_TOOL_PALM		2
> +#define MT_TOOL_MAX		2
>  
>  /*
>   * Values describing the status of a force-feedback effect
> -- 
> 2.1.2
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: Add MT_TOOL_PALM
  2015-03-19 22:41 ` Peter Hutterer
@ 2015-03-20 16:44   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2015-03-20 16:44 UTC (permalink / raw)
  To: Peter Hutterer
  Cc: Charlie Mooney, linux-input, Benjamin Tissoires, Hans de Goede,
	Andrew De Los Reyes, Henrik Rydberg, Jonathan Corbet,
	Masanari Iida, Jiri Kosina, linux-doc, linux-kernel, linux-api

On Fri, Mar 20, 2015 at 08:41:55AM +1000, Peter Hutterer wrote:
> On Wed, Mar 18, 2015 at 03:26:35PM -0700, Charlie Mooney wrote:
> > Currently there are only two "tools" that can be specified by a
> > multi-touch driver: MT_TOOL_FINGER and MT_TOOL_PEN.  In working with
> > Elan (The touch vendor) and discussing their next-gen devices it
> > seems that it will be useful to have more tools so that their devices
> > can give the upper layers of the stack hints as to what is touching
> > the sensor.
> > 
> > In particular they have new experimental firmware that can better
> > differentiate between palms vs fingertips and would like to plumb a
> > patch so that we can use their hints in higher-level gesture soft-
> > ware.  The firmware on the device can reasonably do a better job of
> > palm detection because it has access to all of the raw sensor readings
> > as opposed to just the width/pressure/etc that are exposed by the
> > driver.  As such, the firmware can characterize what a palm looks like
> > in much finer-grained detail and this change would allow such a
> > device to share its findings with the kernel.
> > 
> > Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
> 
> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>

Applied, thank you.

> 
> Cheers,
>    Peter
> 
> > ---
> >  Documentation/input/multi-touch-protocol.txt | 9 ++++++---
> >  include/uapi/linux/input.h                   | 3 ++-
> >  2 files changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
> > index 7b4f59c..b85d000 100644
> > --- a/Documentation/input/multi-touch-protocol.txt
> > +++ b/Documentation/input/multi-touch-protocol.txt
> > @@ -312,9 +312,12 @@ ABS_MT_TOOL_TYPE
> >  
> >  The type of approaching tool. A lot of kernel drivers cannot distinguish
> >  between different tool types, such as a finger or a pen. In such cases, the
> > -event should be omitted. The protocol currently supports MT_TOOL_FINGER and
> > -MT_TOOL_PEN [2]. For type B devices, this event is handled by input core;
> > -drivers should instead use input_mt_report_slot_state().
> > +event should be omitted. The protocol currently supports MT_TOOL_FINGER,
> > +MT_TOOL_PEN, and MT_TOOL_PALM [2]. For type B devices, this event is handled
> > +by input core; drivers should instead use input_mt_report_slot_state().
> > +A contact's ABS_MT_TOOL_TYPE may change over time while still touching the
> > +device, because the firmware may not be able to determine which tool is being
> > +used when it first appears.
> >  
> >  ABS_MT_BLOB_ID
> >  
> > diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
> > index b0a8130..2f62ab2 100644
> > --- a/include/uapi/linux/input.h
> > +++ b/include/uapi/linux/input.h
> > @@ -973,7 +973,8 @@ struct input_keymap_entry {
> >   */
> >  #define MT_TOOL_FINGER		0
> >  #define MT_TOOL_PEN		1
> > -#define MT_TOOL_MAX		1
> > +#define MT_TOOL_PALM		2
> > +#define MT_TOOL_MAX		2
> >  
> >  /*
> >   * Values describing the status of a force-feedback effect
> > -- 
> > 2.1.2
> > 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-20 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18 22:26 [PATCH] Input: Add MT_TOOL_PALM Charlie Mooney
2015-03-19 22:41 ` Peter Hutterer
2015-03-20 16:44   ` Dmitry Torokhov

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).