linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: letux-kernel@openphoenux.org, kernel@pyra-handheld.com,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [RFC 0/4] iio-input-bridge so that accelerometers which only have an iio driver can still present evdev input events
Date: Sun, 24 Mar 2019 18:29:30 +0000	[thread overview]
Message-ID: <20190324182920.66242add@archlinux> (raw)
In-Reply-To: <cover.1552941573.git.hns@goldelico.com>

On Mon, 18 Mar 2019 21:39:30 +0100
"H. Nikolaus Schaller" <hns@goldelico.com> wrote:

	
> Some user spaces (e.g. some Android) use /dev/input/event* for handling the 3D
> position of the device with respect to the center of gravity (earth). This can
> be used for gaming input, rotation of screens etc.
> 
> This should be the standard because this interface is an abstraction of how
> this data is acquired from sensor chips. Sensor chips may be connected through
> different interfaces and in different positions. They may also have different
> parameters. And, if a chip is replaced by a different one, the values reported
> by the device position interface should remain the same.
> 
> But nowadays, new accelerometer chips usually just get iio drivers and rarely
> an evdev input driver.
> 
> Therefore we need something like a protocol stack: input device vs. raw data.
> It can be seen as a similar layering like TCP/IP vs. bare Ethernet. Or keyboard
> input events vs. raw gpio or raw USB access.
> 
> This patch set bridges the gap between raw iio data and the input device abstraction
> so that accelerometer measurements can also be presented as X/Y/Z accelerometer
> channels (INPUT_PROP_ACCELEROMETER) through /dev/input/event*.
> 
Hi,

I've kind of run out of time today and want to give this a detailed look.

In the meantime a few initial comments.

1. Resend the whole series cc'ing the linux-input list and maintainer.
2. In the vast majority of devices the interrupt pin is connected for an
   accelerometer. and they support data ready signals.  My gut feeling is
   that should be the preferred mode.  It was for that use case that we originally
   put all the demux and multiple buffer code in IIO. The original series for
   that actually had an input bridge.
https://lore.kernel.org/linux-iio/1351679431-7963-5-git-send-email-jic23@kernel.org/

3. It's going to be a hard sell to have it 'always' map an accelerometer in IIO
   to an input device when configured.  There are lots of other accelerometer use
   cases where this would be crazy.  In the repost, give some comentary perhaps on
   the following options:
   a) Explicit binding - like the iio-hwmon bridge.
   b) A userspace bridge (I even wrote one of those years ago using uevent)
   c) Some sort of userspace triggered way of creating these on demand.

4. Input has polled modes. Don't reinvent them.

5. The patch break up is very very random.  Just have one patch :)

Anyhow, I'll take a look in detail but may be a little while.

Thanks,

Jonathan


> 
> H. Nikolaus Schaller (4):
>   iio: input-bridge: optionally bridge iio acceleometers to create a
>     /dev/input
>   iio: input-bridge: add iio-input-bridge to Makefile
>   iio: input-bridge: add IIO_INPUT_BRIDGE kernel config option
>   iio: input-bridge: make the iio-input-bridge driver called by iio-core
> 
>  drivers/iio/Kconfig                    |   7 +
>  drivers/iio/Makefile                   |   1 +
>  drivers/iio/industrialio-core.c        |  12 +
>  drivers/iio/industrialio-inputbridge.c | 420 +++++++++++++++++++++++++
>  drivers/iio/industrialio-inputbridge.h |  28 ++
>  5 files changed, 468 insertions(+)
>  create mode 100644 drivers/iio/industrialio-inputbridge.c
>  create mode 100644 drivers/iio/industrialio-inputbridge.h
> 


  parent reply	other threads:[~2019-03-24 18:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 20:39 [RFC 0/4] iio-input-bridge so that accelerometers which only have an iio driver can still present evdev input events H. Nikolaus Schaller
2019-03-18 20:39 ` [RFC 1/4] iio: input-bridge: optionally bridge iio acceleometers to create a /dev/input H. Nikolaus Schaller
2019-03-18 20:39 ` [RFC 2/4] iio: input-bridge: add iio-input-bridge to Makefile H. Nikolaus Schaller
2019-03-18 20:39 ` [RFC 3/4] iio: input-bridge: add IIO_INPUT_BRIDGE kernel config option H. Nikolaus Schaller
2019-03-18 20:39 ` [RFC 4/4] iio: input-bridge: make the iio-input-bridge driver called by iio-core H. Nikolaus Schaller
2019-03-24 18:29 ` Jonathan Cameron [this message]
2019-03-28 17:42   ` [RFC 0/4] iio-input-bridge so that accelerometers which only have an iio driver can still present evdev input events H. Nikolaus Schaller
2019-03-31 10:09     ` H. Nikolaus Schaller
2019-03-31 11:05     ` Jonathan Cameron

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=20190324182920.66242add@archlinux \
    --to=jic23@kernel.org \
    --cc=hns@goldelico.com \
    --cc=kernel@pyra-handheld.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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;
as well as URLs for NNTP newsgroup(s).