diff options
-rw-r--r-- | drivers/iio/industrialio-buffer.c | 2 | ||||
-rw-r--r-- | include/linux/iio/iio.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 403b72878b0b..71333140d42c 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c | |||
@@ -639,6 +639,8 @@ static int __iio_update_buffers(struct iio_dev *indio_dev, | |||
639 | indio_dev->currentmode = INDIO_BUFFER_TRIGGERED; | 639 | indio_dev->currentmode = INDIO_BUFFER_TRIGGERED; |
640 | } else if (indio_dev->modes & INDIO_BUFFER_HARDWARE) { | 640 | } else if (indio_dev->modes & INDIO_BUFFER_HARDWARE) { |
641 | indio_dev->currentmode = INDIO_BUFFER_HARDWARE; | 641 | indio_dev->currentmode = INDIO_BUFFER_HARDWARE; |
642 | } else if (indio_dev->modes & INDIO_BUFFER_SOFTWARE) { | ||
643 | indio_dev->currentmode = INDIO_BUFFER_SOFTWARE; | ||
642 | } else { /* Should never be reached */ | 644 | } else { /* Should never be reached */ |
643 | ret = -EINVAL; | 645 | ret = -EINVAL; |
644 | goto error_run_postdisable; | 646 | goto error_run_postdisable; |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 878d861b0610..590202024857 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -286,10 +286,11 @@ static inline s64 iio_get_time_ns(void) | |||
286 | /* Device operating modes */ | 286 | /* Device operating modes */ |
287 | #define INDIO_DIRECT_MODE 0x01 | 287 | #define INDIO_DIRECT_MODE 0x01 |
288 | #define INDIO_BUFFER_TRIGGERED 0x02 | 288 | #define INDIO_BUFFER_TRIGGERED 0x02 |
289 | #define INDIO_BUFFER_SOFTWARE 0x04 | ||
289 | #define INDIO_BUFFER_HARDWARE 0x08 | 290 | #define INDIO_BUFFER_HARDWARE 0x08 |
290 | 291 | ||
291 | #define INDIO_ALL_BUFFER_MODES \ | 292 | #define INDIO_ALL_BUFFER_MODES \ |
292 | (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE) | 293 | (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE) |
293 | 294 | ||
294 | #define INDIO_MAX_RAW_ELEMENTS 4 | 295 | #define INDIO_MAX_RAW_ELEMENTS 4 |
295 | 296 | ||
@@ -593,7 +594,8 @@ void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); | |||
593 | static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) | 594 | static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) |
594 | { | 595 | { |
595 | return indio_dev->currentmode | 596 | return indio_dev->currentmode |
596 | & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE); | 597 | & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | |
598 | INDIO_BUFFER_SOFTWARE); | ||
597 | } | 599 | } |
598 | 600 | ||
599 | /** | 601 | /** |