iio: accel: adis16209: add missing SPI and OF matching table
Subsystems (2)
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
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
@@ -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
PATCH 2/2 iio: accel: adis16209: Add OF device ID table
In reply to Shehryar AhmadAdd 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
@@ -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
Quoted 4 lines · Shehryar Ahmad
Replaced old manual matching via
MODULE_ALIASto modern SPI matching table. Also added missing OF match table for DT based probe. Compatible adi,adis16209 is already enumerated inDocumentation/devicetree/bindings/iio/accel/adi,adis16201.yaml
Both LGTM,
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerQuoted 9 lines · On Fri, 16 Oct 2026 16:34:28 +0300 Andy Shevchenko…
Quoted 4 lines · Shehryar Ahmad
Replaced old manual matching via
MODULE_ALIASto modern SPI matching table. Also added missing OF match table for DT based probe. Compatible adi,adis16209 is already enumerated inDocumentation/devicetree/bindings/iio/accel/adi,adis16201.yamlBoth LGTM,
Reviewed-by Andy Shevchenko <[email protected]>
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