summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorStefan Popa <stefan.popa@analog.com>2018-12-13 14:46:20 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-12-22 16:58:14 +0000
commit43f9b204edf033b6fb87f761c70a8f55462983ae (patch)
treecd3af3ecd97ee67e440dc188a9b97ddeb0b3dac2 /drivers/staging/iio
parent6620585a0c9ee75332346ef2dcb1c4a7573db57b (diff)
downloadlinux-43f9b204edf033b6fb87f761c70a8f55462983ae.tar.bz2
staging: iio: adc: ad7606: Add OF device ID table
The driver does not have a struct of_device_id table, but supported devices are registered via Device Trees. This patch adds and OF device ID table. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/adc/ad7606_par.c10
-rw-r--r--drivers/staging/iio/adc/ad7606_spi.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c
index c04ce8ac97ff..da26742e8b46 100644
--- a/drivers/staging/iio/adc/ad7606_par.c
+++ b/drivers/staging/iio/adc/ad7606_par.c
@@ -91,12 +91,22 @@ static const struct platform_device_id ad7606_driver_ids[] = {
MODULE_DEVICE_TABLE(platform, ad7606_driver_ids);
+static const struct of_device_id ad7606_of_match[] = {
+ { .compatible = "adi,ad7605-4" },
+ { .compatible = "adi,ad7606-4" },
+ { .compatible = "adi,ad7606-6" },
+ { .compatible = "adi,ad7606-8" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, ad7606_of_match);
+
static struct platform_driver ad7606_driver = {
.probe = ad7606_par_probe,
.id_table = ad7606_driver_ids,
.driver = {
.name = "ad7606",
.pm = AD7606_PM_OPS,
+ .of_match_table = ad7606_of_match,
},
};
diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c
index f38594f38a31..e533917db094 100644
--- a/drivers/staging/iio/adc/ad7606_spi.c
+++ b/drivers/staging/iio/adc/ad7606_spi.c
@@ -58,9 +58,19 @@ static const struct spi_device_id ad7606_id[] = {
};
MODULE_DEVICE_TABLE(spi, ad7606_id);
+static const struct of_device_id ad7606_of_match[] = {
+ { .compatible = "adi,ad7605-4" },
+ { .compatible = "adi,ad7606-4" },
+ { .compatible = "adi,ad7606-6" },
+ { .compatible = "adi,ad7606-8" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, ad7606_of_match);
+
static struct spi_driver ad7606_driver = {
.driver = {
.name = "ad7606",
+ .of_match_table = ad7606_of_match,
.pm = AD7606_PM_OPS,
},
.probe = ad7606_spi_probe,