Skip to contentSkip to conversation

iio: accel: adis16209: add missing SPI and OF matching table

PATCH In review Shehryar Ahmad 3 participants 5 messages Oct 16 – Oct 17

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

cover iio: accel: adis16209: add missing SPI and OF matching table

Replaced old manual matching via MODULE_ALIAS to modern SPI matching table. Also added missing OF match table for DT based probe. Compatible adi,adis16209 is already enumerated in Documentation/devicetree/bindings/iio/accel/adi,adis16201.yaml

Shehryar Ahmad (2):
iio: accel: adis16209: add SPI device ID table
iio: accel: adis16209: Add OF device ID table

 drivers/iio/accel/adis16209.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
Signature · 1 line
2.56.0
#1 lore raw

PATCH 1/2 iio: accel: adis16209: add SPI device ID table

Add spi_device_id table for ADIS16209. Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE() which automatically generates the same module alias.

---
 drivers/iio/accel/adis16209.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/iio/accel/adis16209.c +7 -1
index 04e169f22..07a682d68 100644
@@ -298,16 +298,22 @@ static int adis16209_probe(struct spi_device *spi)
 	return devm_iio_device_register(&spi->dev, indio_dev);
 }
 
+static const struct spi_device_id adis16209_ids[] = {
+	{ .name = "adis16209" },
+	{ }
+};
+MODULE_DEVICE_TABLE(spi, adis16209_ids);
+
 static struct spi_driver adis16209_driver = {
 	.driver = {
 		.name = "adis16209",
 	},
 	.probe = adis16209_probe,
+	.id_table = adis16209_ids,
 };
 module_spi_driver(adis16209_driver);
 
 MODULE_AUTHOR("Barry Song <[email protected]>");
 MODULE_DESCRIPTION("Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer");
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("spi:adis16209");
 MODULE_IMPORT_NS("IIO_ADISLIB");
Signature · 1 line
2.56.0
#2 lore raw

PATCH 2/2 iio: accel: adis16209: Add OF device ID table

In reply to Shehryar Ahmad

Add of_device_id table for adis16209 and register it with MODULE_DEVICE_TABLE() to enable device tree based matching.

---
 drivers/iio/accel/adis16209.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/iio/accel/adis16209.c +7 -0
index 07a682d68..2dd140dd5 100644
@@ -298,6 +298,12 @@ static int adis16209_probe(struct spi_device *spi)
 	return devm_iio_device_register(&spi->dev, indio_dev);
 }
 
+static const struct of_device_id adis16209_of_match[] = {
+	{ .compatible  = "adi,adis16209" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, adis16209_of_match);
+
 static const struct spi_device_id adis16209_ids[] = {
 	{ .name = "adis16209" },
 	{ }
@@ -307,6 +313,7 @@ MODULE_DEVICE_TABLE(spi, adis16209_ids);
 static struct spi_driver adis16209_driver = {
 	.driver = {
 		.name = "adis16209",
+		.of_match_table = adis16209_of_match,
 	},
 	.probe = adis16209_probe,
 	.id_table = adis16209_ids,
Signature · 1 line
2.56.0
Reviewed-by on the v1 series
#3 lore raw
In reply to Shehryar Ahmad
Quoted 4 lines · Shehryar Ahmad

Replaced old manual matching via MODULE_ALIAS to modern SPI matching table. Also added missing OF match table for DT based probe. Compatible adi,adis16209 is already enumerated in Documentation/devicetree/bindings/iio/accel/adi,adis16201.yaml

Both LGTM,

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#4 lore raw
Quoted 9 lines · On Fri, 16 Oct 2026 16:34:28 +0300 Andy Shevchenko…
Quoted 4 lines · Shehryar Ahmad

Replaced old manual matching via MODULE_ALIAS to modern SPI matching table. Also added missing OF match table for DT based probe. Compatible adi,adis16209 is already enumerated in Documentation/devicetree/bindings/iio/accel/adi,adis16201.yaml

Both LGTM,

Applied to the testing branch of iio.git which will be rebased on rc1 once available and then pushed out for linux-next to pick up.

Thanks,

Jonathan