All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: linux-input <linux-input@vger.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Eric Piel <eric.piel@tremplin-utc.net>,
	linux-iio <linux-iio@vger.kernel.org>,
	kernel@pyra-handheld.com, lkml <linux-kernel@vger.kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Discussions about the Letux Kernel <letux-kernel@openphoenux.org>,
	Bastien Nocera <hadess@hadess.net>
Subject: Re: [Letux-kernel] [RFC v2] iio: input-bridge: optionally bridge iio acceleometers to create a /dev/input interface
Date: Sat, 8 Jun 2019 11:52:07 +0100	[thread overview]
Message-ID: <20190608115207.22a6fa9a@archlinux> (raw)
In-Reply-To: <CCD87A8D-FF65-4681-964B-22870716D655@goldelico.com>

On Mon, 3 Jun 2019 09:30:40 +0200
H. Nikolaus Schaller <hns@goldelico.com> wrote:

> Hi Jonathan,
> sorry again for the long delay. I just now found a little time to summarize and try to
> get the discussion boiled down to the key difference.
> 
> > Am 11.05.2019 um 13:05 schrieb Jonathan Cameron <jic23@kernel.org>:
> > 
> > On Thu, 9 May 2019 19:02:49 +0200
> > "H. Nikolaus Schaller" <hns@goldelico.com> wrote:
> >   
> >> 
> >> If you close the lid, the display is turned upside down and y and z axes reverse sign.
> >> 
> >> So there remains only the issue that user-space must know which sensor device file is which sensor
> >> and can do the calculation of the lid angle. This is possible because the iio accelerometer name
> >> is available through the input event ioctls.
> >> 
> >> In summary this case also does not need policy or configuration. Just user space using the information
> >> that is already presented.  
> > 
> > I disagree with that last statement.  If there is a lid angle sensor, policy is
> > needed to know which of your associated orientation is the base one and which
> > device indicates the lid angle.  
> 
> > 
> > Actually most of the time what you will do is pick one 'correct' sensor under
> > some configuration of the device and use that.  That is policy.  Yes, you could
> > bake the policy in to device tree, but then you can also bake in the association
> > between the underlying IIO sensor and any virtual input sensor.  
> 
> Ah, maybe I did not understand what you mean by policy here.
> 
> Indeed, choosing the right sensor is always something which is application specific
> and something user-space must obviously dictate. And we agree this should *not* be
> in device tree (or user-space scanning device tree) because that describes hardware
> and not user-space interaction.
> 
> But I still do not think that this requires a new mechanism where user-space
> *tells* the kernel which sensor to use and present as which device.
> 
> Equally well, the kernel can present all sensors it knows about and a set of properties
> that allow the user-space to simply choose the right one ("apply policy"). Properties
> could be file name (e.g. provided by udev), device name, label (provided by DT) or similar.
> 
> If it were absolutely necessary to tell the kernel to map iio devices to something before
> use, I think Bastien would not have been able to implement his library. He also has to
> choose the right sensors. This seems to work and not need a new mechanism.
> 
> > 
> > Anyhow, we still disagree on whether any such virtual input interface
> > should be a userspace policy decision.  So far I haven't seen any compelling
> > argument why it shouldn't be and the flexibility such a policy based interface
> > provides is its major advantage.  
> 
> I still think it is not needed because kernel already provides necessary information
> to user-space to make policy decisions (by ignore unwanted interfaces) without needing
> a new interface where the user-space tells the kernel to activate some interfaces.
> 
> So the key difference is about the question if user-space needs to tell the kernel first
> that it wants to see a specific interface or just makes use of it if present.

Absolutely. Good summary, but I don't think either of us is going
to persuade the other.

I've started work on my proposal but things have been 'interesting' in the
last few weeks so it may be a little while yet before I have anything
to share.

Jonathan

> 
> BR and thanks,
> Nikolaus
> 

  parent reply	other threads:[~2019-06-08 10:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-31 10:09 [RFC v2] iio: input-bridge: optionally bridge iio acceleometers to create a /dev/input interface H. Nikolaus Schaller
2019-04-07 12:30 ` Jonathan Cameron
     [not found]   ` <CD44AFA0-6676-4842-9C80-61BB363DD556@goldelico.com>
2019-04-14 11:40     ` Jonathan Cameron
2019-04-14 16:26       ` Roderick Colenbrander
2019-05-10  8:57         ` Bastien Nocera
2019-05-11 18:47           ` Roderick Colenbrander
     [not found]       ` <CD6219BE-61FF-4C38-9532-054C60A77F89@goldelico.com>
2019-04-22 14:20         ` Jonathan Cameron
2019-05-09  9:09           ` H. Nikolaus Schaller
2019-05-09 17:02             ` [Letux-kernel] " H. Nikolaus Schaller
2019-05-11 11:05               ` Jonathan Cameron
     [not found]                 ` <CCD87A8D-FF65-4681-964B-22870716D655@goldelico.com>
2019-06-08 10:52                   ` Jonathan Cameron [this message]
2019-05-11 10:54             ` Jonathan Cameron
2019-05-10  8:57           ` Bastien Nocera
2019-05-10  9:33             ` H. Nikolaus Schaller
2019-05-10  9:35               ` Bastien Nocera
2019-05-10 10:06                 ` H. Nikolaus Schaller

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=20190608115207.22a6fa9a@archlinux \
    --to=jic23@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=hadess@hadess.net \
    --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-input@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.