<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/iio/buffer.h, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-10-19T07:30:44+00:00</updated>
<entry>
<title>iio: Add output buffer support</title>
<updated>2021-10-19T07:30:44+00:00</updated>
<author>
<name>Mihail Chindris</name>
<email>mihail.chindris@analog.com</email>
</author>
<published>2021-10-07T08:00:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9eeee3b0bf190b4f677af27e24ba0cd1c030e49b'/>
<id>urn:sha1:9eeee3b0bf190b4f677af27e24ba0cd1c030e49b</id>
<content type='text'>
Currently IIO only supports buffer mode for capture devices like ADCs. Add
support for buffered mode for output devices like DACs.

The output buffer implementation is analogous to the input buffer
implementation. Instead of using read() to get data from the buffer write()
is used to copy data into the buffer.

poll() with POLLOUT will wakeup if there is space available.

Drivers can remove data from a buffer using iio_pop_from_buffer(), the
function can e.g. called from a trigger handler to write the data to
hardware.

A buffer can only be either a output buffer or an input, but not both. So,
for a device that has an ADC and DAC path, this will mean 2 IIO buffers
(one for each direction).

The direction of the buffer is decided by the new direction field of the
iio_buffer struct and should be set after allocating and before registering
it.

Co-developed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Co-developed-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Signed-off-by: Mihail Chindris &lt;mihail.chindris@analog.com&gt;
Link: https://lore.kernel.org/r/20211007080035.2531-2-mihail.chindris@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: core: Introduce iio_push_to_buffers_with_ts_unaligned()</title>
<updated>2021-10-19T07:29:22+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-06-13T15:10:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=95ec3fdf2b79eaff79e78688bbc2f7dbb98d68b6'/>
<id>urn:sha1:95ec3fdf2b79eaff79e78688bbc2f7dbb98d68b6</id>
<content type='text'>
Whilst it is almost always possible to arrange for scan data to be
read directly into a buffer that is suitable for passing to
iio_push_to_buffers_with_timestamp(), there are a few places where
leading data needs to be skipped over.

For these cases introduce a function that will allocate an appropriate
sized and aligned bounce buffer (if not already allocated) and copy
the unaligned data into that before calling
iio_push_to_buffers_with_timestamp() on the bounce buffer.
We tie the lifespace of this buffer to that of the iio_dev.dev
which should ensure no memory leaks occur.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Link: https://lore.kernel.org/r/20210613151039.569883-2-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: buffer: introduce support for attaching more IIO buffers</title>
<updated>2021-03-11T20:47:05+00:00</updated>
<author>
<name>Alexandru Ardelean</name>
<email>alexandru.ardelean@analog.com</email>
</author>
<published>2021-02-15T10:40:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ee708e6baacd3afdace9b721c25fbbe106cebb94'/>
<id>urn:sha1:ee708e6baacd3afdace9b721c25fbbe106cebb94</id>
<content type='text'>
With this change, calling iio_device_attach_buffer() will actually attach
more buffers.
Right now this doesn't do any validation of whether a buffer is attached
twice; maybe that can be added later (if needed). Attaching a buffer more
than once should yield noticeably bad results.

The first buffer is the legacy buffer, so a reference is kept to it.

At this point, accessing the data for the extra buffers (that are added
after the first one) isn't possible yet.

The iio_device_attach_buffer() is also changed to return an error code,
which for now is -ENOMEM if the array could not be realloc-ed for more
buffers.
To adapt to this new change iio_device_attach_buffer() is called last in
all place where it's called. The realloc failure is a bit difficult to
handle during un-managed calls when unwinding, so it's better to have this
as the last error in the setup_buffer calls.

At this point, no driver should call iio_device_attach_buffer() directly,
it should call one of the {devm_}iio_triggered_buffer_setup() or
devm_iio_kfifo_buffer_setup() or devm_iio_dmaengine_buffer_setup()
functions. This makes iio_device_attach_buffer() a bit easier to handle.

Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Link: https://lore.kernel.org/r/20210215104043.91251-20-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: buffer: remove iio_buffer_set_attrs() helper</title>
<updated>2020-11-21T14:53:37+00:00</updated>
<author>
<name>Alexandru Ardelean</name>
<email>alexandru.ardelean@analog.com</email>
</author>
<published>2020-09-29T12:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=21232b4456ba5e1eea7385bd3c4b1994994fd409'/>
<id>urn:sha1:21232b4456ba5e1eea7385bd3c4b1994994fd409</id>
<content type='text'>
The iio_buffer_set_attrs() is no longer used in the drivers, so it can be
removed now.

Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20200929125949.69934-10-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500</title>
<updated>2019-06-19T15:09:55+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-04T08:11:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d2912cb15bdda8ba4a5dd73396ad62641af2f520'/>
<id>urn:sha1:d2912cb15bdda8ba4a5dd73396ad62641af2f520</id>
<content type='text'>
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio:buffer.h - split into buffer.h and buffer_impl.h</title>
<updated>2017-01-10T19:54:55+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2017-01-02T19:28:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=33dd94cb972175249258329c4aaffddcc82c2005'/>
<id>urn:sha1:33dd94cb972175249258329c4aaffddcc82c2005</id>
<content type='text'>
buffer.h supplies everything needed for devices using buffers.
buffer_impl.h supplies access to the internals as needed to write
a buffer implementation.

This was really motivated by the mess that turned up in the
kernel-doc documentation pulled in by the new sphinx docs.
It made it clear that our logical separations in headers were
generally terrible.  The buffer case was easy to sort out without
greatly effecting drivers so here it is.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</content>
</entry>
<entry>
<title>iio:buffer: Push implementation of iio_device_attach_buffer into .c file</title>
<updated>2017-01-10T19:54:54+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2017-01-02T19:28:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2b827ad54111439b919605da90e122ecda88bad6'/>
<id>urn:sha1:2b827ad54111439b919605da90e122ecda88bad6</id>
<content type='text'>
This is a precursor to the splitting of buffer.h into parts relevant
to buffer implementation vs those for devices using buffers.
struct buffer is about to become opaque as far as the header is
concerned.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</content>
</entry>
<entry>
<title>iio:buffer:iio_push_to_buffers_with_timestamp fix kernel-doc.</title>
<updated>2017-01-10T19:54:52+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2017-01-02T19:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d4ad4f4b721ad76e28b73e32b8602c011e281893'/>
<id>urn:sha1:d4ad4f4b721ad76e28b73e32b8602c011e281893</id>
<content type='text'>
Wrong start of kernel doc comment /* -&gt; /**

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</content>
</entry>
<entry>
<title>iio:buffers: Push some docs down into the .c file.</title>
<updated>2017-01-10T19:54:51+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2017-01-02T19:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=315a19eca0e7cbae1bef7f43b36fdcfc33f248f6'/>
<id>urn:sha1:315a19eca0e7cbae1bef7f43b36fdcfc33f248f6</id>
<content type='text'>
Ancient legacy of me doing it wrong which it is nice to clear
up whilst we are here.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</content>
</entry>
<entry>
<title>iio:buffer: Stop exporting iio_scan_mask_query</title>
<updated>2017-01-10T19:54:51+00:00</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@kernel.org</email>
</author>
<published>2017-01-02T19:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c2bf8d5f3262b3942bf923ef3b86d6ebe590821d'/>
<id>urn:sha1:c2bf8d5f3262b3942bf923ef3b86d6ebe590821d</id>
<content type='text'>
Nothing uses it outside of core code.

Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
</content>
</entry>
</feed>
