tmp_suning_uos_patched/drivers/iio
Octavian Purdila f4f4673b75 iio: add support for hardware fifo
Some devices have hardware buffers that can store a number of samples
for later consumption. Hardware usually provides interrupts to notify
the processor when the FIFO is full or when it has reached a certain
watermark level. This helps with reducing the number of interrupts to
the host processor and thus it helps decreasing the power consumption.

This patch enables usage of hardware FIFOs for IIO devices in
conjunction with software device buffers. When the hardware FIFO is
enabled the samples are stored in the hardware FIFO. The samples are
later flushed to the device software buffer when the number of entries
in the hardware FIFO reaches the hardware watermark or when a flush
operation is triggered by the user when doing a non-blocking read
on an empty software device buffer.

In order to implement hardware FIFO support the device drivers must
implement the following new operations: setting and getting the
hardware FIFO watermark level, flushing the hardware FIFO to the
software device buffer. The device must also expose information about
the hardware FIFO such it's minimum and maximum watermark and if
necessary a list of supported watermark values. Finally, the device
driver must activate the hardware FIFO when the device buffer is
enabled, if the current device settings allows it.

The software device buffer watermark is passed by the IIO core to the
device driver as a hint for the hardware FIFO watermark. The device
driver can adjust this value to allow for hardware limitations (such
as capping it to the maximum hardware watermark or adjust it to a
value that is supported by the hardware). It can also disable the
hardware watermark (and implicitly the hardware FIFO) it this value is
below the minimum hardware watermark.

Since a driver may support hardware FIFO only when not in triggered
buffer mode (due to different semantics of hardware FIFO sampling and
triggered sampling) this patch changes the IIO core code to allow
falling back to non-triggered buffered mode if no trigger is enabled.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-29 16:17:10 +01:00
..
accel iio: st-sensors: add support for lis3lv02d accelerometer 2015-03-28 10:55:36 +00:00
adc First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle. 2015-03-24 22:53:52 +01:00
amplifiers
common iio: constify of_device_id array 2015-03-28 10:55:37 +00:00
dac iio: max517: Add support for MAX520 and MAX521 chips. 2015-03-28 10:57:34 +00:00
frequency
gyro IIO: Add support for L3GD20H gyroscope 2015-03-28 11:13:35 +00:00
humidity
imu First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle. 2015-03-24 22:53:52 +01:00
light First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle. 2015-03-24 22:53:52 +01:00
magnetometer
orientation
pressure iio: pressure: add support for MS5611 pressure and temperature sensor 2015-03-15 11:47:46 +00:00
proximity
temperature iio: mlx90614: Refactor register symbols 2015-03-09 14:56:58 +00:00
trigger
buffer_cb.c
iio_core_trigger.h
iio_core.h
industrialio-buffer.c iio: add support for hardware fifo 2015-03-29 16:17:10 +01:00
industrialio-core.c
industrialio-event.c
industrialio-trigger.c
industrialio-triggered-buffer.c
inkern.c
Kconfig
kfifo_buf.c iio: add watermark logic to iio read and poll 2015-03-29 16:17:09 +01:00
Makefile