All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Dima Zavin <dmitriyz@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Amit Kucheria <amit.kucheria@verdurent.com>,
	Jean Delvare <khali@linux-fr.org>,
	linux-iio@vger.kernel.org
Subject: Re: [GIT PULL] Ambient Light Sensors subsystem
Date: Mon, 08 Mar 2010 10:00:14 +0000	[thread overview]
Message-ID: <4B94CAAE.3040404@cam.ac.uk> (raw)
In-Reply-To: <20100307204213.GB17727@core.coreip.homeip.net>

On 03/07/10 20:42, Dmitry Torokhov wrote:
> On Wed, Mar 03, 2010 at 01:51:07PM -0800, Linus Torvalds wrote:
>>
>>
>> On Wed, 3 Mar 2010, Dima Zavin wrote:
>>>
>>> Actually, accelerometers fit into that model fine. They have some
>>> variable number of absolute axes (3, 6, etc.).
>>
>> In fact, they obviouslya also do end up being used exactly like joysticks 
>> in real life, and joysticks are commonly starting to have accelerometers 
>> in them (ie any modern game console controller).
>>
>> So treating an accelerometer like a joystick - regardless of whether it 
>> happens to be internal to the device or happens to be external in a 
>> separate controller - is not all that far-fetched anyway.
>>
> 
> But the point is that not every accelerometer is a joystick. We have
> hdaps and friends that have accelerometers inside but that is not their
> main purpose (they do export a secondary joystick-like interface and
> that is fine), and I am pretty sure that there are other users of
> accelerometers in various systems.
> 
> I am retty sure that once we settle on the proper interface for such
> sensors we should be able to write a bridge to input layer so they can
> be easily used as [human] input devices in cases whether it is desired.
> 
I agree, this should certainly be possible.

In IIO's case (as that is what I am familiar with), polled input devices
would effectively supply a software trigger that would in turn lead to
the device pushing data into an IIO buffer. In this case the buffer would
just be a direct hook into input.  At the moment, the only complex case
I can think of is passing events (in IIO terminology, these are things
like crossing of thresholds) as they are not pushed out via an interface
that currently has any hooks for in kernel use.  It should be easy enough
to add such hooks though.  Devices where the data flow is interrupt driven
effectively supply their own trigger anyway and are even simpler to handle.

The one remaining thing I'm trying to work out is whether to support switching
the buffer type at runtime (rather fiddly) or just make it a compile time option
(probably what will happen first in any case).

We'll also need some userspace magic to set up the linkage but that should be
fairly straight forward. 1) Request an input-iio-bridge (this will probably
involve also identifying what sort of data is coming in so as to add the
relevant 'header' type information to the input events, 2) Link up the poll
route (done by name) 3) link up the buffer route (also done by name) 4) Attach
the currently non existent 'event' hooks between the two event systems (again
this will need to deal with translation and attaching the 'header' information
that input expects.)

So not too bad. I'll hack together a proof of concept together at some point.

Jonathan

I've cc'd linux-iio to see if anyone else has thoughts on how we would do it.


  reply	other threads:[~2010-03-08  9:58 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 19:41 [GIT PULL] Ambient Light Sensors subsystem Jonathan Cameron
2010-03-03  6:13 ` Dima Zavin
2010-03-03  9:34   ` Jean Delvare
2010-03-03 10:29     ` Dima Zavin
2010-03-03 11:02       ` Jean Delvare
2010-03-03 11:10       ` Jonathan Cameron
2010-03-03 13:07       ` Linus Walleij
2010-03-03 10:30   ` Linus Walleij
2010-03-03 11:19     ` Jonathan Cameron
2010-03-03 17:03   ` Linus Torvalds
2010-03-03 17:51     ` Jonathan Cameron
2010-03-03 18:41     ` Dmitry Torokhov
2010-03-03 18:52       ` Linus Torvalds
2010-03-03 19:07         ` Dmitry Torokhov
2010-03-03 19:33           ` Jonathan Cameron
2010-03-03 20:08             ` Jonathan Cameron
2010-03-03 22:02             ` Jean Delvare
2010-03-03 23:08               ` Dima Zavin
2010-03-04  9:22                 ` Jean Delvare
2010-03-07 20:49                 ` Dmitry Torokhov
2010-03-08  6:29                   ` Dima Zavin
2010-03-05  7:38             ` Amit Kucheria
2010-03-05 10:58               ` Jonathan Cameron
2010-03-03 21:38           ` Dima Zavin
2010-03-03 21:51             ` Linus Torvalds
2010-03-04 11:19               ` Jonathan Cameron
2010-03-07 12:34                 ` Jean Delvare
2010-03-07 12:57                   ` J.I. Cameron
2010-03-08  9:58                 ` Dima Zavin
2010-03-08 10:24                   ` Jonathan Cameron
2010-03-07 20:42               ` Dmitry Torokhov
2010-03-08 10:00                 ` Jonathan Cameron [this message]
2010-03-18 14:34                 ` Jon Smirl
2010-03-03 21:56             ` Mike Chan
2010-03-03 22:05               ` Jean Delvare
2010-03-10 20:46           ` Pavel Machek
2010-03-22  0:13           ` Jan Engelhardt
2010-03-22  4:27             ` Dmitry Torokhov
2010-03-03 19:20         ` Jonathan Cameron
2010-03-03 19:29           ` Manu Abraham
2010-03-03 19:45             ` Jonathan Cameron
2010-03-03 20:08               ` Manu Abraham
2010-03-03 20:37                 ` 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=4B94CAAE.3040404@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=amit.kucheria@verdurent.com \
    --cc=dmitriyz@google.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=torvalds@linux-foundation.org \
    /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.