<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/iio, branch v4.8.16</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.8.16</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.8.16'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-08-15T14:39:09Z</updated>
<entry>
<title>iio: sw-trigger: Fix config group initialization</title>
<updated>2016-08-15T14:39:09Z</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2016-07-11T11:50:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b2f0c09664b72b2f8c581383a9337ac3092e42c8'/>
<id>urn:sha1:b2f0c09664b72b2f8c581383a9337ac3092e42c8</id>
<content type='text'>
Use the IS_ENABLED() helper macro to ensure that the configfs group is
initialized either when configfs is built-in or when configfs is built as a
module. Otherwise software trigger creation will result in undefined
behaviour when configfs is built as a mdoule since the configfs group for
the trigger is not properly initialized.

Fixes: b662f809d410 ("iio: core: Introduce IIO software triggers")
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Acked-by: Daniel Baluta &lt;daniel.baluta@intel.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: st_sensors: harden interrupt handling</title>
<updated>2016-07-02T19:40:15Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2016-06-29T13:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=90efe05562921768d34e44c0292703ea3168ba8d'/>
<id>urn:sha1:90efe05562921768d34e44c0292703ea3168ba8d</id>
<content type='text'>
Leonard Crestez observed the following phenomenon: when using
hard interrupt triggers (the DRDY line coming out of an ST
sensor) sometimes a new value would arrive while reading the
previous value, due to latencies in the system.

We discovered that the ST hardware as far as can be observed
is designed for level interrupts: the DRDY line will be held
asserted as long as there are new values coming. The interrupt
handler should be re-entered until we're out of values to
handle from the sensor.

If interrupts were handled as occurring on the edges (usually
low-to-high) new values could appear and the line be held
asserted after that, and these values would be missed, the
interrupt handler would also lock up as new data was
available, but as no new edges occurs on the DRDY signal,
nothing happens: the edge detector only detects edges.

To counter this, do the following:

- Accept interrupt lines to be flagged as level interrupts
  using IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW. If the line
  is marked like this (in the device tree node or ACPI
  table or similar) it will be utilized as a level IRQ.
  We mark the line with IRQF_ONESHOT and mask the IRQ
  while processing a sample, then the top half will be
  entered again if new values are available.

- If we are flagged as using edge interrupts with
  IRQF_TRIGGER_RISING or IRQF_TRIGGER_FALLING: remove
  IRQF_ONESHOT so that the interrupt line is not
  masked while running the thread part of the interrupt.
  This way we will never miss an interrupt, then introduce
  a loop that polls the data ready registers repeatedly
  until no new samples are available, then exit the
  interrupt handler. This way we know no new values are
  available when the interrupt handler exits and
  new (edge) interrupts will be triggered when data arrives.
  Take some extra care to update the timestamp in the poll
  loop if this happens. The timestamp will not be 100%
  perfect, but it will at least be closer to the actual
  events. Usually the extra poll loop will handle the new
  samples, but once in a blue moon, we get a new IRQ
  while exiting the loop, before returning from the
  thread IRQ bottom half with IRQ_HANDLED. On these rare
  occasions, the removal of IRQF_ONESHOT means the
  interrupt will immediately fire again.

- If no interrupt type is indicated from the DT/ACPI,
  choose IRQF_TRIGGER_RISING as default, as this is necessary
  for legacy boards.

Tested successfully on the LIS331DL and L3G4200D by setting
sampling frequency to 400Hz/800Hz and stressing the system:
extra reads in the threaded interrupt handler occurs.

Cc: Giuseppe Barba &lt;giuseppe.barba@st.com&gt;
Cc: Denis Ciocca &lt;denis.ciocca@st.com&gt;
Tested-by: Crestez Dan Leonard &lt;cdleonard@gmail.com&gt;
Reported-by: Crestez Dan Leonard &lt;cdleonard@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio:core: timestamping clock selection support</title>
<updated>2016-06-30T18:41:38Z</updated>
<author>
<name>Gregor Boirie</name>
<email>gregor.boirie@parrot.com</email>
</author>
<published>2016-03-09T18:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bc2b7dab629a51e8beb5fda4222c62a23b729f26'/>
<id>urn:sha1:bc2b7dab629a51e8beb5fda4222c62a23b729f26</id>
<content type='text'>
Adds a new per-device sysfs attribute "current_timestamp_clock" to allow
userspace to select a particular POSIX clock for buffered samples and
events timestamping.

Following clocks, as listed in clock_gettime(2), are supported:
CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW,
CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and
CLOCK_TAI.

Signed-off-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Acked-by: Sanchayan Maity &lt;maitysanchayan@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge 4.7-rc4 into staging-next</title>
<updated>2016-06-20T15:25:44Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-06-20T15:25:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=af52739b922f656eb1f39016fabaabe4baeda2e2'/>
<id>urn:sha1:af52739b922f656eb1f39016fabaabe4baeda2e2</id>
<content type='text'>
We want the fixes in here, and we can resolve a merge issue in
drivers/iio/industrialio-trigger.c

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: st_sensors: switch to a threaded interrupt</title>
<updated>2016-05-29T19:21:41Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2016-05-21T18:43:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=65925b65ed98ffdb277cf5ea1af45731dac0b30b'/>
<id>urn:sha1:65925b65ed98ffdb277cf5ea1af45731dac0b30b</id>
<content type='text'>
commit 98ad8b41f58dff6b30713d7f09ae3834b8df7ded
("iio: st_sensors: verify interrupt event to status") caused
a regression when reading ST sensors from a HRTimer trigger
rather than the intrinsic interrupts: the HRTimer may
trigger faster than the sensor provides new values, and
as the check against new values available as a cause of
the interrupt trigger was done in the poll function,
this would bail out of the HRTimer interrupt with
IRQ_NONE.

So clearly we need to only check the new values available
from the proper interrupt handler and not from the poll
function, which should rather just read the raw values
from the registers, put them into the buffer and be happy.

To achieve this: switch the ST Sensors over to using a true
threaded interrupt handler.

In the interrupt thread, check if new values are available,
else yield to the (potential) next device on the same
interrupt line to check the registers. If the interrupt
was ours, proceed to poll the values.

Instead of relying on iio_trigger_generic_data_rdy_poll() as
a top half to wake up the thread that polls the sensor for
new data, have the thread call iio_trigger_poll_chained()
after determining that is is the proper source of the
interrupt. This is modelled on drivers/iio/accel/mma8452.c
which is already using a properly threaded interrupt handler.

In order to get the same precision in timestamps as
previously, where samples would be timestamped in the
poll function pf-&gt;timestamp when calling
iio_trigger_generic_data_rdy_poll() we introduce a
local timestamp in the sensor data, set it in the top half
(fastpath) of the interrupt handler and provide that to the
core when calling iio_push_to_buffers_with_timestamp().

Additionally: if the active scanmask is not set for the
sensor no IRQs should be enabled and we need to bail out
with IRQ_NONE. This can happen if spurious IRQs fire when
installing the threaded interrupt handler.

Tested with hard interrupt triggers on LIS331DL, then also
tested with hrtimers on the same sensor by creating a 75Hz
HRTimer and using it to poll the sensor.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Giuseppe Barba &lt;giuseppe.barba@st.com&gt;
Cc: Denis Ciocca &lt;denis.ciocca@st.com&gt;
Reported-by: Crestez Dan Leonard &lt;cdleonard@gmail.com&gt;
Tested-by: Crestez Dan Leonard &lt;cdleonard@gmail.com&gt;
Tested-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Fixes: 97865fe41322 ("iio: st_sensors: verify interrupt event to status")
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio:st_sensors: fix power regulator usage</title>
<updated>2016-05-29T15:08:10Z</updated>
<author>
<name>Gregor Boirie</name>
<email>gregor.boirie@parrot.com</email>
</author>
<published>2016-04-19T09:18:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=14f295c846063c4f1812b09427195cee522aa006'/>
<id>urn:sha1:14f295c846063c4f1812b09427195cee522aa006</id>
<content type='text'>
Ensure failure to enable power regulators is properly handled.

Signed-off-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio:st_sensors: unexport st_sensors_get_buffer_element</title>
<updated>2016-05-29T15:00:56Z</updated>
<author>
<name>Gregor Boirie</name>
<email>gregor.boirie@parrot.com</email>
</author>
<published>2016-04-19T09:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dfe3ab1af0765eb800da5ce4cb4c685783096d9c'/>
<id>urn:sha1:dfe3ab1af0765eb800da5ce4cb4c685783096d9c</id>
<content type='text'>
Remove st_sensors_get_buffer_element symbol export since not explicitly
used outside of st_sensors driver.

Signed-off-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: Add support for creating IIO devices via configfs</title>
<updated>2016-05-04T10:43:54Z</updated>
<author>
<name>Daniel Baluta</name>
<email>daniel.baluta@intel.com</email>
</author>
<published>2016-04-25T13:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0f3a8c3f34f728e7c96651bb7271e1c388c9aac2'/>
<id>urn:sha1:0f3a8c3f34f728e7c96651bb7271e1c388c9aac2</id>
<content type='text'>
This is similar with support for creating triggers via configfs.
Devices will be hosted under:
	* /config/iio/devices

We allow users to register "device types" under:
	* /config/iio/devices/&lt;device_types&gt;/

Signed-off-by: Daniel Baluta &lt;daniel.baluta@intel.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio:ak8975: add mounting matrix support</title>
<updated>2016-04-23T21:14:34Z</updated>
<author>
<name>Gregor Boirie</name>
<email>gregor.boirie@parrot.com</email>
</author>
<published>2016-04-20T17:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=97eacb9166f4810368e180073dcbceeff0de34df'/>
<id>urn:sha1:97eacb9166f4810368e180073dcbceeff0de34df</id>
<content type='text'>
Expose a rotation matrix to indicate userspace the chip orientation with
respect to the overall hardware system.
Matrix is retrieved from "in_mount_matrix". It is declared into ak8975 DTS
entry as a "mount-matrix" property.

Signed-off-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio:core: mounting matrix support</title>
<updated>2016-04-23T21:13:05Z</updated>
<author>
<name>Gregor Boirie</name>
<email>gregor.boirie@parrot.com</email>
</author>
<published>2016-04-20T17:23:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dfc57732ad38f93ae6232a3b4e64fd077383a0f1'/>
<id>urn:sha1:dfc57732ad38f93ae6232a3b4e64fd077383a0f1</id>
<content type='text'>
Expose a rotation matrix to indicate userspace the chip placement with
respect to the overall hardware system. This is needed to adjust
coordinates sampled from a sensor chip when its position deviates from the
main hardware system.

Final coordinates computation is delegated to userspace since:
* computation may involve floating point arithmetics ;
* it allows an application to combine adjustments with arbitrary
  transformations.

This 3 dimentional space rotation matrix is expressed as 3x3 array of
strings to support floating point numbers. It may be retrieved from a
"[&lt;dir&gt;_][&lt;type&gt;_]mount_matrix" sysfs attribute file. It is declared into a
device / driver specific DTS property or platform data.

Signed-off-by: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
</feed>
