Re: [PATCH v1 7/7] iio: adc: ad4170: Add support for weigh scale and RTD sensors
From: Andy Shevchenko
Date: Mon Apr 14 2025 - 13:25:16 EST
On Mon, Apr 14, 2025 at 6:37 PM Marcelo Schmitt
<marcelo.schmitt1@xxxxxxxxx> wrote:
...
> > I think you could improve this... You're taking an all or nothing approach.
> > IIUC, we can have cases where only two GPIOs are in use which means we could use
> > the other 2? There the gpiochio init_valid_mask() call that you could
> > potentially use.
>
> Isn't gpiochio init_valid_mask() only to distinguish between GPIOs that can
> (or cannot) be used as interrupts? Not sure AD4170 GPIOs can be used for
> interrupts at all (think they can't) so didn't implement init_valid_mask().
There are two masks, one per GPIO, and one per GPIO-as-IRQ. I agree
that it's better to use valid mask and not reinvent a wheel.
--
With Best Regards,
Andy Shevchenko