mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table
@ 2026-10-16 11:45 Shehryar Ahmad
  2026-10-16 11:45 ` [PATCH 1/2] iio: accel: adis16209: add SPI device ID table Shehryar Ahmad
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shehryar Ahmad @ 2026-10-16 11:45 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Nuno Sá,
	Michael Hennerich, David Lechner, Andy Shevchenko, linux,
	linux-iio, linux-kernel, 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

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(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] iio: accel: adis16209: add SPI device ID table
  2026-10-16 11:45 [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table Shehryar Ahmad
@ 2026-10-16 11:45 ` Shehryar Ahmad
  2026-10-16 11:45 ` [PATCH 2/2] iio: accel: adis16209: Add OF " Shehryar Ahmad
  2026-10-16 13:34 ` [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Shehryar Ahmad @ 2026-10-16 11:45 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Nuno Sá,
	Michael Hennerich, David Lechner, Andy Shevchenko, linux,
	linux-iio, linux-kernel, Shehryar Ahmad

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

Signed-off-by: Shehryar Ahmad <shehryar.amd@gmail.com>
---
 drivers/iio/accel/adis16209.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/accel/adis16209.c b/drivers/iio/accel/adis16209.c
index 04e169f22..07a682d68 100644
--- a/drivers/iio/accel/adis16209.c
+++ b/drivers/iio/accel/adis16209.c
@@ -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 <21cnbao@gmail.com>");
 MODULE_DESCRIPTION("Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer");
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("spi:adis16209");
 MODULE_IMPORT_NS("IIO_ADISLIB");
-- 
2.56.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] iio: accel: adis16209: Add OF device ID table
  2026-10-16 11:45 [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table Shehryar Ahmad
  2026-10-16 11:45 ` [PATCH 1/2] iio: accel: adis16209: add SPI device ID table Shehryar Ahmad
@ 2026-10-16 11:45 ` Shehryar Ahmad
  2026-10-16 13:34 ` [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Shehryar Ahmad @ 2026-10-16 11:45 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Nuno Sá,
	Michael Hennerich, David Lechner, Andy Shevchenko, linux,
	linux-iio, linux-kernel, Shehryar Ahmad

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

Signed-off-by: Shehryar Ahmad <shehryar.amd@gmail.com>
---
 drivers/iio/accel/adis16209.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/iio/accel/adis16209.c b/drivers/iio/accel/adis16209.c
index 07a682d68..2dd140dd5 100644
--- a/drivers/iio/accel/adis16209.c
+++ b/drivers/iio/accel/adis16209.c
@@ -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,
-- 
2.56.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table
  2026-10-16 11:45 [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table Shehryar Ahmad
  2026-10-16 11:45 ` [PATCH 1/2] iio: accel: adis16209: add SPI device ID table Shehryar Ahmad
  2026-10-16 11:45 ` [PATCH 2/2] iio: accel: adis16209: Add OF " Shehryar Ahmad
@ 2026-10-16 13:34 ` Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-10-16 13:34 UTC (permalink / raw)
  To: Shehryar Ahmad
  Cc: Jonathan Cameron, Nuno Sá,
	Michael Hennerich, David Lechner, Andy Shevchenko, linux,
	linux-iio, linux-kernel

On Fri, Oct 16, 2026 at 04:45:25PM +0500, Shehryar Ahmad wrote:
> 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,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-16 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 11:45 [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table Shehryar Ahmad
2026-10-16 11:45 ` [PATCH 1/2] iio: accel: adis16209: add SPI device ID table Shehryar Ahmad
2026-10-16 11:45 ` [PATCH 2/2] iio: accel: adis16209: Add OF " Shehryar Ahmad
2026-10-16 13:34 ` [PATCH 0/2] iio: accel: adis16209: add missing SPI and OF matching table Andy Shevchenko

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®