mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
To: jic23@kernel.org, gregkh@linuxfoundation.org, nuno.sa@analog.com,
	Michael.Hennerich@analog.com
Cc: dlechner@baylibre.com, andy@kernel.org, linux@analog.com,
	linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, joshua.crofts1@gmail.com,
	error27@gmail.com, narcisaanamaria12@gmail.com,
	Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Subject: [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis
Date: Tue, 29 Sep 2026 21:48:58 +0300	[thread overview]
Message-ID: <20260929184900.39515-2-abdelnasserhussein11@gmail.com> (raw)
In-Reply-To: <20260929184900.39515-1-abdelnasserhussein11@gmail.com>

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


  reply	other threads:[~2026-09-29 18:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-09-30  8:24   ` [PATCH 1/3] staging: iio: accel: adis16203: fix inclination naming and remove unsupported Y-axis Joshua Crofts
2026-09-30  9:21   ` Andy Shevchenko
2026-09-30 11:34     ` nasser
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
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260929184900.39515-2-abdelnasserhussein11@gmail.com \
    --to=abdelnasserhussein11@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux@analog.com \
    --cc=narcisaanamaria12@gmail.com \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®