public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* Question about having multiple timestamp channels
@ 2019-05-23 17:40 Enrico Granata
  2019-05-26 15:29 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Enrico Granata @ 2019-05-23 17:40 UTC (permalink / raw)
  To: linux-iio; +Cc: chromeos-sensors

Hi,
on Chrome OS devices, the architecture for sensors (such as
accelerometer and gyroscope) involves the sensors being connected to
an embedded controller, which receives interrupts from the IMU,
collects samples, and then sends an interrupt to the main CPU running
Linux.

On the CPU, there currently is an IIO device called sensor_ring, which
handles the interrupt by collecting the samples from the EC, and
pushes them to an IIO buffer.

As part of the EC --> AP communication mechanism, we collect:
- the time (in EC clock) when the sensor notified the EC;
- the time (in EC clock) when the embedded controller sent the interrupt;
- the time (in Linux clock) when the CPU received the interrupt.

We use these values (which we call respectively "a" "b" and "c"), as
input to a median filter in order to both convert EC clock to Linux
clock, and to smooth out jitter.

We have since come to realize that a median is not the best filter for
this task, and - as part of a larger redesign - would like to move
this filtering in userspace and use a different filter (most likely
either a least squares or a Kalman filter).

However, doing the filtering in userland requires us to be able to
send the a, b and c points from the IIO device on the kernel to
userspace.

My initial investigation led me to using indexing as the most viable
option to have multiple IIO_TIMESTAMP channels defined for the same
device. However, I spot a few places in the IIO framework where
channels of kind TIMESTAMP seem to have special meaning.

Is defining multiple timestamp channels via indexing a supported
operation? If not, is there any way to define such channels? Or a
better way to support our use case of providing 3 "timestamp" values
to userspace.

Any input is appreciated.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-08 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-23 17:40 Question about having multiple timestamp channels Enrico Granata
2019-05-26 15:29 ` Jonathan Cameron
2019-05-28 17:32   ` Enrico Granata
2019-06-08 11:12     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox