[PATCH] staging: iio: adc: ad7816: drop busy pin requirement for ad7816

From: Taha Narimani

Date: Sat May 30 2026 - 13:36:00 EST


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>
---
drivers/staging/iio/adc/ad7816.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 988eee3..0eac484 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -84,7 +84,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
gpiod_set_value(chip->convert_pin, 1);
}

-if (chip->id == ID_AD7816 || chip->id == ID_AD7817) {
+ if (chip->id == ID_AD7817) {
while (gpiod_get_value(chip->busy_pin))
cpu_relax();
}
@@ -380,7 +380,7 @@ static int ad7816_probe(struct spi_device *spi_dev)
ret);
return ret;
}
- if (chip->id == ID_AD7816 || chip->id == ID_AD7817) {
+ if (chip->id == ID_AD7817) {
chip->busy_pin = devm_gpiod_get(&spi_dev->dev, "busy",
GPIOD_IN);
if (IS_ERR(chip->busy_pin)) {
--
2.53.0