diff mbox series

[v2,3/4] iio: adc: ad7887: add OF match table

Message ID 20201119100748.57689-3-alexandru.ardelean@analog.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/4] iio: adc: ad7887: convert dual-channel mode to DT/ACPI | expand

Commit Message

Alexandru Ardelean Nov. 19, 2020, 10:07 a.m. UTC
This will make the driver probe-able via device-tree and ACPI via PRP0001.
While the SPI match table may be sufficient, this should extend the cover
of this driver being probed by other methods.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/iio/adc/ad7887.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c
index c28f704301d9..eb3a5b0080ee 100644
--- a/drivers/iio/adc/ad7887.c
+++ b/drivers/iio/adc/ad7887.c
@@ -341,9 +341,16 @@  static const struct spi_device_id ad7887_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad7887_id);
 
+static const struct of_device_id ad7887_of_match[] = {
+	{ .compatible = "adi,ad7887" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, ad7887_of_match);
+
 static struct spi_driver ad7887_driver = {
 	.driver = {
 		.name	= "ad7887",
+		.of_match_table	= ad7887_of_match,
 	},
 	.probe		= ad7887_probe,
 	.id_table	= ad7887_id,