public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] iio: exynos-adc: request second interupt only when touchscreen mode is used
       [not found] <CGME20231009101422eucas1p2c004097457990bbaf9b3cc5df9e246fd@eucas1p2.samsung.com>
@ 2023-10-09 10:14 ` Marek Szyprowski
  2023-10-10 13:48   ` Jonathan Cameron
  2023-10-14 16:48   ` Jonathan Cameron
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Szyprowski @ 2023-10-09 10:14 UTC (permalink / raw)
  To: linux-iio, linux-arm-kernel, linux-samsung-soc
  Cc: Marek Szyprowski, Jonathan Cameron, Lars-Peter Clausen,
	Krzysztof Kozlowski, Alim Akhtar, Arnd Bergmann

Second interrupt is needed only when touchscreen mode is used, so don't
request it unconditionally. This removes the following annoying warning
during boot:

exynos-adc 14d10000.adc: error -ENXIO: IRQ index 1 not found

Fixes: 2bb8ad9b44c5 ("iio: exynos-adc: add experimental touchscreen support")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/iio/adc/exynos_adc.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index eb7a2dd59517..614de9644800 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -826,16 +826,26 @@ static int exynos_adc_probe(struct platform_device *pdev)
 		}
 	}
 
+	/* leave out any TS related code if unreachable */
+	if (IS_REACHABLE(CONFIG_INPUT)) {
+		has_ts = of_property_read_bool(pdev->dev.of_node,
+					       "has-touchscreen") || pdata;
+	}
+
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
 	info->irq = irq;
 
-	irq = platform_get_irq(pdev, 1);
-	if (irq == -EPROBE_DEFER)
-		return irq;
+	if (has_ts) {
+		irq = platform_get_irq(pdev, 1);
+		if (irq == -EPROBE_DEFER)
+			return irq;
 
-	info->tsirq = irq;
+		info->tsirq = irq;
+	} else {
+		info->tsirq = -1;
+	}
 
 	info->dev = &pdev->dev;
 
@@ -900,12 +910,6 @@ static int exynos_adc_probe(struct platform_device *pdev)
 	if (info->data->init_hw)
 		info->data->init_hw(info);
 
-	/* leave out any TS related code if unreachable */
-	if (IS_REACHABLE(CONFIG_INPUT)) {
-		has_ts = of_property_read_bool(pdev->dev.of_node,
-					       "has-touchscreen") || pdata;
-	}
-
 	if (pdata)
 		info->delay = pdata->delay;
 	else
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] iio: exynos-adc: request second interupt only when touchscreen mode is used
  2023-10-09 10:14 ` [PATCH] iio: exynos-adc: request second interupt only when touchscreen mode is used Marek Szyprowski
@ 2023-10-10 13:48   ` Jonathan Cameron
  2023-10-14 16:48   ` Jonathan Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2023-10-10 13:48 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-iio, linux-arm-kernel, linux-samsung-soc,
	Lars-Peter Clausen, Krzysztof Kozlowski, Alim Akhtar,
	Arnd Bergmann

On Mon,  9 Oct 2023 12:14:12 +0200
Marek Szyprowski <m.szyprowski@samsung.com> wrote:

> Second interrupt is needed only when touchscreen mode is used, so don't
> request it unconditionally. This removes the following annoying warning
> during boot:
> 
> exynos-adc 14d10000.adc: error -ENXIO: IRQ index 1 not found
> 
> Fixes: 2bb8ad9b44c5 ("iio: exynos-adc: add experimental touchscreen support")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Seems reasonable to me but I'll leave on list a few days for other people
to take a look.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/exynos_adc.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index eb7a2dd59517..614de9644800 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -826,16 +826,26 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	/* leave out any TS related code if unreachable */
> +	if (IS_REACHABLE(CONFIG_INPUT)) {
> +		has_ts = of_property_read_bool(pdev->dev.of_node,
> +					       "has-touchscreen") || pdata;
> +	}
> +
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
>  		return irq;
>  	info->irq = irq;
>  
> -	irq = platform_get_irq(pdev, 1);
> -	if (irq == -EPROBE_DEFER)
> -		return irq;
> +	if (has_ts) {
> +		irq = platform_get_irq(pdev, 1);
> +		if (irq == -EPROBE_DEFER)
> +			return irq;
>  
> -	info->tsirq = irq;
> +		info->tsirq = irq;
> +	} else {
> +		info->tsirq = -1;
> +	}
>  
>  	info->dev = &pdev->dev;
>  
> @@ -900,12 +910,6 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  	if (info->data->init_hw)
>  		info->data->init_hw(info);
>  
> -	/* leave out any TS related code if unreachable */
> -	if (IS_REACHABLE(CONFIG_INPUT)) {
> -		has_ts = of_property_read_bool(pdev->dev.of_node,
> -					       "has-touchscreen") || pdata;
> -	}
> -
>  	if (pdata)
>  		info->delay = pdata->delay;
>  	else


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] iio: exynos-adc: request second interupt only when touchscreen mode is used
  2023-10-09 10:14 ` [PATCH] iio: exynos-adc: request second interupt only when touchscreen mode is used Marek Szyprowski
  2023-10-10 13:48   ` Jonathan Cameron
@ 2023-10-14 16:48   ` Jonathan Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2023-10-14 16:48 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-iio, linux-arm-kernel, linux-samsung-soc,
	Lars-Peter Clausen, Krzysztof Kozlowski, Alim Akhtar,
	Arnd Bergmann

On Mon,  9 Oct 2023 12:14:12 +0200
Marek Szyprowski <m.szyprowski@samsung.com> wrote:

> Second interrupt is needed only when touchscreen mode is used, so don't
> request it unconditionally. This removes the following annoying warning
> during boot:
> 
> exynos-adc 14d10000.adc: error -ENXIO: IRQ index 1 not found
> 
> Fixes: 2bb8ad9b44c5 ("iio: exynos-adc: add experimental touchscreen support")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Timing wise, this might just end up going in during the merge window now.

Thanks,

Jonathan
> ---
>  drivers/iio/adc/exynos_adc.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index eb7a2dd59517..614de9644800 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -826,16 +826,26 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	/* leave out any TS related code if unreachable */
> +	if (IS_REACHABLE(CONFIG_INPUT)) {
> +		has_ts = of_property_read_bool(pdev->dev.of_node,
> +					       "has-touchscreen") || pdata;
> +	}
> +
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
>  		return irq;
>  	info->irq = irq;
>  
> -	irq = platform_get_irq(pdev, 1);
> -	if (irq == -EPROBE_DEFER)
> -		return irq;
> +	if (has_ts) {
> +		irq = platform_get_irq(pdev, 1);
> +		if (irq == -EPROBE_DEFER)
> +			return irq;
>  
> -	info->tsirq = irq;
> +		info->tsirq = irq;
> +	} else {
> +		info->tsirq = -1;
> +	}
>  
>  	info->dev = &pdev->dev;
>  
> @@ -900,12 +910,6 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  	if (info->data->init_hw)
>  		info->data->init_hw(info);
>  
> -	/* leave out any TS related code if unreachable */
> -	if (IS_REACHABLE(CONFIG_INPUT)) {
> -		has_ts = of_property_read_bool(pdev->dev.of_node,
> -					       "has-touchscreen") || pdata;
> -	}
> -
>  	if (pdata)
>  		info->delay = pdata->delay;
>  	else


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-10-14 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20231009101422eucas1p2c004097457990bbaf9b3cc5df9e246fd@eucas1p2.samsung.com>
2023-10-09 10:14 ` [PATCH] iio: exynos-adc: request second interupt only when touchscreen mode is used Marek Szyprowski
2023-10-10 13:48   ` Jonathan Cameron
2023-10-14 16:48   ` Jonathan Cameron

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