linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: hi8435: Use gpiod_set_value_cansleep()
@ 2019-08-11  5:45 Andrey Smirnov
  2019-08-11  8:50 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Smirnov @ 2019-08-11  5:45 UTC (permalink / raw)
  To: linux-iio; +Cc: Andrey Smirnov, linux-kernel, Jonathan Cameron, Chris Healy

Use gpiod_set_value_cansleep() instead of gpiod_set_value() to support
the case when reset pin is connected to a GPIO expander. See ZII VF610
SCU4 AIB for one such example.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
---
 drivers/iio/adc/hi8435.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c
index 35951c47004e..c15f0e154e4d 100644
--- a/drivers/iio/adc/hi8435.c
+++ b/drivers/iio/adc/hi8435.c
@@ -477,7 +477,7 @@ static int hi8435_probe(struct spi_device *spi)
 		hi8435_writeb(priv, HI8435_CTRL_REG, 0);
 	} else {
 		udelay(5);
-		gpiod_set_value(reset_gpio, 1);
+		gpiod_set_value_cansleep(reset_gpio, 1);
 	}
 
 	spi_set_drvdata(spi, idev);
-- 
2.21.0


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

* Re: [PATCH] iio: hi8435: Use gpiod_set_value_cansleep()
  2019-08-11  5:45 [PATCH] iio: hi8435: Use gpiod_set_value_cansleep() Andrey Smirnov
@ 2019-08-11  8:50 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-08-11  8:50 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: linux-iio, linux-kernel, Chris Healy, Nikita Yushchenko,
	Vladimir Barinov

+CC Nikita, Valdimir.

On Sat, 10 Aug 2019 22:45:11 -0700
Andrey Smirnov <andrew.smirnov@gmail.com> wrote:

> Use gpiod_set_value_cansleep() instead of gpiod_set_value() to support
> the case when reset pin is connected to a GPIO expander. See ZII VF610
> SCU4 AIB for one such example.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-iio@vger.kernel.org
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Chris Healy <cphealy@gmail.com>

Seems sensible to me so I've applied it to the togreg branch of iio.git and
pushed out as testing for the autobuilder to play with it.

Still time for last minute comments if anyone has them though.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/hi8435.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c
> index 35951c47004e..c15f0e154e4d 100644
> --- a/drivers/iio/adc/hi8435.c
> +++ b/drivers/iio/adc/hi8435.c
> @@ -477,7 +477,7 @@ static int hi8435_probe(struct spi_device *spi)
>  		hi8435_writeb(priv, HI8435_CTRL_REG, 0);
>  	} else {
>  		udelay(5);
> -		gpiod_set_value(reset_gpio, 1);
> +		gpiod_set_value_cansleep(reset_gpio, 1);
>  	}
>  
>  	spi_set_drvdata(spi, idev);


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

end of thread, other threads:[~2019-08-11  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-11  5:45 [PATCH] iio: hi8435: Use gpiod_set_value_cansleep() Andrey Smirnov
2019-08-11  8:50 ` 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).