Skip to contentSkip to conversation

Move adis16203 inclinometer driver out of staging

PATCH In review Sheng Kun Chang 6 participants 11 messages Apr 1 – Apr 20

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Move adis16203 inclinometer driver out of staging

This series moves the ADIS16203 Programmable 360 Degrees Inclinometer driver out of staging and into drivers/iio/accel/.

The driver already uses standard IIO channel interfaces and devm managed APIs. The only missing piece was devicetree binding documentation, which is added in patch 1.

Patch 1: Add devicetree binding documentation Patch 2: Fix MODULE_LICENSE to match SPDX identifier Patch 3: Move the driver from staging to drivers/iio/accel/

Sheng Kun Chang (3):
dt-bindings: iio: accel: add binding for adi,adis16203
staging: iio: adis16203: align MODULE_LICENSE with SPDX identifier
iio: accel: move adis16203 out of staging

 .../bindings/iio/accel/adi,adis16203.yaml     | 52 +++++++++++++++++++
 drivers/iio/accel/Kconfig                     | 12 +++++
 drivers/iio/accel/Makefile                    |  1 +
 drivers/{staging => }/iio/accel/adis16203.c   |  2 +-
 drivers/staging/iio/Kconfig                   |  1 -
 drivers/staging/iio/Makefile                  |  1 -
 drivers/staging/iio/accel/Kconfig             | 19 -------
 drivers/staging/iio/accel/Makefile            |  6 ---
 8 files changed, 66 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml
 rename drivers/{staging => }/iio/accel/adis16203.c (99%)
 delete mode 100644 drivers/staging/iio/accel/Kconfig
 delete mode 100644 drivers/staging/iio/accel/Makefile
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/3 dt-bindings: iio: accel: add binding for adi,adis16203

Add devicetree binding documentation for the Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer, in preparation for moving the driver out of staging.

---
 .../bindings/iio/accel/adi,adis16203.yaml     | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml
Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml new file +52 -0
new file mode 100644
index 000000000..6c5e2833c
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/adi,adis16203.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADIS16203 Programmable 360 Degrees Inclinometer
+
+maintainers:
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  Programmable 360 degrees inclinometer with SPI interface.
+    https://www.analog.com/en/products/adis16203.html
+
+properties:
+  compatible:
+    const: adi,adis16203
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vdd-supply: true
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        inclinometer@0 {
+            compatible = "adi,adis16203";
+            reg = <0>;
+            spi-max-frequency = <2500000>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+...
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH 1/3] dt-bindings: iio: accel: add binding for adi,adis16203

Quoted 3 lines · Sheng Kun Chang

Add devicetree binding documentation for the Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer, in preparation for moving the driver out of staging.

A nit, subject: drop second/last, redundant "binding for". The "dt-bindings" prefix is already stating that these are bindings. See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Quoted 21 lines
---
 .../bindings/iio/accel/adi,adis16203.yaml     | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml
Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml new file +8 -0
new file mode 100644
index 000000000..6c5e2833c
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/adi,adis16203.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADIS16203 Programmable 360 Degrees Inclinometer
+

Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml line 18

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml new file +10 -0
+maintainers:
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  Programmable 360 degrees inclinometer with SPI interface.
+    https://www.analog.com/en/products/adis16203.html
+
+properties:
+  compatible:
+    const: adi,adis16203

So everything looks exactly the same as adi,adis16201. Put it there. You probably copied it already, because you made exactly same issues/mistakes.

Best regards,
Krzysztof

#3 lore raw

PATCH 2/3 staging: iio: adis16203: align MODULE_LICENSE with SPDX identifier

In reply to Sheng Kun Chang

The SPDX license identifier is GPL-2.0+ (GPL v2 or later) but MODULE_LICENSE was set to "GPL v2" which indicates GPL v2 only. Change to "GPL" which means GPL v2 or later, matching the SPDX header.

---
 drivers/staging/iio/accel/adis16203.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/accel/adis16203.c +1 -1
index 830ff38fd..0ea127c9c 100644
@@ -310,6 +310,6 @@ module_spi_driver(adis16203_driver);
 
 MODULE_AUTHOR("Barry Song <[email protected]>");
 MODULE_DESCRIPTION("Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer");
-MODULE_LICENSE("GPL v2");
+MODULE_LICENSE("GPL");
 MODULE_ALIAS("spi:adis16203");
 MODULE_IMPORT_NS("IIO_ADISLIB");
Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH 2/3] staging: iio: adis16203: align MODULE_LICENSE with SPDX identifier

Quoted 4 lines · Sheng Kun Chang

