Skip to contentSkip to conversation

IIO mixed bag of trivial + fixes

PATCH New Jonathan Cameron 1 participant 6 messages Mar 3, 2012

Subsystems (4)
lore
Share & tools
lore
author maintainer
#2 lore raw

PATCH 2/5 staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger.

In reply to Jonathan Cameron

Checking indio_dev->modes is uggly and not symmetric with the conditions on whether triggers are allowed in the first place.

---
 drivers/staging/iio/accel/lis3l02dq_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/accel/lis3l02dq_core.c +1 -1
index 376da51..bcf4712 100644
@@ -724,7 +724,7 @@ static int __devinit lis3l02dq_probe(struct spi_device *spi)
 	return 0;
 
 error_remove_trigger:
-	if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
+	if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)))
 		lis3l02dq_remove_trigger(indio_dev);
 error_free_interrupt:
 	if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
Signature · 1 line
1.7.9.2

Jonathan Cameron

author maintainer
#0 lore raw

cover IIO mixed bag of trivial + fixes

Nothing terribly interesting, but as ever all comments welcome. If no one shouts I'll assume these are trivial enough to send on to Greg sometime next week.

Jonathan

Jonathan Cameron (5):
staging:iio fill in some missing docs staging:iio:accel:lis3l02dq add symmetry to check for presence of
trigger.
staging:iio: use spi->irq valid rather than querying available modes staging:iio:adc:max1363 fix missing update_scan_mask callback. staging:iio:iio_core.h make less dependent on other included headers

 drivers/staging/iio/accel/lis3l02dq_core.c |    2 +-
 drivers/staging/iio/adc/max1363_core.c     |    1 +
 drivers/staging/iio/iio.h                  |    2 ++
 drivers/staging/iio/iio_core.h             |    6 ++++++
 drivers/staging/iio/imu/adis16400_core.c   |    2 +-
 drivers/staging/iio/meter/ade7758_core.c   |    2 +-
 6 files changed, 12 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.2
author maintainer
#1 lore raw

PATCH 1/5 staging:iio fill in some missing docs

---
 drivers/staging/iio/iio.h |    2 ++
 1 file changed, 2 insertions(+)
drivers/staging/iio/iio.h +2 -0
index b9cd454..833a849 100644
@@ -331,6 +331,8 @@ struct iio_buffer_setup_ops {
  * @name:		[DRIVER] name of the device.
  * @info:		[DRIVER] callbacks and constant info from driver
  * @info_exist_lock:	[INTERN] lock to prevent use during removal
+ * @setup_ops:		[DRIVER] callbacks to call before and after buffer
+ *			enable/disable
  * @chrdev:		[INTERN] associated character device
  * @groups:		[INTERN] attribute groups
  * @groupcounter:	[INTERN] index of next attribute group
Signature · 1 line
1.7.9.2
author maintainer
#3 lore raw

PATCH 3/5 staging:iio: use spi->irq valid rather than querying available modes

In reply to Jonathan Cameron

Given these drivers only try to add the trigger if a valid irq is present it is clearer to check the same condition when deciding whether to remove it on a later trigger.

---
 drivers/staging/iio/imu/adis16400_core.c |    2 +-
 drivers/staging/iio/meter/ade7758_core.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/iio/imu/adis16400_core.c +1 -1
index e73ad78..a027d6d 100644
@@ -1172,7 +1172,7 @@ static int __devinit adis16400_probe(struct spi_device *spi)
 	return 0;
 
 error_remove_trigger:
-	if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
+	if (spi->irq)
 		adis16400_remove_trigger(indio_dev);
 error_uninitialize_ring:
 	iio_buffer_unregister(indio_dev);
drivers/staging/iio/meter/ade7758_core.c +1 -1
index dcb2029..9374d6b 100644
@@ -800,7 +800,7 @@ static int __devinit ade7758_probe(struct spi_device *spi)
 	return 0;
 
 error_remove_trigger:
-	if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
+	if (spi->irq)
 		ade7758_remove_trigger(indio_dev);
 error_uninitialize_ring:
 	ade7758_uninitialize_ring(indio_dev);
Signature · 1 line
1.7.9.2
author maintainer
#4 lore raw

PATCH 4/5 staging:iio:adc:max1363 fix missing update_scan_mask callback.

In reply to Jonathan Cameron

When moving over to the new sw_ring_preenable I managed to add this callback to only one of the two iio_info structures. As such only some devices will currently work.

---
 drivers/staging/iio/adc/max1363_core.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/iio/adc/max1363_core.c +1 -0
index 877995b..9d7db7f 100644
@@ -831,6 +831,7 @@ static struct attribute_group max1363_event_attribute_group = {
 static const struct iio_info max1238_info = {
 	.read_raw = &max1363_read_raw,
 	.driver_module = THIS_MODULE,
+	.update_scan_mode = &max1363_update_scan_mode,
 };
 
 static const struct iio_info max1363_info = {
Signature · 1 line
1.7.9.2
author maintainer
#5 lore raw

PATCH 5/5 staging:iio:iio_core.h make less dependent on other included headers

In reply to Jonathan Cameron

There are a lot of pointers to structures used in here that are not declared unless a particular header is included first. Deal with the IIO specific ones by putting in forward declarations and the other ones by including kernel.h and device.h.

---
 drivers/staging/iio/iio_core.h |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/staging/iio/iio_core.h +6 -0
index c9dfcba..f652e6a 100644
@@ -12,6 +12,12 @@
 
 #ifndef _IIO_CORE_H_
 #define _IIO_CORE_H_
+#include <linux/kernel.h>
+#include <linux/device.h>
+
+struct iio_chan_spec;
+struct iio_dev;
+
 
 int __iio_add_chan_devattr(const char *postfix,
 			   struct iio_chan_spec const *chan,
Signature · 1 line
1.7.9.2