summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-30 03:37:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-30 03:37:48 +0200
commit9f827d8099e76a4a2fb99faa88ee7859459f2360 (patch)
treef08d4db69c53bb441d759747c59a68ae28e82825 /tools
parent99207b80bbf602f1674485c3f9653b7c527785d9 (diff)
parent1d2f1e084b7386b4082ebc2490ce0ddc8efe5667 (diff)
downloadop-kernel-dev-9f827d8099e76a4a2fb99faa88ee7859459f2360.zip
op-kernel-dev-9f827d8099e76a4a2fb99faa88ee7859459f2360.tar.gz
Merge tag 'iio-for-4.4a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: First round of new driver, new functionality and cleanups for IIO in the 4.4 cycle New device support * APDS9960 ALS + proximity driver * bmg160 SPI devices. * HDC100x humidity sensors * Holt HI-8435 threshold detector * mma8453Q accelerometer added to the mma8452 driver * mma86452FC and mma8653FC accelerometers added to the mma8452 driver * mxc4005 accelerometer * PulsedLight LIDAR * SensorTech VZ89x volatile organic compound sensor * UPISEMI uS5182d ALS and proximity sensors New core functionality * triggered events - use triggers to check for changes in threshold type detectors on devices with out interrupt support. First user is the holt comparator. * chemical concentration and resistance channel types. New driver functionality * vf610 - buffer support. - followup coccinelle warning fix. Core rework * buffers - break out callback buffer to own module. - move buffer implementations to a new subdirectory * percolate the error code form iio_event_getfd out to userspace rather than giving a missleading error later on. Cleanups * adddac drivers - use BIT macro where appropriate. * meter drivers - use BIT macro where appropriate. * ad7303 - add an OF match table to line up with the binding docs. * adc128s052 - add an OF match table to line up with the binding docs. * adf4350 - add an OF match table to line up with the binding docs * as3935 - add an OF match table to line up with the binding docs. * berlin2-adc - use GENMASK and BIT for masks - prevent attempting to sample multiple channels at once by moving a mutex scop - coding style cleanups * bmg150_magn - kconfig sort order was wrong - fix it. * bmg160 - use i2c regmap and drop all uses of i2c_client - separate i2c and core driver * cc10001_adc - kconfig sort order was wrong - fix it. * evgen (dummy driver helper module) - move interrupt generation to irq_work to reduce differences between the dummy driver and real hardware drivers. * hmc5843 - set the name dynamically rather than to a fixed value for one of the suported parts. - export module alias information to allow autoprobing of module. * lpc32xx - on failure to get resource or irq return -ENXIO as uppose to -EBUSY * max1027 - set .of_match_table to actually allow OF style matching. * max5821 - add MODULE_DEVICE_TABLE for OF table. * mma8452 - refactor to separate out chip specific data. - add freefall / motion interrupt source for devices that do their interrupts slightly differently. - update copywrite notice. - leave naming of events directory in sysfs to the core * mcp320x - set .of_match_table so that it can be use for OF style matching. * mlx90614 - Implement filter configuration (note the datasheet changed as a result of the driver reviews to include the values we needed ;) * opt3001 - drop .owner field as assigned by platform driver core. * si7020 - replace a bitmask on the humidity values with a more correct range check. * stk310 - improved error handling. - use BIT macro where appropriate and use the resulting defines instead of magic numbers in the code. - fix indentation * st-sensors - add debugfs register read hook * tsl4531 - fix error handling in check_id * twl6030 - fix module autoload for OF * iio-trig-sysfs - document add and remove attribute * trigger in staging - code alignment fixes. - braces on both branches of if statement if needed for one. * xilinx-xadc - push interrupts into hardirq context as there isn't much in them any more and it avoids breaking PREEMPT_RT builds due to the use of a spinlock between the hardirq and the thread. Tools * event-monitor - report unsupported events. We keep expanding what can come from drivers so give a helpful error if one turns up in an out of date userspace program. * generic-buffer - helpful message about needing to enable a channel to start the buffer.
Diffstat (limited to 'tools')
-rw-r--r--tools/iio/generic_buffer.c9
-rw-r--r--tools/iio/iio_event_monitor.c6
2 files changed, 14 insertions, 1 deletions
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
index 9f7b85b..01c4f67 100644
--- a/tools/iio/generic_buffer.c
+++ b/tools/iio/generic_buffer.c
@@ -328,6 +328,15 @@ int main(int argc, char **argv)
"diag %s\n", dev_dir_name);
goto error_free_triggername;
}
+ if (!num_channels) {
+ fprintf(stderr,
+ "No channels are enabled, we have nothing to scan.\n");
+ fprintf(stderr, "Enable channels manually in "
+ FORMAT_SCAN_ELEMENTS_DIR
+ "/*_en and try again.\n", dev_dir_name);
+ ret = -ENOENT;
+ goto error_free_triggername;
+ }
/*
* Construct the directory name for the associated buffer.
diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
index cd3fd41..d51eb04 100644
--- a/tools/iio/iio_event_monitor.c
+++ b/tools/iio/iio_event_monitor.c
@@ -284,7 +284,11 @@ int main(int argc, char **argv)
ret = ioctl(fd, IIO_GET_EVENT_FD_IOCTL, &event_fd);
if (ret == -1 || event_fd == -1) {
ret = -errno;
- fprintf(stderr, "Failed to retrieve event fd\n");
+ if (ret == -ENODEV)
+ fprintf(stderr,
+ "This device does not support events\n");
+ else
+ fprintf(stderr, "Failed to retrieve event fd\n");
if (close(fd) == -1)
perror("Failed to close character device file");
OpenPOWER on IntegriCloud