* [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis
2026-09-29 18:48 [PATCH 0/3] staging: iio: accel: adis16203: fix axis mapping and cleanups Abdelnasser Hussein
@ 2026-09-29 18:48 ` Abdelnasser Hussein
2026-09-30 8:24 ` Joshua Crofts
2026-09-30 9:21 ` Andy Shevchenko
2026-09-29 18:48 ` [PATCH 2/3] staging: iio: accel: adis16203: add missing spi_device_id table Abdelnasser Hussein
2026-09-29 18:49 ` [PATCH 3/3] staging: iio: accel: adis16203: clean up register definitions and drop redundant comments Abdelnasser Hussein
2 siblings, 2 replies; 10+ messages in thread
From: Abdelnasser Hussein @ 2026-09-29 18:48 UTC (permalink / raw)
To: jic23, gregkh, nuno.sa, Michael.Hennerich
Cc: dlechner, andy, linux, linux-iio, linux-staging, linux-kernel,
joshua.crofts1, error27, narcisaanamaria12, Abdelnasser Hussein
The ADIS16203 measures inclination around a single axis. As per the
datasheet, register 0x0C gives a 360-degree output, and 0x0E gives a
+/- 180-degree output of the exact same measurement.
The current driver incorrectly maps 0x0E as a separate Y-axis. This patch
removes the phantom Y-axis, updates the naming, and adjusts the timestamp
channel index.
Note: The ADIS_INCLI_CHAN(X, ...) modifier is intentionally kept to
preserve the existing userspace ABI (incli_x_raw). Furthermore, removing
the phantom Y-axis inherently shifts the scan indexes of subsequent
channels down by one, which is expected to correct the hardware
representation.
Fixes: 2df79e1bddc4 ("staging: iio: accel: Rename source files and update Makefile")
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
---
drivers/staging/iio/accel/adis16203.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c
index 830ff38fda92..eddb786d4747 100644
--- a/drivers/staging/iio/accel/adis16203.c
+++ b/drivers/staging/iio/accel/adis16203.c
@@ -29,10 +29,7 @@
#define ADIS16203_TEMP_OUT 0x0A
/* Output, x-axis inclination */
-#define ADIS16203_XINCL_OUT 0x0C
-
-/* Output, y-axis inclination */
-#define ADIS16203_YINCL_OUT 0x0E
+#define ADIS16203_INCL_OUT 0x0C
/* Incline null calibration */
#define ADIS16203_INCL_NULL 0x18
@@ -129,7 +126,6 @@
enum adis16203_scan {
ADIS16203_SCAN_INCLI_X,
- ADIS16203_SCAN_INCLI_Y,
ADIS16203_SCAN_SUPPLY,
ADIS16203_SCAN_AUX_ADC,
ADIS16203_SCAN_TEMP,
@@ -208,13 +204,10 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
static const struct iio_chan_spec adis16203_channels[] = {
ADIS_SUPPLY_CHAN(ADIS16203_SUPPLY_OUT, ADIS16203_SCAN_SUPPLY, 0, 12),
ADIS_AUX_ADC_CHAN(ADIS16203_AUX_ADC, ADIS16203_SCAN_AUX_ADC, 0, 12),
- ADIS_INCLI_CHAN(X, ADIS16203_XINCL_OUT, ADIS16203_SCAN_INCLI_X,
+ ADIS_INCLI_CHAN(X, ADIS16203_INCL_OUT, ADIS16203_SCAN_INCLI_X,
BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14),
- /* Fixme: Not what it appears to be - see data sheet */
- ADIS_INCLI_CHAN(Y, ADIS16203_YINCL_OUT, ADIS16203_SCAN_INCLI_Y,
- 0, 0, 14),
ADIS_TEMP_CHAN(ADIS16203_TEMP_OUT, ADIS16203_SCAN_TEMP, 0, 12),
- IIO_CHAN_SOFT_TIMESTAMP(5),
+ IIO_CHAN_SOFT_TIMESTAMP(4),
};
static const struct iio_info adis16203_info = {
--
2.54.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis
2026-09-29 18:48 ` [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis Abdelnasser Hussein
@ 2026-09-30 8:24 ` Joshua Crofts
2026-09-30 9:21 ` Andy Shevchenko
1 sibling, 0 replies; 10+ messages in thread
From: Joshua Crofts @ 2026-09-30 8:24 UTC (permalink / raw)
To: Abdelnasser Hussein
Cc: jic23, gregkh, nuno.sa, Michael.Hennerich, dlechner, andy, linux,
linux-iio, linux-staging, linux-kernel, error27,
narcisaanamaria12
On Tue, 29 Sep 2026 21:48:58 +0300
Abdelnasser Hussein <abdelnasserhussein11@gmail.com> wrote:
> The ADIS16203 measures inclination around a single axis. As per the
> datasheet, register 0x0C gives a 360-degree output, and 0x0E gives a
> +/- 180-degree output of the exact same measurement.
>
> The current driver incorrectly maps 0x0E as a separate Y-axis. This patch
> removes the phantom Y-axis, updates the naming, and adjusts the timestamp
> channel index.
>
> Note: The ADIS_INCLI_CHAN(X, ...) modifier is intentionally kept to
> preserve the existing userspace ABI (incli_x_raw). Furthermore, removing
> the phantom Y-axis inherently shifts the scan indexes of subsequent
> channels down by one, which is expected to correct the hardware
> representation.
>
> Fixes: 2df79e1bddc4 ("staging: iio: accel: Rename source files and update Makefile")
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis
2026-09-29 18:48 ` [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis Abdelnasser Hussein
2026-09-30 8:24 ` Joshua Crofts
@ 2026-09-30 9:21 ` Andy Shevchenko
2026-09-30 11:34 ` nasser
1 sibling, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2026-09-30 9:21 UTC (permalink / raw)
To: Abdelnasser Hussein
Cc: jic23, gregkh, nuno.sa, Michael.Hennerich, dlechner, andy, linux,
linux-iio, linux-staging, linux-kernel, joshua.crofts1, error27,
narcisaanamaria12
On Tue, Sep 29, 2026 at 09:48:58PM +0300, Abdelnasser Hussein wrote:
> The ADIS16203 measures inclination around a single axis. As per the
> datasheet, register 0x0C gives a 360-degree output, and 0x0E gives a
> +/- 180-degree output of the exact same measurement.
> The current driver incorrectly maps 0x0E as a separate Y-axis. This patch
> removes the phantom Y-axis, updates the naming, and adjusts the timestamp
> channel index.
Read Submitting Patches about imperative mode (search for "This patch").
> Note: The ADIS_INCLI_CHAN(X, ...) modifier is intentionally kept to
> preserve the existing userspace ABI (incli_x_raw).
This is a staging driver, why do we care about ABI preservations?
Yes, ideally it would be good to have existing user space software
continue working as before, but if this adds a confusion, better to
rework an ABI as well.
> Furthermore, removing
> the phantom Y-axis inherently shifts the scan indexes of subsequent
> channels down by one, which is expected to correct the hardware
> representation.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis
2026-09-30 9:21 ` Andy Shevchenko
@ 2026-09-30 11:34 ` nasser
0 siblings, 0 replies; 10+ messages in thread
From: nasser @ 2026-09-30 11:34 UTC (permalink / raw)
To: Andy Shevchenko
Cc: jic23, gregkh, nuno.sa, Michael.Hennerich, dlechner, andy, linux,
linux-iio, linux-staging, linux-kernel, joshua.crofts1, error27,
narcisaanamaria12
Hi Andy
Thank you for the review.
> Read Submitting Patches about imperative mode (search for "This patch").
I will reword the commit message to use the imperative mood in v2.
> This is a staging driver, why do we care about ABI preservations?
> Yes, ideally it would be good to have existing user space software
> continue working as before, but if this adds a confusion, better to
> rework an ABI as well.
I will completely drop the 'X' modifier from the channel definition in v2.
Best regards,
Abdelnasser
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] staging: iio: accel: adis16203: add missing spi_device_id table
2026-09-29 18:48 [PATCH 0/3] staging: iio: accel: adis16203: fix axis mapping and cleanups Abdelnasser Hussein
2026-09-29 18:48 ` [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis Abdelnasser Hussein
@ 2026-09-29 18:48 ` Abdelnasser Hussein
2026-09-30 6:56 ` Joshua Crofts
2026-09-29 18:49 ` [PATCH 3/3] staging: iio: accel: adis16203: clean up register definitions and drop redundant comments Abdelnasser Hussein
2 siblings, 1 reply; 10+ messages in thread
From: Abdelnasser Hussein @ 2026-09-29 18:48 UTC (permalink / raw)
To: jic23, gregkh, nuno.sa, Michael.Hennerich
Cc: dlechner, andy, linux, linux-iio, linux-staging, linux-kernel,
joshua.crofts1, error27, narcisaanamaria12, Abdelnasser Hussein
The driver currently relies on OF/DT matching but lacks an SPI device
ID table. This prevents module auto-loading on systems without device
tree support.
Add the spi_device_id table to resolve this and ensure the driver loads
properly across all supported platforms.
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
---
drivers/staging/iio/accel/adis16203.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c
index eddb786d4747..905485fd556f 100644
--- a/drivers/staging/iio/accel/adis16203.c
+++ b/drivers/staging/iio/accel/adis16203.c
@@ -11,6 +11,7 @@
#include <linux/iio/imu/adis.h>
#include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
@@ -292,12 +293,19 @@ static const struct of_device_id adis16203_of_match[] = {
MODULE_DEVICE_TABLE(of, adis16203_of_match);
+static const struct spi_device_id adis16203_id[] = {
+ { "adis16203", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(spi, adis16203_id);
+
static struct spi_driver adis16203_driver = {
.driver = {
.name = "adis16203",
.of_match_table = adis16203_of_match,
},
.probe = adis16203_probe,
+ .id_table = adis16203_id,
};
module_spi_driver(adis16203_driver);
--
2.54.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] staging: iio: accel: adis16203: add missing spi_device_id table
2026-09-29 18:48 ` [PATCH 2/3] staging: iio: accel: adis16203: add missing spi_device_id table Abdelnasser Hussein
@ 2026-09-30 6:56 ` Joshua Crofts
2026-09-30 11:35 ` nasser
0 siblings, 1 reply; 10+ messages in thread
From: Joshua Crofts @ 2026-09-30 6:56 UTC (permalink / raw)
To: Abdelnasser Hussein
Cc: jic23, gregkh, nuno.sa, Michael.Hennerich, dlechner, andy, linux,
linux-iio, linux-staging, linux-kernel, error27,
narcisaanamaria12
On Tue, 29 Sep 2026 21:48:59 +0300
Abdelnasser Hussein <abdelnasserhussein11@gmail.com> wrote:
> The driver currently relies on OF/DT matching but lacks an SPI device
> ID table. This prevents module auto-loading on systems without device
> tree support.
>
> Add the spi_device_id table to resolve this and ensure the driver loads
> properly across all supported platforms.
>
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
> ---
> drivers/staging/iio/accel/adis16203.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c
> index eddb786d4747..905485fd556f 100644
> --- a/drivers/staging/iio/accel/adis16203.c
> +++ b/drivers/staging/iio/accel/adis16203.c
> @@ -11,6 +11,7 @@
> #include <linux/iio/imu/adis.h>
>
> #include <linux/kernel.h>
> +#include <linux/mod_devicetable.h>
No need for mod_devicetable.h, this is imported using spi.h
> #include <linux/module.h>
> #include <linux/spi/spi.h>
>
> @@ -292,12 +293,19 @@ static const struct of_device_id adis16203_of_match[] = {
>
> MODULE_DEVICE_TABLE(of, adis16203_of_match);
>
> +static const struct spi_device_id adis16203_id[] = {
> + { "adis16203", 0 },
C99 initializers please.
> + { }
> +};
> +MODULE_DEVICE_TABLE(spi, adis16203_id);
> +
> static struct spi_driver adis16203_driver = {
> .driver = {
> .name = "adis16203",
> .of_match_table = adis16203_of_match,
> },
> .probe = adis16203_probe,
> + .id_table = adis16203_id,
> };
> module_spi_driver(adis16203_driver);
>
Additionally, you should delete the MODULE_ALIAS("spi:adis16203") line.
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] staging: iio: accel: adis16203: add missing spi_device_id table
2026-09-30 6:56 ` Joshua Crofts
@ 2026-09-30 11:35 ` nasser
0 siblings, 0 replies; 10+ messages in thread
From: nasser @ 2026-09-30 11:35 UTC (permalink / raw)
To: Joshua Crofts
Cc: jic23, gregkh, nuno.sa, Michael.Hennerich, dlechner, andy, linux,
linux-iio, linux-staging, linux-kernel, error27,
narcisaanamaria12
Hi Joshua,
Thank you for taking the time to review this.
> No need for mod_devicetable.h, this is imported using spi.h
> C99 initializers please.
> Additionally, you should delete the MODULE_ALIAS("spi:adis16203") line.
I will drop the unnecessary header, update the spi_device_id array to
use C99 initializers, and remove the redundant MODULE_ALIAS in the
upcoming v2.
Best regards,
Abdelnasser
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] staging: iio: accel: adis16203: clean up register definitions and drop redundant comments
2026-09-29 18:48 [PATCH 0/3] staging: iio: accel: adis16203: fix axis mapping and cleanups Abdelnasser Hussein
2026-09-29 18:48 ` [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis Abdelnasser Hussein
2026-09-29 18:48 ` [PATCH 2/3] staging: iio: accel: adis16203: add missing spi_device_id table Abdelnasser Hussein
@ 2026-09-29 18:49 ` Abdelnasser Hussein
2026-09-30 7:04 ` Joshua Crofts
2 siblings, 1 reply; 10+ messages in thread
From: Abdelnasser Hussein @ 2026-09-29 18:49 UTC (permalink / raw)
To: jic23, gregkh, nuno.sa, Michael.Hennerich
Cc: dlechner, andy, linux, linux-iio, linux-staging, linux-kernel,
joshua.crofts1, error27, narcisaanamaria12, Abdelnasser Hussein
Drop redundant, single-line comments above register macros that provide
no additional value.
Vertically align the macro values with tabs to improve readability and
conform to standard kernel coding style.
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
---
drivers/staging/iio/accel/adis16203.c | 87 ++++-----------------------
1 file changed, 13 insertions(+), 74 deletions(-)
diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c
index 905485fd556f..b0fa2701cbd1 100644
--- a/drivers/staging/iio/accel/adis16203.c
+++ b/drivers/staging/iio/accel/adis16203.c
@@ -17,105 +17,44 @@
#define ADIS16203_STARTUP_DELAY 220 /* ms */
-/* Flash memory write count */
#define ADIS16203_FLASH_CNT 0x00
-
-/* Output, power supply */
#define ADIS16203_SUPPLY_OUT 0x02
-
-/* Output, auxiliary ADC input */
#define ADIS16203_AUX_ADC 0x08
-
-/* Output, temperature */
#define ADIS16203_TEMP_OUT 0x0A
-
-/* Output, x-axis inclination */
#define ADIS16203_INCL_OUT 0x0C
-
-/* Incline null calibration */
#define ADIS16203_INCL_NULL 0x18
-
-/* Alarm 1 amplitude threshold */
#define ADIS16203_ALM_MAG1 0x20
-
-/* Alarm 2 amplitude threshold */
#define ADIS16203_ALM_MAG2 0x22
-
-/* Alarm 1, sample period */
#define ADIS16203_ALM_SMPL1 0x24
-
-/* Alarm 2, sample period */
#define ADIS16203_ALM_SMPL2 0x26
-
-/* Alarm control */
#define ADIS16203_ALM_CTRL 0x28
-
-/* Auxiliary DAC data */
#define ADIS16203_AUX_DAC 0x30
-
-/* General-purpose digital input/output control */
#define ADIS16203_GPIO_CTRL 0x32
-
-/* Miscellaneous control */
#define ADIS16203_MSC_CTRL 0x34
-
-/* Internal sample period (rate) control */
#define ADIS16203_SMPL_PRD 0x36
-
-/* Operation, filter configuration */
#define ADIS16203_AVG_CNT 0x38
-
-/* Operation, sleep mode control */
#define ADIS16203_SLP_CNT 0x3A
-
-/* Diagnostics, system status register */
#define ADIS16203_DIAG_STAT 0x3C
-
-/* Operation, system command register */
#define ADIS16203_GLOB_CMD 0x3E
/* MSC_CTRL */
-/* Self-test at power-on: 1 = disabled, 0 = enabled */
-#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST BIT(10)
-
-/* Reverses rotation of both inclination outputs */
-#define ADIS16203_MSC_CTRL_REVERSE_ROT_EN BIT(9)
-
-/* Self-test enable */
-#define ADIS16203_MSC_CTRL_SELF_TEST_EN BIT(8)
-
-/* Data-ready enable: 1 = enabled, 0 = disabled */
-#define ADIS16203_MSC_CTRL_DATA_RDY_EN BIT(2)
-
-/* Data-ready polarity: 1 = active high, 0 = active low */
-#define ADIS16203_MSC_CTRL_ACTIVE_HIGH BIT(1)
-
-/* Data-ready line selection: 1 = DIO1, 0 = DIO0 */
-#define ADIS16203_MSC_CTRL_DATA_RDY_DIO1 BIT(0)
+#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST BIT(10)
+#define ADIS16203_MSC_CTRL_REVERSE_ROT_EN BIT(9)
+#define ADIS16203_MSC_CTRL_SELF_TEST_EN BIT(8)
+#define ADIS16203_MSC_CTRL_DATA_RDY_EN BIT(2)
+#define ADIS16203_MSC_CTRL_ACTIVE_HIGH BIT(1)
+#define ADIS16203_MSC_CTRL_DATA_RDY_DIO1 BIT(0)
/* DIAG_STAT */
-/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
-#define ADIS16203_DIAG_STAT_ALARM2 BIT(9)
-
-/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
-#define ADIS16203_DIAG_STAT_ALARM1 BIT(8)
-
-/* Self-test diagnostic error flag */
-#define ADIS16203_DIAG_STAT_SELFTEST_FAIL_BIT 5
-
-/* SPI communications failure */
-#define ADIS16203_DIAG_STAT_SPI_FAIL_BIT 3
-
-/* Flash update failure */
-#define ADIS16203_DIAG_STAT_FLASH_UPT_BIT 2
-
-/* Power supply above 3.625 V */
-#define ADIS16203_DIAG_STAT_POWER_HIGH_BIT 1
-
-/* Power supply below 2.975 V */
-#define ADIS16203_DIAG_STAT_POWER_LOW_BIT 0
+#define ADIS16203_DIAG_STAT_ALARM2 BIT(9)
+#define ADIS16203_DIAG_STAT_ALARM1 BIT(8)
+#define ADIS16203_DIAG_STAT_SELFTEST_FAIL_BIT 5
+#define ADIS16203_DIAG_STAT_SPI_FAIL_BIT 3
+#define ADIS16203_DIAG_STAT_FLASH_UPT_BIT 2
+#define ADIS16203_DIAG_STAT_POWER_HIGH_BIT 1
+#define ADIS16203_DIAG_STAT_POWER_LOW_BIT 0
/* GLOB_CMD */
--
2.54.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] staging: iio: accel: adis16203: clean up register definitions and drop redundant comments
2026-09-29 18:49 ` [PATCH 3/3] staging: iio: accel: adis16203: clean up register definitions and drop redundant comments Abdelnasser Hussein
@ 2026-09-30 7:04 ` Joshua Crofts
0 siblings, 0 replies; 10+ messages in thread
From: Joshua Crofts @ 2026-09-30 7:04 UTC (permalink / raw)
To: Abdelnasser Hussein
Cc: jic23, gregkh, nuno.sa, Michael.Hennerich, dlechner, andy, linux,
linux-iio, linux-staging, linux-kernel, error27,
narcisaanamaria12
On Tue, 29 Sep 2026 21:49:00 +0300
Abdelnasser Hussein <abdelnasserhussein11@gmail.com> wrote:
> Drop redundant, single-line comments above register macros that provide
> no additional value.
>
> Vertically align the macro values with tabs to improve readability and
> conform to standard kernel coding style.
>
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
> ---
This seems okay, at least the macros are named exactly like the registers
in the datasheet... but I wonder what the others think about this.
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 10+ messages in thread