<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/iio/iio_generic_buffer.c, branch v5.16</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.16</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.16'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-03-11T20:47:07+00:00</updated>
<entry>
<title>tools: iio: convert iio_generic_buffer to use new IIO buffer API</title>
<updated>2021-03-11T20:47:07+00:00</updated>
<author>
<name>Alexandru Ardelean</name>
<email>alexandru.ardelean@analog.com</email>
</author>
<published>2021-02-15T10:40:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8827faab2c8b52e848071a039a945db6f3ae8365'/>
<id>urn:sha1:8827faab2c8b52e848071a039a945db6f3ae8365</id>
<content type='text'>
This change makes use of the new IIO buffer API to read data from an IIO
buffer.
It doesn't read the /sys/bus/iio/devices/iio:deviceX/scan_elements dir
anymore, it reads /sys/bus/iio/devices/iio:deviceX/bufferY, where all the
scan_elements have been merged together with the old/classical buffer
attributes.

And it makes use of the new IIO_BUFFER_GET_FD_IOCTL ioctl to get an FD for
the IIO buffer for which to read data from.
It also does a quick sanity check to see that -EBUSY is returned if reading
the chardev after the ioctl() has succeeded.

This was tested with the following cases:
 1. Tested buffer0 works with ioctl()
 2. Tested that buffer0 can't be opened via /dev/iio:deviceX after ioctl()
    This check should be omitted under normal operation; it's being done
    here to check that the driver change is sane
 3. Moved valid buffer0 to be buffer1, and tested that data comes from it

Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Link: https://lore.kernel.org/r/20210215104043.91251-25-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>tools: iio: privatize globals and functions in iio_generic_buffer.c file</title>
<updated>2021-03-11T20:47:06+00:00</updated>
<author>
<name>Alexandru Ardelean</name>
<email>alexandru.ardelean@analog.com</email>
</author>
<published>2021-02-15T10:40:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ebe5112535b5cf389ca7d337cf6a0c1d885f9880'/>
<id>urn:sha1:ebe5112535b5cf389ca7d337cf6a0c1d885f9880</id>
<content type='text'>
Mostly a tidy-up.
But also helps to understand the limits of scope of these functions and
globals.

Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Link: https://lore.kernel.org/r/20210215104043.91251-24-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>tools: iio: iio_generic_buffer: make num_loops signed</title>
<updated>2019-01-12T18:17:56+00:00</updated>
<author>
<name>Martin Kelly</name>
<email>mkelly@xevo.com</email>
</author>
<published>2019-01-11T23:13:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b119d3bc328e7a9574861ebe0c2110e2776c2de1'/>
<id>urn:sha1:b119d3bc328e7a9574861ebe0c2110e2776c2de1</id>
<content type='text'>
Currently, num_loops is unsigned, but it's set by strtoll, which returns a
(signed) long long int. This could lead to overflow, and it also makes the
check "num_loops &lt; 0" always be false, since num_loops is unsigned.
Setting num_loops to -1 to loop forever is almost working because num_loops
is getting set to a very high number, but it's technically still incorrect.

Fix this issue by making num_loops signed. This also fixes an error found
by Smatch.

Signed-off-by: Martin Kelly &lt;mkelly@xevo.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Fixes: 55dda0abcf9d ("tools: iio: iio_generic_buffer: allow continuous looping")
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>tools: iio: iio_generic_buffer: allow continuous looping</title>
<updated>2018-05-20T13:55:58+00:00</updated>
<author>
<name>Martin Kelly</name>
<email>mkelly@xevo.com</email>
</author>
<published>2018-05-18T00:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55dda0abcf9d36bf5c3e21c8423b7c00a1125e27'/>
<id>urn:sha1:55dda0abcf9d36bf5c3e21c8423b7c00a1125e27</id>
<content type='text'>
Sometimes it's useful to stream samples forever, such as when
stress-testing a driver overnight to check for memory leaks or other
issues. When the program receives a signal, it will gracefully cleanup,
so it is still safe to terminate at any time.

Add support for specifying a negative -c option, meaning that we should
loop forever. To do so, we need to use a long long (instead of just
long) for num_loops so that current code specifying num_loops greater
than UNSIGNED_LONG_MAX doesn't break.

