[PATCH] staging: iio: addac: adt7316: document SPI interface switching sequence

From: Hungyu Lin

Date: Sun May 10 2026 - 03:29:51 EST


The device powers up in I2C mode. Switching to SPI mode
requires sending a sequence of SPI writes as described in
the datasheet.

During this sequence, the device may still be in I2C mode,
so SPI transactions may not be recognized and can fail.
Such errors are expected and are ignored.

Add a comment to clarify this behavior.

Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
---
drivers/staging/iio/addac/adt7316-spi.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/addac/adt7316-spi.c b/drivers/staging/iio/addac/adt7316-spi.c
index f91325d11394..6d710e1d4aaa 100644
--- a/drivers/staging/iio/addac/adt7316-spi.c
+++ b/drivers/staging/iio/addac/adt7316-spi.c
@@ -106,7 +106,15 @@ static int adt7316_spi_probe(struct spi_device *spi_dev)
return -EINVAL;
}

- /* switch from default I2C protocol to SPI protocol */
+ /*
+ * The device powers up in I2C mode. Switching to SPI mode
+ * requires sending a sequence of SPI writes as described in
+ * the datasheet.
+ *
+ * During this sequence, the device may still be in I2C mode,
+ * so SPI transactions may not be recognized and can fail.
+ * Such errors are expected and are ignored.
+ */
adt7316_spi_write(spi_dev, 0, 0);
adt7316_spi_write(spi_dev, 0, 0);
adt7316_spi_write(spi_dev, 0, 0);
--
2.34.1