public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Hutterer <peter.hutterer@who-t.net>
To: Roderick Colenbrander <roderick@gaikai.com>
Cc: linux-input@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Jiri Kosina <jikos@kernel.org>,
	Roderick Colenbrander <roderick.colenbrander@sony.com>
Subject: Re: [PATCH 1/3] Input: Add new property INPUT_PROP_COMPOSITE
Date: Fri, 18 Aug 2017 13:24:54 +1000	[thread overview]
Message-ID: <20170818032454.GA1254@jelly> (raw)
In-Reply-To: <20170818020156.23390-2-roderick@gaikai.com>

On Thu, Aug 17, 2017 at 07:01:54PM -0700, Roderick Colenbrander wrote:
> From: Roderick Colenbrander <roderick.colenbrander@sony.com>
> 
> This new property can be set on subdevices part of a composite
> input device. The purpose of the constant is to notify other
> kernel components (e.g. joydev) and user space that a device is
> a composite device.
> 
> Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
> ---
>  Documentation/input/event-codes.rst    | 12 ++++++++++++
>  include/uapi/linux/input-event-codes.h |  1 +
>  2 files changed, 13 insertions(+)
> 
> diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst
> index a8c0873..d56a32e 100644
> --- a/Documentation/input/event-codes.rst
> +++ b/Documentation/input/event-codes.rst
> @@ -356,6 +356,18 @@ can report through the rotational axes (absolute and/or relative rx, ry, rz).
>  All other axes retain their meaning. A device must not mix
>  regular directional axes and accelerometer axes on the same event node.
>  
> +INPUT_PROP_COMPOSITE
> +--------------------
> +
> +The functionality of some advanced input devices is exposed through several
> +event devices. For example a gamepad with motion sensors could be exposed as
> +a gamepad device with axes / buttons and a separate motion sensor device.
> +
> +The INPUT_PROP_COMPOSITE flag is set on all sub devices making up a larger
> +composite device. This flag allows user space applications in addition to
> +other kernel drivers (e.g. joydev) to easily determine whether a device
> +is part of a composite device.

honestly, I would love for this to be paired with an ioctl that can give me
the sysnames of the other devices. Or (probably safer) just a unique
number/string that all composite devices share.

That way I can reassemble this in userspace. We already do something like
this for the libinput device groups and I think just having the input
property isn't quite enough. We can already guess a lot of this from the
PHYS attributes but there are several devices where having this filled by
the kernel is going to be useful. Wacom devices for example where the pen
and touch device don't share the same pid.

Right now, it's a bit too simple - all this flag gives me is the
notification that I have to start looking for other devices. Works fine with
one composited device connected, but once you look at more than that it
doesn't seem to be overly useful.

Cheers,
   Peter


> +
>  Guidelines
>  ==========
>  
> diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> index 1798910..da3fa83 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -26,6 +26,7 @@
>  #define INPUT_PROP_TOPBUTTONPAD		0x04	/* softbuttons at top of pad */
>  #define INPUT_PROP_POINTING_STICK	0x05	/* is a pointing stick */
>  #define INPUT_PROP_ACCELEROMETER	0x06	/* has accelerometer */
> +#define INPUT_PROP_COMPOSITE		0x07	/* is part of a composite device */
>  
>  #define INPUT_PROP_MAX			0x1f
>  #define INPUT_PROP_CNT			(INPUT_PROP_MAX + 1)
> -- 
> 2.9.4

  reply	other threads:[~2017-08-18  3:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  2:01 [PATCH v2 0/3] Input/HID: joydev fixes for motion sensors Roderick Colenbrander
2017-08-18  2:01 ` [PATCH 1/3] Input: Add new property INPUT_PROP_COMPOSITE Roderick Colenbrander
2017-08-18  3:24   ` Peter Hutterer [this message]
2017-08-22 23:34     ` Colenbrander, Roelof
2017-08-23  5:54       ` Peter Hutterer
2017-08-18  2:01 ` [PATCH 2/3] HID: sony: Set INPUT_PROP_COMPOSITE flag on sub devices Roderick Colenbrander
2017-08-23  8:50   ` Bastien Nocera
2017-08-23 23:46     ` Roderick Colenbrander
2017-08-18  2:01 ` [PATCH 3/3] Input: joydev - ignore accelerometer devices Roderick Colenbrander
2017-08-23  8:45   ` Bastien Nocera
2017-08-24  0:01     ` Roderick Colenbrander
2017-08-23  9:04 ` [PATCH v2 0/3] Input/HID: joydev fixes for motion sensors Bastien Nocera
2017-08-23 23:57   ` Roderick Colenbrander
2017-08-24  0:08     ` Bastien Nocera
2017-08-24  0:59       ` Roderick Colenbrander
2017-08-23  9:08 ` Bastien Nocera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170818032454.GA1254@jelly \
    --to=peter.hutterer@who-t.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=roderick.colenbrander@sony.com \
    --cc=roderick@gaikai.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox