linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] iio:magnetometer:mag3110: Report busy in _read_raw() / write_raw() when buffer is enabled
@ 2014-01-10 21:59 Peter Meerwald
  2014-01-10 21:59 ` [PATCH 2/5] iio:magnetometer:mag3110: Fix output of decimal digits in show_int_plus_micros() Peter Meerwald
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Peter Meerwald @ 2014-01-10 21:59 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald

individual reads are not permitted concurrently with buffered reads

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/magnetometer/mag3110.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
index 4b65b6d..b88cb44 100644
--- a/drivers/iio/magnetometer/mag3110.c
+++ b/drivers/iio/magnetometer/mag3110.c
@@ -154,6 +154,9 @@ static int mag3110_read_raw(struct iio_dev *indio_dev,
 
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW:
+		if (iio_buffer_enabled(indio_dev))
+			return -EBUSY;
+
 		switch (chan->type) {
 		case IIO_MAGN: /* in 0.1 uT / LSB */
 			ret = mag3110_read(data, buffer);
@@ -199,6 +202,9 @@ static int mag3110_write_raw(struct iio_dev *indio_dev,
 	struct mag3110_data *data = iio_priv(indio_dev);
 	int rate;
 
+	if (iio_buffer_enabled(indio_dev))
+		return -EBUSY;
+
 	switch (mask) {
 	case IIO_CHAN_INFO_SAMP_FREQ:
 		rate = mag3110_get_samp_freq_index(data, val, val2);
-- 
1.8.3.2


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

end of thread, other threads:[~2014-01-11 16:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-10 21:59 [PATCH 1/5] iio:magnetometer:mag3110: Report busy in _read_raw() / write_raw() when buffer is enabled Peter Meerwald
2014-01-10 21:59 ` [PATCH 2/5] iio:magnetometer:mag3110: Fix output of decimal digits in show_int_plus_micros() Peter Meerwald
2014-01-11 12:14   ` Jonathan Cameron
2014-01-10 21:59 ` [PATCH 3/5] iio:magnetometer:mag3110: Scale factor missing for temperature Peter Meerwald
2014-01-11 16:08   ` Jonathan Cameron
2014-01-10 21:59 ` [PATCH 4/5] iio:magnetometer:mag3110: Fix initialization of ctrl_reg1 Peter Meerwald
2014-01-11 16:09   ` Jonathan Cameron
2014-01-10 21:59 ` [PATCH 5/5] iio:magnetometer:mag3110: Enable user offset calibration Peter Meerwald
2014-01-11 16:10   ` Jonathan Cameron
2014-01-11 12:07 ` [PATCH 1/5] iio:magnetometer:mag3110: Report busy in _read_raw() / write_raw() when buffer is enabled Jonathan Cameron
2014-01-11 12:13   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).