aboutsummaryrefslogtreecommitdiffstats
path: root/tools/iio/iio_event_monitor.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-07-23iio: Add modifier for DUV lightMaxime Roussin-Bélanger1-0/+2
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-21iio: Add channel for PhaseMathieu Othacehe1-0/+2
Add new channel type support for phase. This channel may be used by Time-of-flight sensors to express the phase difference between emitted and received signals. Those sensor will then use the phase shift of return signals to approximate the distance to objects. Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-06-10iio: Add channel for Position RelativeEugen Hristev1-0/+2
Add new channel type for relative position on a pad. These type of analog sensor offers the position of a pen on a touchpad, and is represented as a voltage, which can be converted to a position on X and Y axis on the pad. The channel will hand the relative position on the pad in both directions. The channel can then be consumed by a touchscreen driver or read as-is for a raw indication of the touchpen on a touchpad. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-01-05iio: Add channel for GravitySong Hongyan1-0/+2
Add new channel types support for gravity sensor. Gravity sensor provides an application-level or physical collection that identifies a device that measures exclusively the force of Earth's gravity along any number of axes. More information can be found in: http://www.usb.org/developers/hidpage/HUTRR59_-_Usages_for_Wearables.pdf Signed-off-by: Song Hongyan <hongyan.song@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-03iio: Add channel for UV indexPeter Meerwald-Stadler1-0/+2
UV index indicating strength of sunburn-producing ultraviolet (UV) radiation Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-03iio: Add modifier for UV lightPeter Meerwald-Stadler1-0/+2
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-20tools: iio: Update iio_event_monitor namesPeter Meerwald-Stadler1-0/+14
add recently added channel types and modifiers Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-08-16iio: event_monitor: report unsupported eventsLinus Walleij1-1/+5
This makes the event monitor bail out with a helpful error message if a device does not support events, as a related fix to iio core now makes it return -ENODEV properly. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-07-20tools: iio: Send error messages to stderrCristina Opriceana1-7/+7
This patch indends to make some cleanup and send printf error messages to stderr. The changes were performed with coccinelle for failure messages and manual for other cases, such as wrong usage messages. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-07-20tools: iio: Remove unnecessary bracesCristina Opriceana1-2/+1
Single statement blocks don’t need braces. Found with checkpatch.pl. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-06-21tools:iio:iio_event_monitor: check if event is fully readHartmut Knaack1-0/+6
Check that the read event is of the expected size. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-06-21tools: iio: Add missing names to iio_event_monitorPeter Meerwald1-0/+8
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-06-13tools:iio: adjust coding styleHartmut Knaack1-5/+8
Fix various coding style issues, including: * have spaces around operators * indentation * consolidate parameters in same line * required braces * adjust/drop comments * multiline comment style * delete unnecessary empty lines * add empty lines to visualize logial code blocks * typos Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-06-01tools:iio:iio_event_monitor: refactor events outputHartmut Knaack1-14/+10
Refactor the code in print_event() to reduce code duplication and better reflect that the type is output unconditionally, as well as cascade the dependency of the diff-channel. Saves a few lines of code, as well. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-06-01tools:iio: return values directlyHartmut Knaack1-3/+2
Return directly, if no common cleanup is required. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-31tools:iio:iio_event_monitor: add error handlingHartmut Knaack1-2/+7
Add error handling to calls which can indicate a major problem by returning an error code. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-31tools:iio: catch errors in string allocationHartmut Knaack1-0/+2
This patch catches errors in string allocation in generic_buffer.c, iio_event_monitor.c, iio_utils.c and lsiio.c. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-31tools:iio:iio_event_monitor: save right errnoHartmut Knaack1-3/+5
Move up error handling code to preserve the errno coming from ioctl(), before it may be changed by close(). Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-31tools:iio: save errno firstHartmut Knaack1-3/+3
The man-page of errno states, that errno should be saved before doing any library call, as that call may have changed the value of errno. So, when encountering any error, save errno first. This patch affects generic_buffer.c, iio_event_monitor.c and iio_utils.c. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-09tools: iio: Define _GNU_SOURCE in MakefileRoberta Dobrescu1-2/+0
Definition of _GNU_SOURCE is needed to get rid of some warnings, such as: warning: implicit declaration of function `asprintf'. generic_buffer.c and iio_event_monitor.c define _GNU_SOURCE, but it is also needed in lsiio.c and iio_utils.c. For this reason, this patch adds the definition in Makefile and removes it from where it already exists. Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-09iio: Move iio userspace applications out of stagingRoberta Dobrescu1-0/+310
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>