aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/Documentation/iio_utils.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-09iio: Move iio userspace applications out of stagingRoberta Dobrescu1-71/+0
This patch moves iio userspace applications out of staging, to tools/iio/ and adds a Makefile in order to compile them easily. It also adds tools/iio/ to MAINTAINERS file. Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-09staging: iio: Documentation: Introduce iio_utils.cRoberta Dobrescu1-638/+26
This patch removes inline functions from iio_utils.h in order to clean the code. iio_utils.c contains the implementation of the functions used by iio_event_monitor.c, lsiio.c or generic_buffer.c and iio_utils.h contains the declarations of these functions. Since iio_utils.h is modified, generic_buffer.c and iio_event_monitor.c must include stdlib.h. Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-20staging: iio: Fix missing blank line warningMelike Yurtoglu1-0/+7
Fixes "Missing a blank line after declarations" checkpatch.pl warning in Documentation/iio_utils.h Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-14staging:iio: Fix iio_utils.h function prototypesPeter Meerwald1-3/+3
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-25fix format string missmatch in staging/iio/Documentation/iio_utils.hToralf Förster1-2/+2
spotted by cppcheck Signed-off-by: Toralf Förster <toralf.foerster@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-15staging: iio: Add tool to list IIO devices and triggersManuel Stahl1-0/+22
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-01iio: Fix a buffer overflow in iio_utils.h example codeCraig Markwardt1-3/+3
This was originally reported by Craig Markwardt on Zubair Lutfullah's blog and Zubair forwarded it to linux-iio@vger.kernel.org. No email address known. The code first counted the number of enabled channels, then created an array to hold information about them. The code that filled this array then stored whether a given element was enabled inside the array. Curriously this element was never used. Craig's patch added a local temporary variable to avoid the buffer overrun. Jonathan then removed the original enabled element of the structure as it was not needed at all. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-12staging: iio: generic_buffer: initialize retSebastian Andrzej Siewior1-1/+1
The `ret´ variable is only initialized in the error case. For some reason it was always != 0 while I played with generic_buffer so here is a patch. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-07iio staging: missing newline in printfPeter Meerwald1-1/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-06Merge branch 'fixes-togreg' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman1-5/+19
2012-06-30iio staging: fix resource leak in _write_sysfs_int()Peter Meerwald1-0/+2
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30iio staging: fix potential memory/resource leaks in find_type_by_name()Peter Meerwald1-4/+11
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30iio staging: fix potential resource leak in generic_bufferPeter Meerwald1-1/+6
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-26staging: iio: quell asprintf() warning, missing #includesPeter Meerwald1-0/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26staging: iio: fix warning 'static but used in inline function'Peter Meerwald1-1/+1
iio_utils.h:367:10: warning: ‘iioutils_break_up_name’ is static but used in inline function ‘build_channel_array’ which is not static [enabled by default] Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26staging: iio: move commentPeter Meerwald1-1/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26staging: iio: remove unused variablePeter Meerwald1-1/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-12-08staging:iio:generic_buffer example - handle endian differencesJonathan Cameron1-1/+6
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging:iio:Documentation: cleanup properly in buffer handling codeJonathan Cameron1-3/+15
Eating the endian description for now. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26staging:iio:iio_utils.h: Add missing includeLars-Peter Clausen1-0/+1
iio_utils.h uses opendir and friends which need dirent.h Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06staging: iio: push the main buffer chrdev down to the top level.Jonathan Cameron1-1/+1
Sorry all, this one is very invasive, though the driver changes are just trivial interface fixes. Not all done yet. V2 - bring the sca3000 with us. V3 - fix ade7758 bugs in conversion. V4 - add ad5933 Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:Documentation generic_buffer.c update to new abi for buffers + misc fixesJonathan Cameron1-15/+5
Trivial space before newline fix incorporated. Additional fixes related to handling of sign extension and shifted data. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> squash into buffer handling update. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-09Staging: IIO: Documentation: iio_utils: fix channel array generation.Michael Hennerich1-23/+33
The previous implementation flawed, in case some channels are not enabled. The sorted array would then include channel information of disabled channels, And misses the enabled ones, when the count is reached. More troublesome, the loop would not even terminate. The fix is twofold: First we skip channels that are not enabled. Then we use a tested bubble sort algorithm to sort the array. Since we already allocated exactly the number of bytes we need. We can exercise bubble sort on the original memory. In all cases I've seen, the array is already sorted, so this sort terminates immediately. Changes since V1: Fix coding style issues. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28IIO: Documentation: iio_utils: fix mask generationMichael Hennerich1-2/+2
Variable sizeint is used uninitialized. Remove sizeint completely and use bits_used instead. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28IIO: Documentation: iio_utils: Prevent buffer overflowMichael Hennerich1-1/+3
The first part of build_channel_array()identifies the number of enabled channels. Further down this count is used to allocate the ci_array. The next section parses the scan_elements directory again, and fills ci_array regardless if the channel is enabled or not. So if less than available channels are enabled ci_array memory is overflowed. This fix makes sure that we allocate enough memory. But the whole approach looks a bit cumbersome to me. Why not allocate memory for MAX_CHANNLES, less say 64 (I never seen a part with more than that channels). And skip the first part entirely. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28IIO: Documentation: iio_utils: style consistency fixMichael Hennerich1-1/+1
No functional changes Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28IIO: Documentation: iio_utils: Avoid double free()Michael Hennerich1-1/+0
filename is used and freed later Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20Staging: iio: --/++ confusion in build_channel_array() error cleanuproel kluin1-1/+1
Fix loop: it should decrement Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08staging: iio: update example application.Jonathan Cameron1-5/+391
The application is now considerably more generic and should cope with all devices in tree. The process function will need to be extended to handle other type values as needed. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04Staging: iio-utils: fix memory overflow for dynamically allocateded memory to hold filenameBarry Song1-2/+1
Signed-off-by: Barry Song <21cnbao@gmail.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11staging:iio:Documentation: Rewrite example for new abi.Jonathan Cameron1-115/+162
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11staging:iio: Documentation, update iio_utils.h for the move to a busJonathan Cameron1-1/+30
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: IIO: Initial documentationJonathan Cameron1-0/+159
This needs considerably more work, all comments / suggestions welcomed. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>