The SPDX license identifier is GPL-2.0+ (GPL v2 or later) but MODULE_LICENSE was set to "GPL v2" which indicates GPL v2 only. Change to "GPL" which means GPL v2 or later, matching the SPDX header.

This description has nothing to do with the macro parameter. GPL is new, GPL v2 is just legacy alias.

Also I think this is unneeded churn. If we want to unify this, needs to be done for all drivers in IIO.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#5 lore raw

Re: [PATCH 2/3] staging: iio: adis16203: align MODULE_LICENSE with SPDX identifier

Quoted 8 lines · Andy Shevchenko
Quoted 4 lines · Sheng Kun Chang

The SPDX license identifier is GPL-2.0+ (GPL v2 or later) but MODULE_LICENSE was set to "GPL v2" which indicates GPL v2 only. Change to "GPL" which means GPL v2 or later, matching the SPDX header.

This description has nothing to do with the macro parameter. GPL is new, GPL v2 is just legacy alias.

As Andy says, this is not true at all, please read include/module.h for the details. Both MODULE_LICENSE() strings mean the exact same thing, please do not change it unless you are the original author of the code.

thanks,

greg k-h

#6 lore raw

PATCH 3/3 iio: accel: move adis16203 out of staging

In reply to Sheng Kun Chang

The adis16203 driver uses standard IIO channel interfaces, devm managed APIs, and has no remaining code quality issues. Move it from drivers/staging/iio/accel/ to drivers/iio/accel/ and remove the now-empty staging accel directory.

---
 drivers/iio/accel/Kconfig                   | 12 ++++++++++++
 drivers/iio/accel/Makefile                  |  1 +
 drivers/{staging => }/iio/accel/adis16203.c |  0
 drivers/staging/iio/Kconfig                 |  1 -
 drivers/staging/iio/Makefile                |  1 -
 drivers/staging/iio/accel/Kconfig           | 19 -------------------
 drivers/staging/iio/accel/Makefile          |  6 ------
 7 files changed, 13 insertions(+), 27 deletions(-)
 rename drivers/{staging => }/iio/accel/adis16203.c (100%)
 delete mode 100644 drivers/staging/iio/accel/Kconfig
 delete mode 100644 drivers/staging/iio/accel/Makefile
drivers/iio/accel/Kconfig +12 -0
index 3d3f8d867..2d8abec49 100644
@@ -18,6 +18,18 @@ config ADIS16201
 	  To compile this driver as a module, say M here: the module will
 	  be called adis16201.
 
+config ADIS16203
+	tristate "Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer"
+	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 adis16203 Programmable
+	  360 Degrees Inclinometer.
+
+	  To compile this driver as a module, say M here: the module will
+	  be called adis16203.
+
 config ADIS16209
 	tristate "Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer"
 	depends on SPI
drivers/iio/accel/Makefile +1 -0
index fa440a859..eaf8ce443 100644
@@ -5,6 +5,7 @@
 
 # When adding new entries keep the list in alphabetical order
 obj-$(CONFIG_ADIS16201) += adis16201.o
+obj-$(CONFIG_ADIS16203) += adis16203.o
 obj-$(CONFIG_ADIS16209) += adis16209.o
 obj-$(CONFIG_ADXL313) += adxl313_core.o
 obj-$(CONFIG_ADXL313_I2C) += adxl313_i2c.o
drivers/iio/accel/adis16203.c renamed from drivers/staging/iio/accel/adis16203.c +0 -0
similarity index 100%
rename from drivers/staging/iio/accel/adis16203.c
rename to drivers/iio/accel/adis16203.c
drivers/staging/iio/Kconfig +0 -1
index a60631c1f..bf6addf29 100644
@@ -5,7 +5,6 @@
 menu "IIO staging drivers"
 	depends on IIO
 
-source "drivers/staging/iio/accel/Kconfig"
 source "drivers/staging/iio/adc/Kconfig"
 source "drivers/staging/iio/addac/Kconfig"
 source "drivers/staging/iio/frequency/Kconfig"
drivers/staging/iio/Makefile +0 -1
index 628583535..739e4cbf9 100644
@@ -3,7 +3,6 @@
 # Makefile for the industrial I/O core.
 #
 
-obj-y += accel/
 obj-y += adc/
 obj-y += addac/
 obj-y += frequency/
