public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Jonathan Cameron <jic23@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: hardware buffer enabling
Date: Tue, 06 May 2014 09:56:00 -0700	[thread overview]
Message-ID: <53691420.8060503@linux.intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]

Hi Jonathan,

The Android user space has some capability to ask the supported hardware 
to enable buffering in hardware.
I don't think that we can achieve this by current ABI.  Do you want me 
to propose new ABI?

"
Android batch mode:
batch(int handle, int flags, int64_t period_ns, int64_t max_report_latency)

Enabling batch mode for a given sensor sets the delay between events. 
max_report_latency sets the maximum time by which events can be delayed 
and batched together before being reported to the applications. A value 
of zero disables batch mode for the given sensor. The period_ns 
parameter is equivalent to calling setDelay() -- this function both 
enables or disables the batch mode AND sets the event's period in 
nanoseconds. See setDelay() for a detailed explanation of the period_ns 
parameter.

In non-batch mode, all sensor events must be reported as soon as they 
are detected. For example, an accelerometer activated at 50Hz will 
trigger interrupts 50 times per second.
While in batch mode, sensor events do not need to be reported as soon as 
they are detected. They can be temporarily stored and reported in 
batches, as long as no event is delayed by more than maxReportingLatency 
nanoseconds. That is, all events since the previous batch are recorded 
and returned at once. This reduces the amount of interrupts sent to the 
SoC and allows the SoC to switch to a lower power mode (idle) while the 
sensor is capturing and batching data.

setDelay() is not affected and it behaves as usual.

Each event has a timestamp associated with it. The timestamp must be 
accurate and correspond to the time at which the event physically happened.

Batching does not modify the behavior of poll(): batches from different 
sensors can be interleaved and split. As usual, all events from the same 
sensor are time-ordered.
"


Thanks,
Srinivas


[-- Attachment #2: Type: text/html, Size: 2884 bytes --]

             reply	other threads:[~2014-05-06 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06 16:56 Srinivas Pandruvada [this message]
2014-05-07 20:03 ` hardware buffer enabling Jonathan Cameron
2014-05-08 16:17   ` Srinivas Pandruvada
2014-05-10 10:50     ` 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=53691420.8060503@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@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