Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: gyro: mpu3050: Allow open drain with anything
@ 2017-06-29 11:57 Linus Walleij
  2017-07-01  9:59 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2017-06-29 11:57 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio; +Cc: Linus Walleij

Open drain should work fine with rising or high level IRQs,
this code was due to some misunderstanding on my part.

Reported-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/iio/gyro/mpu3050-core.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index 2be2a5d287e6..e0d241a9aa30 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -1063,11 +1063,6 @@ static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq)
 	case IRQF_TRIGGER_RISING:
 		dev_info(&indio_dev->dev,
 			 "pulse interrupts on the rising edge\n");
-		if (mpu3050->irq_opendrain) {
-			dev_info(&indio_dev->dev,
-				 "rising edge incompatible with open drain\n");
-			mpu3050->irq_opendrain = false;
-		}
 		break;
 	case IRQF_TRIGGER_FALLING:
 		mpu3050->irq_actl = true;
@@ -1078,11 +1073,6 @@ static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq)
 		mpu3050->irq_latch = true;
 		dev_info(&indio_dev->dev,
 			 "interrupts active high level\n");
-		if (mpu3050->irq_opendrain) {
-			dev_info(&indio_dev->dev,
-				 "active high incompatible with open drain\n");
-			mpu3050->irq_opendrain = false;
-		}
 		/*
 		 * With level IRQs, we mask the IRQ until it is processed,
 		 * but with edge IRQs (pulses) we can queue several interrupts
-- 
2.9.4


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

* Re: [PATCH] iio: gyro: mpu3050: Allow open drain with anything
  2017-06-29 11:57 [PATCH] iio: gyro: mpu3050: Allow open drain with anything Linus Walleij
@ 2017-07-01  9:59 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-07-01  9:59 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-iio

On Thu, 29 Jun 2017 13:57:04 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> Open drain should work fine with rising or high level IRQs,
> this code was due to some misunderstanding on my part.
Me too ;)

Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan
> 
> Reported-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/iio/gyro/mpu3050-core.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
> index 2be2a5d287e6..e0d241a9aa30 100644
> --- a/drivers/iio/gyro/mpu3050-core.c
> +++ b/drivers/iio/gyro/mpu3050-core.c
> @@ -1063,11 +1063,6 @@ static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq)
>  	case IRQF_TRIGGER_RISING:
>  		dev_info(&indio_dev->dev,
>  			 "pulse interrupts on the rising edge\n");
> -		if (mpu3050->irq_opendrain) {
> -			dev_info(&indio_dev->dev,
> -				 "rising edge incompatible with open drain\n");
> -			mpu3050->irq_opendrain = false;
> -		}
>  		break;
>  	case IRQF_TRIGGER_FALLING:
>  		mpu3050->irq_actl = true;
> @@ -1078,11 +1073,6 @@ static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq)
>  		mpu3050->irq_latch = true;
>  		dev_info(&indio_dev->dev,
>  			 "interrupts active high level\n");
> -		if (mpu3050->irq_opendrain) {
> -			dev_info(&indio_dev->dev,
> -				 "active high incompatible with open drain\n");
> -			mpu3050->irq_opendrain = false;
> -		}
>  		/*
>  		 * With level IRQs, we mask the IRQ until it is processed,
>  		 * but with edge IRQs (pulses) we can queue several interrupts


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

end of thread, other threads:[~2017-07-01  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-29 11:57 [PATCH] iio: gyro: mpu3050: Allow open drain with anything Linus Walleij
2017-07-01  9:59 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox