All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] iio: iio_buffer_register: Skip channels with negative scan index
@ 2012-06-18 16:33 Lars-Peter Clausen
  2012-06-18 16:33 ` [PATCH 02/10] iio: Add helper function for initializing triggered buffers Lars-Peter Clausen
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Lars-Peter Clausen @ 2012-06-18 16:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jonathan Cameron, devel, linux-iio, Lars-Peter Clausen

It is not always the case that all channels can be used in buffered mode. This
patch allows channels, which can not be used in buffered mode, to set their scan
index to a negative number, which will cause iio_buffer_register to ignore the
channel.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
---
 drivers/iio/industrialio-buffer.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 2f35db9..3d8d187 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -285,6 +285,9 @@ int iio_buffer_register(struct iio_dev *indio_dev,
 	if (channels) {
 		/* new magic */
 		for (i = 0; i < num_channels; i++) {
+			if (channels[i].scan_index < 0)
+				continue;
+
 			/* Establish necessary mask length */
 			if (channels[i].scan_index >
 			    (int)indio_dev->masklength - 1)
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-06-19  7:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-18 16:33 [PATCH 01/10] iio: iio_buffer_register: Skip channels with negative scan index Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 02/10] iio: Add helper function for initializing triggered buffers Lars-Peter Clausen
2012-06-19  0:28   ` Greg Kroah-Hartman
2012-06-19  7:17     ` Jonathan Cameron
2012-06-18 16:33 ` [PATCH 03/10] iio:adc:at91: Use new triggered buffer setup helper Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 04/10] staging:iio:adc:ad7192: Use new triggered buffer setup helper function Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 05/10] staging:iio:adc:ad7298: " Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 06/10] staging:iio:adc:ad7476: " Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 07/10] staging:iio:adc:ad7606: " Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 08/10] staging:iio:adc:ad7793: " Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 09/10] staging:iio:adc:ad7887: " Lars-Peter Clausen
2012-06-18 16:33 ` [PATCH 10/10] staging:iio:adc:ad799x: " Lars-Peter Clausen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.