read_raw when buffered sampling enabled
Greetings,
I see in several iio drivers supporting triggered buffer mode that read_raw returns -EBUSY when buffered sampling is enabled. This additional logic is implemented in read_raw using iio_buffer_enabled().
Since some drivers don't implement this I'm wondering wether this logic is an IIO design requirement or if this is device / driver specific.
Regards,
Grégor.
Quoted 9 lines · Gregor Boirie
Greetings,
I see in several iio drivers supporting triggered buffer mode that
read_raw
returns-EBUSYwhen buffered sampling is enabled. This additional logic is implemented inread_rawusingiio_buffer_enabled().
Since some drivers don't implement this I'm wondering wether this logic is
an IIO design requirement or if this is device / driver specific.
Driver specific. Usually depends on whether such a read will
materially effect capture to a buffer. So usually prevent reads if for example a new data interrupt would be skipped or a sequence of data disrupted.
Some devices will read a last captured value out without
effecting the flow so don't need to prevent such reads.
Others do every read on demand, so other than possible bus congestion, there is no
reason to prevent such reads (and congestion is largely beyond our control, is we don't lock the bus up, anyway so who cares!)
I have thought about adding some caching in the core to allow in kernel
polled and push clients to run at the same time but that would require explicit notice that a polled client might want the data and some fun with an additional cache buffer attached.
Jonathan
Quoted 7 lines
Regards,
Grégor.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.