summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoão Seckler <joaoseckler@gmail.com>2019-05-18 19:27:33 -0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-05-26 18:48:14 +0100
commit094c52dbaf0a9aae5cef59eaa17cf257aa76bd74 (patch)
treee84195b683a5f625566662cbb705d073f5edf8ca /drivers
parented83144e6d71bc0ac56805388bdd04949beb1be7 (diff)
downloadlinux-094c52dbaf0a9aae5cef59eaa17cf257aa76bd74.tar.bz2
staging: iio: ad7746: add device tree support
Add a of_device_id struct variable and subsequent call to MODULE_DEVICE_TABLE macro to support device tree. Signed-off-by: João Seckler <joaoseckler@gmail.com> Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com> Co-developed-by: Lucas Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/iio/cdc/ad7746.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
index 47610d863908..21527d84f940 100644
--- a/drivers/staging/iio/cdc/ad7746.c
+++ b/drivers/staging/iio/cdc/ad7746.c
@@ -748,9 +748,19 @@ static const struct i2c_device_id ad7746_id[] = {
MODULE_DEVICE_TABLE(i2c, ad7746_id);
+static const struct of_device_id ad7746_of_match[] = {
+ { .compatible = "adi,ad7745" },
+ { .compatible = "adi,ad7746" },
+ { .compatible = "adi,ad7747" },
+ { },
+};
+
+MODULE_DEVICE_TABLE(of, ad7746_of_match);
+
static struct i2c_driver ad7746_driver = {
.driver = {
.name = KBUILD_MODNAME,
+ .of_match_table = ad7746_of_match,
},
.probe = ad7746_probe,
.id_table = ad7746_id,