Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: exynos-adc: request second interupt only when touchscreen mode is used

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>
Link: https://lore.kernel.org/r/20231009101412.916922-1-m.szyprowski@samsung.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Marek Szyprowski and committed by
Jonathan Cameron
865b080e e2bd8c28

+14 -10
+14 -10
drivers/iio/adc/exynos_adc.c
··· 826 826 } 827 827 } 828 828 829 + /* leave out any TS related code if unreachable */ 830 + if (IS_REACHABLE(CONFIG_INPUT)) { 831 + has_ts = of_property_read_bool(pdev->dev.of_node, 832 + "has-touchscreen") || pdata; 833 + } 834 + 829 835 irq = platform_get_irq(pdev, 0); 830 836 if (irq < 0) 831 837 return irq; 832 838 info->irq = irq; 833 839 834 - irq = platform_get_irq(pdev, 1); 835 - if (irq == -EPROBE_DEFER) 836 - return irq; 840 + if (has_ts) { 841 + irq = platform_get_irq(pdev, 1); 842 + if (irq == -EPROBE_DEFER) 843 + return irq; 837 844 838 - info->tsirq = irq; 845 + info->tsirq = irq; 846 + } else { 847 + info->tsirq = -1; 848 + } 839 849 840 850 info->dev = &pdev->dev; 841 851 ··· 909 899 910 900 if (info->data->init_hw) 911 901 info->data->init_hw(info); 912 - 913 - /* leave out any TS related code if unreachable */ 914 - if (IS_REACHABLE(CONFIG_INPUT)) { 915 - has_ts = of_property_read_bool(pdev->dev.of_node, 916 - "has-touchscreen") || pdata; 917 - } 918 902 919 903 if (pdata) 920 904 info->delay = pdata->delay;