linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] IIO: Mixed trivial fixes and cleanups
@ 2012-04-10 20:11 Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 1/6] staging:iio:buffer example fix typos Jonathan Cameron
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Jonathan Cameron @ 2012-04-10 20:11 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, Jonathan Cameron

Hi Greg,

This set have all been on the mailing list for over a month and
no one seems to care.  All straight forward enough that this
doesn't bother me too much!

Original messages:

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.

and

I have no idea how I managed to munge the previous
patch related to this.  Sorry all.


Jonathan Cameron (6):
  staging:iio:buffer example fix typos
  staging:iio:adc:max1363 fix missing update_scan_mask callback.
  staging:iio fill in some missing docs
  staging:iio:max1363 enable use with inkernel interfaces.
  staging:iio:accel:lis3l02dq add symmetry to check for presence of
    trigger.
  staging:iio: use spi->irq valid rather than querying available modes

 drivers/staging/iio/Documentation/generic_buffer.c |    4 ++--
 drivers/staging/iio/accel/lis3l02dq_core.c         |    2 +-
 drivers/staging/iio/adc/max1363_core.c             |   10 +++++++++-
 drivers/staging/iio/iio.h                          |    2 ++
 drivers/staging/iio/imu/adis16400_core.c           |    2 +-
 drivers/staging/iio/meter/ade7758_core.c           |    2 +-
 6 files changed, 16 insertions(+), 6 deletions(-)

-- 
1.7.9.4


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

* [PATCH 1/6] staging:iio:buffer example fix typos
  2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
@ 2012-04-10 20:11 ` Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 2/6] staging:iio:adc:max1363 fix missing update_scan_mask callback Jonathan Cameron
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2012-04-10 20:11 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, Jonathan Cameron

I have no idea how I managed to munge the previous
patch related to this.  Sorry all.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
 drivers/staging/iio/Documentation/generic_buffer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/Documentation/generic_buffer.c b/drivers/staging/iio/Documentation/generic_buffer.c
index 69a05b9..bf55335 100644
--- a/drivers/staging/iio/Documentation/generic_buffer.c
+++ b/drivers/staging/iio/Documentation/generic_buffer.c
@@ -60,9 +60,9 @@ void print2byte(int input, struct iio_channel_info *info)
 	/* First swap if incorrect endian */
 
 	if (info->be)
-		input = be16toh((uint_16t)input);
+		input = be16toh((uint16_t)input);
 	else
-		input = le16toh((uint_16t)input);
+		input = le16toh((uint16_t)input);
 
 	/* shift before conversion to avoid sign extension
 	   of left aligned data */
-- 
1.7.9.4


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

* [PATCH 2/6] staging:iio:adc:max1363 fix missing update_scan_mask callback.
  2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 1/6] staging:iio:buffer example fix typos Jonathan Cameron
@ 2012-04-10 20:11 ` Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 3/6] staging:iio fill in some missing docs Jonathan Cameron
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2012-04-10 20:11 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, 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 cf3e2ca..2536b63 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -830,6 +830,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.4


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

* [PATCH 3/6] staging:iio fill in some missing docs
  2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 1/6] staging:iio:buffer example fix typos Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 2/6] staging:iio:adc:max1363 fix missing update_scan_mask callback Jonathan Cameron
@ 2012-04-10 20:11 ` Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 4/6] staging:iio:max1363 enable use with inkernel interfaces Jonathan Cameron
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2012-04-10 20:11 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, 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.4


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

* [PATCH 4/6] staging:iio:max1363 enable use with inkernel interfaces.
  2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
                   ` (2 preceding siblings ...)
  2012-04-10 20:11 ` [PATCH 3/6] staging:iio fill in some missing docs Jonathan Cameron
@ 2012-04-10 20:11 ` Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 5/6] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger Jonathan Cameron
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2012-04-10 20:11 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, Jonathan Cameron

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
 drivers/staging/iio/adc/max1363_core.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 2536b63..9d7db7f 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -36,6 +36,7 @@
 #include "../sysfs.h"
 #include "../events.h"
 #include "../buffer.h"
+#include "../driver.h"
 
 #include "max1363.h"
 
@@ -1290,6 +1291,9 @@ static int __devinit max1363_probe(struct i2c_client *client,
 		ret = -ENOMEM;
 		goto error_disable_reg;
 	}
