Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / iio / Documentation / ring.txt
1 Buffer support within IIO
2
3 This document is intended as a general overview of the functionality
4 a buffer may supply and how it is specified within IIO.  For more
5 specific information on a given buffer implementation, see the
6 comments in the source code.  Note that some drivers allow buffer
7 implementation to be selected at compile time via Kconfig options.
8
9 A given buffer implementation typically embeds a struct
10 iio_ring_buffer and it is a pointer to this that is provided to the
11 IIO core. Access to the embedding structure is typically done via
12 container_of functions.
13
14 struct iio_ring_buffer contains a struct iio_ring_setup_ops *setup_ops
15 which in turn contains the 4 function pointers
16 (preenable, postenable, predisable and postdisable).
17 These are used to perform device specific steps on either side
18 of the core changing its current mode to indicate that the buffer
19 is enabled or disabled (along with enabling triggering etc. as appropriate).
20
21 Also in struct iio_ring_buffer is a struct iio_ring_access_funcs.
22 The function pointers within here are used to allow the core to handle
23 as much buffer functionality as possible. Note almost all of these
24 are optional.
25
26 store_to
27   If possible, push data to the buffer.
28
29 read_last
30   If possible, get the most recent scan from the buffer (without removal).
31   This provides polling like functionality whilst the ring buffering is in
32   use without a separate read from the device.
33
34 rip_first_n
35   The primary buffer reading function. Note that it may well not return
36   as much data as requested.
37
38 request_update
39   If parameters have changed that require reinitialization or configuration of
40   the buffer this will trigger it.
41
42 set_bytes_per_datum
43   Set the number of bytes for a complete scan. (All samples + timestamp)
44
45 set_length
46   Set the number of complete scans that may be held by the buffer.
47