[PATCH 10/22] iio: dac: ad5686: add of_match table to the spi driver

Rodrigo Alencar via B4 Relay
2026-04-22T14:46:24Z

From: Rodrigo Alencar <rodrigo.alencar@analog.com>

Add of_match table for the SPI device variants to be consistent with the
AD5696 I2C driver.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
---
drivers/iio/dac/ad5686-spi.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/drivers/iio/dac/ad5686-spi.c b/drivers/iio/dac/ad5686-spi.c
index 7a7a19a01b56..6c9b70880da9 100644
--- a/drivers/iio/dac/ad5686-spi.c
+++ b/drivers/iio/dac/ad5686-spi.c
@@ -118,9 +118,30 @@ static const struct spi_device_id ad5686_spi_id[] = {
};
MODULE_DEVICE_TABLE(spi, ad5686_spi_id);

+static const struct of_device_id ad5686_of_match[] = {
+ { .compatible = "adi,ad5310r", .data = &ad5310r_chip_info },
+ { .compatible = "adi,ad5672r", .data = &ad5672r_chip_info },
+ { .compatible = "adi,ad5674r", .data = &ad5674r_chip_info },
+ { .compatible = "adi,ad5676", .data = &ad5676_chip_info },
+ { .compatible = "adi,ad5676r", .data = &ad5676r_chip_info },
+ { .compatible = "adi,ad5679r", .data = &ad5679r_chip_info },
+ { .compatible = "adi,ad5681r", .data = &ad5681r_chip_info },
+ { .compatible = "adi,ad5682r", .data = &ad5682r_chip_info },
+ { .compatible = "adi,ad5683", .data = &ad5683_chip_info },
+ { .compatible = "adi,ad5683r", .data = &ad5683r_chip_info },
+ { .compatible = "adi,ad5684", .data = &ad5684_chip_info },
+ { .compatible = "adi,ad5684r", .data = &ad5684r_chip_info },
+ { .compatible = "adi,ad5685r", .data = &ad5685r_chip_info },
+ { .compatible = "adi,ad5686", .data = &ad5686_chip_info },
+ { .compatible = "adi,ad5686r", .data = &ad5686r_chip_info },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ad5686_of_match);
+
static struct spi_driver ad5686_spi_driver = {
.driver = {
.name = "ad5686",
+ .of_match_table = ad5686_of_match,
},
.probe = ad5686_spi_probe,
.id_table = ad5686_spi_id,

--
2.43.0