lkml.org 
[lkml]   [2020]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 3/4] iio: adc: ad7887: add OF match table
Date
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 --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,
--
2.17.1
\
 
 \ /
  Last update: 2020-11-19 11:04    [W:0.072 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site