linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Bill Gatliff <bgat@billgatliff.com>
Cc: linux-input@vger.kernel.org
Subject: Re: Synchronizing evdev readers and drivers?
Date: Sat, 04 Dec 2010 17:46:20 +0000	[thread overview]
Message-ID: <4CFA7E6C.60809@cam.ac.uk> (raw)
In-Reply-To: <AANLkTik8X-Xe9fvYUtRObRBP1PyedOu+zwb1SKKf+kgy@mail.gmail.com>

On 12/02/10 17:26, Bill Gatliff wrote:
> Guys:
> 
> 
> Is there any  way for an input device driver (e.g. something that
> calls input_report_abs() and input_sync()) to know when there is a
> reader of its associated /dev/input/eventX?
> 
> I would love to know when something calls evdev_read() and/or
> evdev_poll(), so that I could then initiate a sampling operation on
> the hardware itself.  Otherwise, I'm forced to periodically poll the
> hardware and that means I'm either gathering data that no application
> wants, or I'm gathering it before (or faster than) an application is
> actually asking for it.
> 
> I have stared at a lot of the evdev and related code, and can't find
> anything that looks like what I want.  Am I just not seeing it, or am
> I looking in the wrong place?
Hi Bill,

It's not entirely relevant, but I thought I'd take this opportunity
to say how we would do the same in IIO.  In our case we have
explicit triggers that cause data to be captured.  At the moment
they are things like dataready signals and periodic timers, but
they are intended to be more general.  The big requirement we have
is that more than one device can be sampled from based on a single
hardware or software event.  This is crucial for some inertial algorithms where
we have to get readings from a number of sensors as close as possible
in time.

On the todo list that exists in my head is a userspace trigger.  That
would allow us to set up as many devices as we want to capture on
a poke from userspace (sysfs file write or something else if lower
overheads are needed).

In our case this fine control of phase of capture is a key requirement
and one that we don't have completely covered as yet.  Right now there
is no consideration of how long a given device takes to get a sample
and they are merely triggered in series. Obviously that time delay
is dependant on hardware state (particularly if low power modes exist
on the device).

Of course this is not all that relevant to input, just thought I'd
mention similar work elsewhere.

Jonathan

      parent reply	other threads:[~2010-12-04 17:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 17:26 Synchronizing evdev readers and drivers? Bill Gatliff
2010-12-02 21:22 ` Dmitry Torokhov
2010-12-02 21:34   ` Bill Gatliff
2010-12-03 12:42     ` Mark Brown
2010-12-03 13:03       ` Bill Gatliff
2010-12-03 13:53         ` Mark Brown
2010-12-03 17:36           ` Bill Gatliff
2010-12-03 18:52             ` Mark Brown
2010-12-03 19:41               ` Bill Gatliff
2010-12-03 22:27                 ` Mark Brown
2010-12-03 23:05                   ` Dmitry Torokhov
2010-12-03 19:50             ` Dmitry Torokhov
2010-12-03 20:17               ` Bill Gatliff
2010-12-03 21:24                 ` Dmitry Torokhov
2010-12-03 19:32     ` Dmitry Torokhov
2010-12-03 19:50       ` Bill Gatliff
2010-12-03 20:56         ` Dmitry Torokhov
2010-12-04 17:52           ` Jonathan Cameron
2010-12-04 18:15           ` Bill Gatliff
2010-12-04 17:46 ` Jonathan Cameron [this message]

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=4CFA7E6C.60809@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=bgat@billgatliff.com \
    --cc=linux-input@vger.kernel.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 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).