Re: [PATCH v2 1/2] iio: adc: qcom-spmi-adc5-gen3: Share SDAM0 IRQ with ADC_TM auxiliary driver

From: Jonathan Cameron

Date: Wed May 27 2026 - 07:35:26 EST


On Tue, 26 May 2026 16:26:09 +0530
Jishnu Prakash <jishnu.prakash@xxxxxxxxxxxxxxxx> wrote:

> The SDAM0 IRQ can be triggered for both EOC (end of conversion) events for
> immediate ADC reads done in this driver and for threshold violation events,
> based on ADC_TM thresholds configured from the auxiliary ADC_TM driver on
> TM channels on the first SDAM.
>
> At present, this interrupt is handled only in the ISR in the main ADC driver.
> When the ISR is triggered for an ADC_TM event, this driver notifies the ADC_TM
> driver by calling a notifier callback exposed from it for this purpose.
>
> To simplify the interrupt handling in both drivers, share the interrupt between
> the drivers. With this, ADC_TM interrupts on SDAM0 will be handled directly in
> the ADC_TM driver, so remove the notifier callback and all TM interrupt
> handling in the main ADC ISR.
>
> Signed-off-by: Jishnu Prakash <jishnu.prakash@xxxxxxxxxxxxxxxx>
One trivial thing inline if you are respinning. Not worth the bother
for just this.

Reviewed-by: Jonathan Cameron <jic23@xxxxxxxxxx>


> static int adc5_gen3_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> @@ -817,10 +781,18 @@ static int adc5_gen3_probe(struct platform_device *pdev)
> return -ENOMEM;
> }
>
> - ret = devm_request_irq(dev, adc->dev_data.base[ADC5_GEN3_VADC_SDAM].irq,
> - adc5_gen3_isr, 0,
> - adc->dev_data.base[ADC5_GEN3_VADC_SDAM].irq_name,
> - adc);
> + /*
> + * This interrupt is shared with the ADC_TM auxiliary driver, which
> + * is threaded and uses IRQF_ONESHOT. Since shared interrupts need
> + * to agree on IRQF_ONESHOT configuration and there is a kernel
> + * warning for using IRQF_ONESHOT with non-threaded interrupts,
> + * make this also a threaded IRQ.
> + */
> +

If spinning again, drop this blank line. That will make it even more obvious
the comment is talking about the line that immediately follows.

> + ret = devm_request_threaded_irq(dev, adc->dev_data.base[ADC5_GEN3_VADC_SDAM].irq,
> + NULL, adc5_gen3_isr, IRQF_ONESHOT | IRQF_SHARED,
> + adc->dev_data.base[ADC5_GEN3_VADC_SDAM].irq_name,
> + adc);
> if (ret)
> return dev_err_probe(dev, ret,
> "Failed to request SDAM%d irq\n",