Signed-off-by: Martin Kelly &lt;mkelly@xevo.com&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>tools: iio: iio_generic_buffer: fix types to match</title>
<updated>2018-05-20T13:54:39+00:00</updated>
<author>
<name>Martin Kelly</name>
<email>mkelly@xevo.com</email>
</author>
<published>2018-05-18T00:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=71b52d2c746b2915d615e29f5873e1ee5f3c5f52'/>
<id>urn:sha1:71b52d2c746b2915d615e29f5873e1ee5f3c5f52</id>
<content type='text'>
Several types are mismatched and causing implicit conversions.  Fix them
up so the types match.

Signed-off-by: Martin Kelly &lt;mkelly@xevo.com&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>tools: iio: iio_generic_buffer: drop unneeded parentheses</title>
<updated>2016-10-23T18:34:10+00:00</updated>
<author>
<name>Eva Rachel Retuya</name>
<email>eraretuya@gmail.com</email>
</author>
<published>2016-10-20T09:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c5fe4112421aaef4a9ee35de8d21c1718855fc3'/>
<id>urn:sha1:7c5fe4112421aaef4a9ee35de8d21c1718855fc3</id>
<content type='text'>
Remove extra parentheses introduced in commit &lt;73e176a tools: iio:
iio_generic_buffer: add -A to force-enable all channels&gt;.

Suggested-by: Peter Meerwald-Stadler &lt;pmeerw@pmeerw.net&gt;
Signed-off-by: Eva Rachel Retuya &lt;eraretuya@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: iio: iio_generic_buffer: rename and change type of force variable</title>
<updated>2016-10-23T18:34:10+00:00</updated>
<author>
<name>Eva Rachel Retuya</name>
<email>eraretuya@gmail.com</email>
</author>
<published>2016-10-20T09:19:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=71ccbe5dc566021ec5f810917bec7312527e421e'/>
<id>urn:sha1:71ccbe5dc566021ec5f810917bec7312527e421e</id>
<content type='text'>
Replace the type of 'force' flag from int to bool and at the same time
rename it to 'force_autochannels' for better readability.

Suggested-by: Peter Meerwald-Stadler &lt;pmeerw@pmeerw.net&gt;
Signed-off-by: Eva Rachel Retuya &lt;eraretuya@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: iio: iio_generic_buffer: add -A to force-enable all channels</title>
<updated>2016-10-23T18:33:53+00:00</updated>
<author>
<name>Eva Rachel Retuya</name>
<email>eraretuya@gmail.com</email>
</author>
<published>2016-10-14T10:18:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e2cf0e21f5c4792a0b21325557974ddbf111d2f'/>
<id>urn:sha1:4e2cf0e21f5c4792a0b21325557974ddbf111d2f</id>
<content type='text'>
If attribute/s is/are already enabled (by default or via scripts or
manual interaction), issuing -a will fail to enable the channels thereby
one has to manually disable the said attribute/s before proceeding with
auto-enabling.

Add a command-line option -A to force-activate all channels regardless
of their current state.

Suggested-by: Alison Schofield &lt;amsfield22@gmail.com&gt;
Signed-off-by: Eva Rachel Retuya &lt;eraretuya@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: iio: iio_generic_buffer: fix argument '?' option</title>
<updated>2016-09-22T17:46:39+00:00</updated>
<author>
<name>Mugunthan V N</name>
<email>mugunthanvnm@ti.com</email>
</author>
<published>2016-09-21T16:57:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44c5ba96ec1083b7694a88fd99c3012213314b82'/>
<id>urn:sha1:44c5ba96ec1083b7694a88fd99c3012213314b82</id>
<content type='text'>
When help ('?') option is passed to the command, the help text
printed but not from '?' switch case of getopt_long() but as a
invalid argument as below. Fix this by adding '?' to opt_String
of getopt_long().

root@am437x-evm:~# ./iio_generic_buffer -?
./iio_generic_buffer: invalid option -- '?'
Usage: generic_buffer [options]...
Capture, convert and output data from IIO device buffer
  -a         Auto-activate all available channels
...

Signed-off-by: Mugunthan V N &lt;mugunthanvnm@ti.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
</feed>
