Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 3/3] iio: accel: adxl372: Make sure interrupts are disabled
@ 2019-09-03  9:19 Stefan Popa
  2019-09-08  9:31 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Popa @ 2019-09-03  9:19 UTC (permalink / raw)
  To: jic23
  Cc: Michael.Hennerich, knaack.h, lars, pmeerw, linux-kernel,
	linux-iio, stefan.popa

This patch disables the adxl372 interrupts at setup. The interrupts
should be enabled together with the iio buffer. Not doing this, might
cause an unwanted interrupt to trigger without being able to properly
clear it.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
---
 drivers/iio/accel/adxl372.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c
index 72d3f45..77651f4 100644
--- a/drivers/iio/accel/adxl372.c
+++ b/drivers/iio/accel/adxl372.c
@@ -609,6 +609,10 @@ static int adxl372_setup(struct adxl372_state *st)
 	if (ret < 0)
 		return ret;
 
+	ret = adxl372_set_interrupts(st, 0, 0);
+	if (ret < 0)
+		return ret;
+
 	/* Set the mode of operation to full bandwidth measurement mode */
 	return adxl372_set_op_mode(st, ADXL372_FULL_BW_MEASUREMENT);
 }
-- 
2.7.4


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

* Re: [PATCH 3/3] iio: accel: adxl372: Make sure interrupts are disabled
  2019-09-03  9:19 [PATCH 3/3] iio: accel: adxl372: Make sure interrupts are disabled Stefan Popa
@ 2019-09-08  9:31 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-09-08  9:31 UTC (permalink / raw)
  To: Stefan Popa
  Cc: Michael.Hennerich, knaack.h, lars, pmeerw, linux-kernel, linux-iio

On Tue, 3 Sep 2019 12:19:11 +0300
Stefan Popa <stefan.popa@analog.com> wrote:

> This patch disables the adxl372 interrupts at setup. The interrupts
> should be enabled together with the iio buffer. Not doing this, might
> cause an unwanted interrupt to trigger without being able to properly
> clear it.
> 
> Signed-off-by: Stefan Popa <stefan.popa@analog.com>

Given the device has a software reset, would we be better off
just hitting that to make sure we are in a consistent state after
driver start up?

Thanks,

Jonathan


> ---
>  drivers/iio/accel/adxl372.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c
> index 72d3f45..77651f4 100644
> --- a/drivers/iio/accel/adxl372.c
> +++ b/drivers/iio/accel/adxl372.c
> @@ -609,6 +609,10 @@ static int adxl372_setup(struct adxl372_state *st)
>  	if (ret < 0)
>  		return ret;
>  
> +	ret = adxl372_set_interrupts(st, 0, 0);
> +	if (ret < 0)
> +		return ret;
> +
>  	/* Set the mode of operation to full bandwidth measurement mode */
>  	return adxl372_set_op_mode(st, ADXL372_FULL_BW_MEASUREMENT);
>  }


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  9:19 [PATCH 3/3] iio: accel: adxl372: Make sure interrupts are disabled Stefan Popa
2019-09-08  9:31 ` Jonathan Cameron

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox