From e1d392dc8875556d8a742d4be38ab452516428eb Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Fri, 19 Mar 2021 14:53:01 +0100 Subject: iio: event_monitor: Enable events before monitoring After some painful sessions with a driver that register an enable/disable sysfs knob (gp2ap002) and manually going in and enabling the event before monitoring it: cd /sys/bus/iio/devices/iio\:device2/events # ls in_proximity_thresh_either_en # echo 1 > in_proximity_thresh_either_en I realized that it's better if the iio_event_monitor is smart enough to enable all events by itself and disable them after use, if passed the -a flag familiar from the iio_generic_buffer tool. Auto-enabling events depend on the hardware being able to handle all events at the same time which isn't necessarily the case, so a command line option is required for this. Cc: Bastien Nocera Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210319135301.542911-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron --- tools/iio/iio_utils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/iio/iio_utils.h') diff --git a/tools/iio/iio_utils.h b/tools/iio/iio_utils.h index 336752cade4f..663c94a6c705 100644 --- a/tools/iio/iio_utils.h +++ b/tools/iio/iio_utils.h @@ -13,6 +13,7 @@ #define IIO_MAX_NAME_LENGTH 64 #define FORMAT_SCAN_ELEMENTS_DIR "%s/buffer%d" +#define FORMAT_EVENTS_DIR "%s/events" #define FORMAT_TYPE_FILE "%s_type" #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) -- cgit 1.4.1