* [PATCH 1/5] staging:iio fill in some missing docs
2012-03-03 11:39 [PATCH 0/5] IIO mixed bag of trivial + fixes Jonathan Cameron
@ 2012-03-03 11:39 ` Jonathan Cameron
2012-03-03 11:39 ` [PATCH 2/5] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger Jonathan Cameron
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2012-03-03 11:39 UTC (permalink / raw)
To: linux-iio; +Cc: Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/iio.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
index b9cd454..833a849 100644
--- a/drivers/staging/iio/iio.h
+++ b/drivers/staging/iio/iio.h
@@ -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
--
1.7.9.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/5] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger.
2012-03-03 11:39 [PATCH 0/5] IIO mixed bag of trivial + fixes Jonathan Cameron
2012-03-03 11:39 ` [PATCH 1/5] staging:iio fill in some missing docs Jonathan Cameron
@ 2012-03-03 11:39 ` Jonathan Cameron
2012-03-03 11:39 ` [PATCH 3/5] staging:iio: use spi->irq valid rather than querying available modes Jonathan Cameron
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2012-03-03 11:39 UTC (permalink / raw)
To: linux-iio; +Cc: Jonathan Cameron
Checking indio_dev->modes is uggly and not symmetric with the conditions
on whether triggers are allowed in the first place.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/accel/lis3l02dq_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index 376da51..bcf4712 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -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)
--
1.7.9.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/5] staging:iio: use spi->irq valid rather than querying available modes
2012-03-03 11:39 [PATCH 0/5] IIO mixed bag of trivial + fixes Jonathan Cameron
2012-03-03 11:39 ` [PATCH 1/5] staging:iio fill in some missing docs Jonathan Cameron
2012-03-03 11:39 ` [PATCH 2/5] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger Jonathan Cameron
@ 2012-03-03 11:39 ` Jonathan Cameron
2012-03-03 11:39 ` [PATCH 4/5] staging:iio:adc:max1363 fix missing update_scan_mask callback Jonathan Cameron
2012-03-03 11:39 ` [PATCH 5/5] staging:iio:iio_core.h make less dependent on other included headers Jonathan Cameron
4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2012-03-03 11:39 UTC (permalink / raw)
To: linux-iio; +Cc: 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.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/imu/adis16400_core.c | 2 +-
drivers/staging/iio/meter/ade7758_core.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c
index e73ad78..a027d6d 100644
--- a/drivers/staging/iio/imu/adis16400_core.c
+++ b/drivers/staging/iio/imu/adis16400_core.c
@@ -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);
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c
index dcb2029..9374d6b 100644
--- a/drivers/staging/iio/meter/ade7758_core.c
+++ b/drivers/staging/iio/meter/ade7758_core.c
@@ -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);
--
1.7.9.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] staging:iio:adc:max1363 fix missing update_scan_mask callback.
2012-03-03 11:39 [PATCH 0/5] IIO mixed bag of trivial + fixes Jonathan Cameron
` (2 preceding siblings ...)
2012-03-03 11:39 ` [PATCH 3/5] staging:iio: use spi->irq valid rather than querying available modes Jonathan Cameron
@ 2012-03-03 11:39 ` Jonathan Cameron
2012-03-03 11:39 ` [PATCH 5/5] staging:iio:iio_core.h make less dependent on other included headers Jonathan Cameron
4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2012-03-03 11:39 UTC (permalink / raw)
To: linux-iio; +Cc: 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.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/adc/max1363_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 877995b..9d7db7f 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -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 = {
--
1.7.9.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 5/5] staging:iio:iio_core.h make less dependent on other included headers
2012-03-03 11:39 [PATCH 0/5] IIO mixed bag of trivial + fixes Jonathan Cameron
` (3 preceding siblings ...)
2012-03-03 11:39 ` [PATCH 4/5] staging:iio:adc:max1363 fix missing update_scan_mask callback Jonathan Cameron
@ 2012-03-03 11:39 ` Jonathan Cameron
4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2012-03-03 11:39 UTC (permalink / raw)
To: linux-iio; +Cc: 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.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/iio_core.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/iio/iio_core.h b/drivers/staging/iio/iio_core.h
index c9dfcba..f652e6a 100644
--- a/drivers/staging/iio/iio_core.h
+++ b/drivers/staging/iio/iio_core.h
@@ -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,
--
1.7.9.2
^ permalink raw reply related [flat|nested] 6+ messages in thread