+	ret = iio_map_array_register(indio_dev, client->dev.platform_data);
+	if (ret < 0)
+		goto error_free_device;
 	st = iio_priv(indio_dev);
 	st->reg = reg;
 	/* this is only used for device removal purposes */
@@ -1300,7 +1304,7 @@ static int __devinit max1363_probe(struct i2c_client *client,
 
 	ret = max1363_alloc_scan_masks(indio_dev);
 	if (ret)
-		goto error_free_device;
+		goto error_unregister_map;
 
 	/* Estabilish that the iio_dev is a child of the i2c device */
 	indio_dev->dev.parent = &client->dev;
@@ -1350,6 +1354,8 @@ error_cleanup_ring:
 	max1363_ring_cleanup(indio_dev);
 error_free_available_scan_masks:
 	kfree(indio_dev->available_scan_masks);
+error_unregister_map:
+	iio_map_array_unregister(indio_dev, client->dev.platform_data);
 error_free_device:
 	iio_free_device(indio_dev);
 error_disable_reg:
@@ -1376,6 +1382,7 @@ static int max1363_remove(struct i2c_client *client)
 		regulator_disable(reg);
 		regulator_put(reg);
 	}
+	iio_map_array_unregister(indio_dev, client->dev.platform_data);
 	iio_free_device(indio_dev);
 
 	return 0;
-- 
1.7.9.4


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

* [PATCH 5/6] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger.
  2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
                   ` (3 preceding siblings ...)
  2012-04-10 20:11 ` [PATCH 4/6] staging:iio:max1363 enable use with inkernel interfaces Jonathan Cameron
@ 2012-04-10 20:11 ` Jonathan Cameron
  2012-04-10 20:11 ` [PATCH 6/6] staging:iio: use spi->irq valid rather than querying available modes Jonathan Cameron
  2012-04-10 20:27 ` [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Greg KH
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2012-04-10 20:11 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, 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.4


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

* [PATCH 6/6] staging:iio: use spi->irq valid rather than querying available modes
  2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
                   ` (4 preceding siblings ...)
  2012-04-10 20:11 ` [PATCH 5/6] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger Jonathan Cameron
@ 2012-04-10 20:11 ` Jonathan Cameron
  2012-04-10 20:27 ` [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Greg KH
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2012-04-10 20:11 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, 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.4


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

* Re: [PATCH 0/6] IIO: Mixed trivial fixes and cleanups
  2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
                   ` (5 preceding siblings ...)
  2012-04-10 20:11 ` [PATCH 6/6] staging:iio: use spi->irq valid rather than querying available modes Jonathan Cameron
@ 2012-04-10 20:27 ` Greg KH
  6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2012-04-10 20:27 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio

On Tue, Apr 10, 2012 at 09:11:03PM +0100, Jonathan Cameron wrote:
> Hi Greg,
> 
> This set have all been on the mailing list for over a month and
> no one seems to care.  All straight forward enough that this
> doesn't bother me too much!
> 
> Original messages:
> 
> 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.
> 
> and
> 
> I have no idea how I managed to munge the previous
> patch related to this.  Sorry all.

All applied, thanks.

greg k-h

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

end of thread, other threads:[~2012-04-10 20:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 20:11 [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Jonathan Cameron
2012-04-10 20:11 ` [PATCH 1/6] staging:iio:buffer example fix typos Jonathan Cameron
2012-04-10 20:11 ` [PATCH 2/6] staging:iio:adc:max1363 fix missing update_scan_mask callback Jonathan Cameron
2012-04-10 20:11 ` [PATCH 3/6] staging:iio fill in some missing docs Jonathan Cameron
2012-04-10 20:11 ` [PATCH 4/6] staging:iio:max1363 enable use with inkernel interfaces Jonathan Cameron
2012-04-10 20:11 ` [PATCH 5/6] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger Jonathan Cameron
2012-04-10 20:11 ` [PATCH 6/6] staging:iio: use spi->irq valid rather than querying available modes Jonathan Cameron
2012-04-10 20:27 ` [PATCH 0/6] IIO: Mixed trivial fixes and cleanups Greg KH

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).