drivers/staging/iio/accel/Kconfig deleted +0 -19
deleted file mode 100644
index cee51f64b..000000000
@@ -1,19 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Accelerometer drivers
-#
-menu "Accelerometers"
-
-config ADIS16203
-	tristate "Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer"
-	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 adis16203 Programmable
-	  360 Degrees Inclinometer.
-
-	  To compile this driver as a module, say M here: the module will be
-	  called adis16203.
-
-endmenu
drivers/staging/iio/accel/Makefile deleted +0 -6
deleted file mode 100644
index acac7bc9b..000000000
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for industrial I/O accelerometer drivers
-#
-
-obj-$(CONFIG_ADIS16203) += adis16203.o
Signature · 1 line
2.43.0
#7 lore raw
In reply to Sheng Kun Chang

Hi Jonathan,

I noticed the existing Fixme comment on the Y-axis channel and Gabriel's earlier attempt to fix the single-axis representation (v2, April 2025). That patch was not merged.

Should I address the Fixme as an additional patch in this series before the move, or is it fine to fix separately after moving out of staging?

Also, if I should fix it, would it be appropriate to pick up Gabriel's patch with credit, or should I write a fresh fix?

Thanks,
Sheng Kun

maintainer
#8 lore raw
Quoted 6 lines · On Wed, 1 Apr 2026 17:14:25 +0000 Sheng Kun Chang…

Hi Jonathan,

I noticed the existing Fixme comment on the Y-axis channel and Gabriel's earlier attempt to fix the single-axis representation (v2, April 2025). That patch was not merged.

Quoted 6 lines

Should I address the Fixme as an additional patch in this series before the move, or is it fine to fix separately after moving out of staging?

Also, if I should fix it, would it be appropriate to pick up Gabriel's patch with credit, or should I write a fresh fix?

If Gabriel's patch does the job pick that up and add your SoB to indicate you handled the patch. Looking at what I think is latest version of that I had some feedback.
https://lore.kernel.org/all/20250421125357.571c429e@jic23-huawei/

If you make substantial changes whilst integrating this feel free to add a Co-developed-by tag.

Thanks,

Jonathan

Quoted 3 lines

Thanks,
Sheng Kun

#9 lore raw
In reply to Sheng Kun Chang
Quoted 10 lines · Sheng Kun Chang

This series moves the ADIS16203 Programmable 360 Degrees Inclinometer driver out of staging and into drivers/iio/accel/.

The driver already uses standard IIO channel interfaces and devm managed APIs. The only missing piece was devicetree binding documentation, which is added in patch 1.

Patch 1: Add devicetree binding documentation Patch 2: Fix MODULE_LICENSE to match SPDX identifier Patch 3: Move the driver from staging to drivers/iio/accel/

Please, add also MAINTAINERS record.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
reviewer
#10 lore raw
In reply to Sheng Kun Chang
Quoted 16 lines · Sheng Kun Chang

This series moves the ADIS16203 Programmable 360 Degrees Inclinometer driver out of staging and into drivers/iio/accel/.

The driver already uses standard IIO channel interfaces and devm managed APIs. The only missing piece was devicetree binding documentation, which is added in patch 1.

Patch 1: Add devicetree binding documentation Patch 2: Fix MODULE_LICENSE to match SPDX identifier Patch 3: Move the driver from staging to drivers/iio/accel/

Sheng Kun Chang (3):
dt-bindings: iio: accel: add binding for adi,adis16203
staging: iio: adis16203: align MODULE_LICENSE with SPDX identifier
iio: accel: move adis16203 out of staging

Quoted 14 lines
 .../bindings/iio/accel/adi,adis16203.yaml     | 52 +++++++++++++++++++
 drivers/iio/accel/Kconfig                     | 12 +++++
 drivers/iio/accel/Makefile                    |  1 +
 drivers/{staging => }/iio/accel/adis16203.c   |  2 +-
 drivers/staging/iio/Kconfig                   |  1 -
 drivers/staging/iio/Makefile                  |  1 -
 drivers/staging/iio/accel/Kconfig             | 19 -------
 drivers/staging/iio/accel/Makefile            |  6 ---
 8 files changed, 66 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml
 rename drivers/{staging => }/iio/accel/adis16203.c (99%)
 delete mode 100644 drivers/staging/iio/accel/Kconfig
 delete mode 100644 drivers/staging/iio/accel/Makefile

Quite a few people have attempted this already [1]. It is likely not as simple as renaming the file. Please review and give a summary of all of the previous attempts so that all of us reviewers don't have to go read all of those messages.

[1]: https://lore.kernel.org/linux-iio/?q=adis16203

And when reading those messages, you should find that the rename patch needs to have the full diff (I think this is the --no-renames option to git format-patch). This way we can review the driver in it's current state one more time to make sure we didn't miss any cleanups that are needed first.