diff mbox series

[4/5] iio: adis16460: make use of the new unmasked_drdy flag

Message ID 20210903141423.517028-5-nuno.sa@analog.com (mailing list archive)
State Accepted
Headers show
Series Fixes and improvements to the ADIS lib/devices | expand

Commit Message

Nuno Sa Sept. 3, 2021, 2:14 p.m. UTC
The library can now handle enabling/disabling IRQs for devices that
cannot unmask the data ready pin. Hence there's no need to provide an
'enable_irq' callback anymore.

The library will also automatically request the IRQ with 'IRQF_NO_AUTOEN'
so that we can also remove that from the driver.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/iio/imu/adis16460.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

Comments

Jonathan Cameron Sept. 26, 2021, 3:25 p.m. UTC | #1
On Fri, 3 Sep 2021 16:14:22 +0200
Nuno Sá <nuno.sa@analog.com> wrote:

> The library can now handle enabling/disabling IRQs for devices that
> cannot unmask the data ready pin. Hence there's no need to provide an
> 'enable_irq' callback anymore.
> 
> The library will also automatically request the IRQ with 'IRQF_NO_AUTOEN'
> so that we can also remove that from the driver.
> 
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Hi Nuno,

1-4 applied to the togreg branch of iio.git and pushed out as testing for 0-day
to see if it can find anything we missed.

Thanks,

Jonathan

> ---
>  drivers/iio/imu/adis16460.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/drivers/iio/imu/adis16460.c b/drivers/iio/imu/adis16460.c
> index a6f9fba3e03f..b01988170118 100644
> --- a/drivers/iio/imu/adis16460.c
> +++ b/drivers/iio/imu/adis16460.c
> @@ -319,20 +319,6 @@ static const struct iio_info adis16460_info = {
>  	.debugfs_reg_access = adis_debugfs_reg_access,
>  };
>  
> -static int adis16460_enable_irq(struct adis *adis, bool enable)
> -{
> -	/*
> -	 * There is no way to gate the data-ready signal internally inside the
> -	 * ADIS16460 :(
> -	 */
> -	if (enable)
> -		enable_irq(adis->spi->irq);
> -	else
> -		disable_irq(adis->spi->irq);
> -
> -	return 0;
> -}
> -
>  #define ADIS16460_DIAG_STAT_IN_CLK_OOS	7
>  #define ADIS16460_DIAG_STAT_FLASH_MEM	6
>  #define ADIS16460_DIAG_STAT_SELF_TEST	5
> @@ -373,7 +359,7 @@ static const struct adis_data adis16460_data = {
>  		BIT(ADIS16460_DIAG_STAT_OVERRANGE) |
>  		BIT(ADIS16460_DIAG_STAT_SPI_COMM) |
>  		BIT(ADIS16460_DIAG_STAT_FLASH_UPT),
> -	.enable_irq = adis16460_enable_irq,
> +	.unmasked_drdy = true,
>  	.timeouts = &adis16460_timeouts,
>  };
>  
> @@ -400,8 +386,6 @@ static int adis16460_probe(struct spi_device *spi)
>  	if (ret)
>  		return ret;
>  
> -	/* We cannot mask the interrupt, so ensure it isn't auto enabled */
> -	st->adis.irq_flag |= IRQF_NO_AUTOEN;
>  	ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev, NULL);
>  	if (ret)
>  		return ret;
diff mbox series

Patch

diff --git a/drivers/iio/imu/adis16460.c b/drivers/iio/imu/adis16460.c
index a6f9fba3e03f..b01988170118 100644
--- a/drivers/iio/imu/adis16460.c
+++ b/drivers/iio/imu/adis16460.c
@@ -319,20 +319,6 @@  static const struct iio_info adis16460_info = {
 	.debugfs_reg_access = adis_debugfs_reg_access,
 };
 
-static int adis16460_enable_irq(struct adis *adis, bool enable)
-{
-	/*
-	 * There is no way to gate the data-ready signal internally inside the
-	 * ADIS16460 :(
-	 */
-	if (enable)
-		enable_irq(adis->spi->irq);
-	else
-		disable_irq(adis->spi->irq);
-
-	return 0;
-}
-
 #define ADIS16460_DIAG_STAT_IN_CLK_OOS	7
 #define ADIS16460_DIAG_STAT_FLASH_MEM	6
 #define ADIS16460_DIAG_STAT_SELF_TEST	5
@@ -373,7 +359,7 @@  static const struct adis_data adis16460_data = {
 		BIT(ADIS16460_DIAG_STAT_OVERRANGE) |
 		BIT(ADIS16460_DIAG_STAT_SPI_COMM) |
 		BIT(ADIS16460_DIAG_STAT_FLASH_UPT),
-	.enable_irq = adis16460_enable_irq,
+	.unmasked_drdy = true,
 	.timeouts = &adis16460_timeouts,
 };
 
@@ -400,8 +386,6 @@  static int adis16460_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	/* We cannot mask the interrupt, so ensure it isn't auto enabled */
-	st->adis.irq_flag |= IRQF_NO_AUTOEN;
 	ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev, NULL);
 	if (ret)
 		return ret;