Re: [PATCH] staging: iio: adc: ad7816: drop busy pin requirement for ad7816
From: Dan Carpenter
Date: Mon Jun 01 2026 - 07:40:19 EST
On Sat, May 30, 2026 at 05:35:12PM +0000, Taha Narimani wrote:
> According to the AD7816/7/8 datasheet, the AD7816 is an 8-pin device
> and does not possess a BUSY pin. The BUSY pin is exclusive to the
> 16-pin AD7817.
>
> The driver previously requested a 'busy' GPIO unconditionally for both
> the AD7816 and AD7817. If a device tree correctly modeled the hardware
> by omitting the busy-gpios property for the AD7816, devm_gpiod_get()
> would return -ENOENT and cause the probe to fail.
>
> Fix this by restricting the busy GPIO request strictly to the AD7817.
>
> Signed-off-by: Taha Narimani <tahanarimani3443@xxxxxxxxx>
The patch is corrupted.
Otherwise this seems reasonable enough. (I haven't read the datasheet
but I trust that you have). Let's add Nishad to the CC list since he
is the one who first limitted it to not check ID_AD7818.
The other way to solve this would be to use devm_gpiod_get_optional()
in the probe() function and test for NULL in ad7816_spi_read(). I
think this would be a cleaner solution because then it works based
on the device trees instead of having to hardcode which devices
have it in the driver itself.
regards,
dan carpenter