linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: iio: ad5933: switch buffer mode to software
@ 2018-01-25 12:30 Alexandru Ardelean
  2018-01-28  8:25 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2018-01-25 12:30 UTC (permalink / raw)
  To: linux-iio; +Cc: michael.hennerich, lars, Alexandru Ardelean

Since commit 152a6a884ae1 ("staging:iio:accel:sca3000 move
to hybrid hard / soft buffer design.")
the buffer mechanism has changed and the
INDIO_BUFFER_HARDWARE flag has been unused.

Since commit 2d6ca60f3284 ("iio: Add a DMAengine framework
based buffer")
the INDIO_BUFFER_HARDWARE flag has been re-purposed for
DMA buffers.

This driver has lagged behind these changes, and
in order for buffers to work, the INDIO_BUFFER_SOFTWARE
needs to be used.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 3d539eeb0e26..6d31001d1825 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -649,8 +649,6 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev)
 	/* Ring buffer functions - here trigger setup related */
 	indio_dev->setup_ops = &ad5933_ring_setup_ops;
 
-	indio_dev->modes |= INDIO_BUFFER_HARDWARE;
-
 	return 0;
 }
 
@@ -763,7 +761,7 @@ static int ad5933_probe(struct i2c_client *client,
 	indio_dev->dev.parent = &client->dev;
 	indio_dev->info = &ad5933_info;
 	indio_dev->name = id->name;
-	indio_dev->modes = INDIO_DIRECT_MODE;
+	indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE);
 	indio_dev->channels = ad5933_channels;
 	indio_dev->num_channels = ARRAY_SIZE(ad5933_channels);
 
-- 
2.14.1


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

* Re: [PATCH] staging: iio: ad5933: switch buffer mode to software
  2018-01-25 12:30 [PATCH] staging: iio: ad5933: switch buffer mode to software Alexandru Ardelean
@ 2018-01-28  8:25 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-01-28  8:25 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, michael.hennerich, lars

On Thu, 25 Jan 2018 14:30:45 +0200
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> Since commit 152a6a884ae1 ("staging:iio:accel:sca3000 move
> to hybrid hard / soft buffer design.")
> the buffer mechanism has changed and the
> INDIO_BUFFER_HARDWARE flag has been unused.
> 
> Since commit 2d6ca60f3284 ("iio: Add a DMAengine framework
> based buffer")
> the INDIO_BUFFER_HARDWARE flag has been re-purposed for
> DMA buffers.
> 
> This driver has lagged behind these changes, and
> in order for buffers to work, the INDIO_BUFFER_SOFTWARE
> needs to be used.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
hmm. Arguably this driver was always doing the hybrid model
and should never have been marked as a hardware buffer in 
the first place..  Anyhow, never mind.

Patch applied with the breaking commit (DMAEngine one) added
as a fixes tag and marked for stable.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/impedance-analyzer/ad5933.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 3d539eeb0e26..6d31001d1825 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -649,8 +649,6 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev)
>  	/* Ring buffer functions - here trigger setup related */
>  	indio_dev->setup_ops = &ad5933_ring_setup_ops;
>  
> -	indio_dev->modes |= INDIO_BUFFER_HARDWARE;
> -
>  	return 0;
>  }
>  
> @@ -763,7 +761,7 @@ static int ad5933_probe(struct i2c_client *client,
>  	indio_dev->dev.parent = &client->dev;
>  	indio_dev->info = &ad5933_info;
>  	indio_dev->name = id->name;
> -	indio_dev->modes = INDIO_DIRECT_MODE;
> +	indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE);
>  	indio_dev->channels = ad5933_channels;
>  	indio_dev->num_channels = ARRAY_SIZE(ad5933_channels);
>  


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

end of thread, other threads:[~2018-01-28  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25 12:30 [PATCH] staging: iio: ad5933: switch buffer mode to software Alexandru Ardelean
2018-01-28  8:25 ` 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).