Re: [PATCH] iio: exynos-adc: request second interupt only when touchscreen mode is used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon,  9 Oct 2023 12:14:12 +0200
Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> 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@xxxxxxxxxxx>
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




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux for Synopsys ARC Processors]    
  • [Linux on Unisoc (RDA Micro) SoCs]     [Linux Actions SoC]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  •   Powered by Linux