Re: [PATCH v2 4/6] iio: accel: adis16201: add ADIS16203 support
From: Jonathan Cameron
Date: Sun Sep 13 2026 - 20:57:17 EST
On Sun, 13 Sep 2026 13:53:05 +0500
Shehryar Ahmad <shehryar.amd@xxxxxxxxx> wrote:
> Add ADIS16203 from staging to mainline ADIS16201. ADIS16203 shares same
> SPI protocol and register addresses. Differing parameters are handled by
> adis16201_chip_info structure.
>
> ADIS16203 specific support includes DIAG_STAT_SELFTEST_FAIL_BIT, which
> is supported only on ADIS16203, and a separate channel array.
>
> Kconfig is updated accordingly.
>
> Signed-off-by: Shehryar Ahmad <shehryar.amd@xxxxxxxxx>
> ---
> drivers/iio/accel/Kconfig | 6 +++---
> drivers/iio/accel/adis16201.c | 32 ++++++++++++++++++++++++++++++--
> 2 files changed, 33 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig
> index 4094299e2..f884ec66f 100644
> --- a/drivers/iio/accel/Kconfig
> +++ b/drivers/iio/accel/Kconfig
> @@ -7,13 +7,13 @@
> menu "Accelerometers"
>
> config ADIS16201
> - tristate "Analog Devices ADIS16201 Dual-Axis Digital Inclinometer and Accelerometer"
> + tristate "ADIS16201 Digital Inclinometer and similar"
> depends on SPI
> select IIO_ADIS_LIB
> select IIO_ADIS_LIB_BUFFER if IIO_BUFFER
> help
> - Say Y here to build support for Analog Devices adis16201 dual-axis
> - digital inclinometer and accelerometer.
> + Say Y here to build support for Analog Devices adis16201 Digital
> + Inclinometer and similar
Here is where the names should be.
Say Y here to build support for Analog Devices Digital Inclinometers:
- ADIS16201
- ADIS16203
or something like that. Key is that a new device being supported is a single
line added with no churn of the surrounding text.
>
> To compile this driver as a module, say M here: the module will
> be called adis16201.
> diff --git a/drivers/iio/accel/adis16201.c b/drivers/iio/accel/adis16201.c
> index e0bf7df50..8e8e612fd 100644
> --- a/drivers/iio/accel/adis16201.c
> +++ b/drivers/iio/accel/adis16201.c
> @@ -1,6 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0-or-later
> /*
> - * ADIS16201 Dual-Axis Digital Inclinometer and Accelerometer
> + * ADIS16201 Digital Inclinometer and similar
> *
> * Copyright 2010 Analog Devices Inc.
> */
> @@ -63,6 +63,7 @@
> #define ADIS16201_DIAG_STAT_REG 0x3C
> #define ADIS16201_DIAG_STAT_ALARM2 BIT(9)
> #define ADIS16201_DIAG_STAT_ALARM1 BIT(8)
> +#define ADIS16203_DIAG_STAT_SELFTEST_FAIL_BIT 5 /* ADIS16203 only */
> #define ADIS16201_DIAG_STAT_SPI_FAIL_BIT 3
> #define ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT 2
> /* Power supply above 3.625 V */
> @@ -232,6 +233,15 @@ static const struct iio_chan_spec adis16201_channels[] = {
> IIO_CHAN_SOFT_TIMESTAMP(7)
> };
>
> +static const struct iio_chan_spec adis16203_channels[] = {
> + ADIS_SUPPLY_CHAN(ADIS16201_SUPPLY_OUT_REG, ADIS16201_SCAN_SUPPLY, 0, 12),
> + ADIS_TEMP_CHAN(ADIS16201_TEMP_OUT_REG, ADIS16201_SCAN_TEMP, 0, 12),
> + ADIS_AUX_ADC_CHAN(ADIS16201_AUX_ADC_REG, ADIS16201_SCAN_AUX_ADC, 0, 12),
> + ADIS_INCLI_CHAN(X, ADIS16201_XINCL_OUT_REG, ADIS16201_SCAN_INCLI_X,
> + BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14),
> + IIO_CHAN_SOFT_TIMESTAMP(7),
As per the sashiko feedback on previous, this needs reordering so they are
in scan index ordering.
> +};
Otherwise this is coming together nicely.
Thanks
Jonathan