From: Michael Auchter <michael.auchter@ni.com>
To: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Michael Auchter <michael.auchter@ni.com>,
linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/3] iio: dac: ad5686: add of_match_table
Date: Tue, 22 Sep 2020 13:40:11 -0500 [thread overview]
Message-ID: <20200922184012.557622-2-michael.auchter@ni.com> (raw)
In-Reply-To: <20200922184012.557622-1-michael.auchter@ni.com>
Add of_match_table to this driver, so devices can be probed based on
device tree contents.
Signed-off-by: Michael Auchter <michael.auchter@ni.com>
---
Changes since v1:
- Drop of_match_ptr() use
drivers/iio/dac/ad5696-i2c.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c
index 89e7b063b7bb..a39eda7c02d2 100644
--- a/drivers/iio/dac/ad5696-i2c.c
+++ b/drivers/iio/dac/ad5696-i2c.c
@@ -88,9 +88,28 @@ static const struct i2c_device_id ad5686_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, ad5686_i2c_id);
+static const struct of_device_id ad5686_of_match[] = {
+ { .compatible = "adi,ad5311r" },
+ { .compatible = "adi,ad5338r" },
+ { .compatible = "adi,ad5671r" },
+ { .compatible = "adi,ad5675r" },
+ { .compatible = "adi,ad5691r" },
+ { .compatible = "adi,ad5692r" },
+ { .compatible = "adi,ad5693" },
+ { .compatible = "adi,ad5693r" },
+ { .compatible = "adi,ad5694" },
+ { .compatible = "adi,ad5694r" },
+ { .compatible = "adi,ad5695r" },
+ { .compatible = "adi,ad5696" },
+ { .compatible = "adi,ad5696r" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ad5686_of_match);
+
static struct i2c_driver ad5686_i2c_driver = {
.driver = {
.name = "ad5696",
+ .of_match_table = ad5686_of_match,
},
.probe = ad5686_i2c_probe,
.remove = ad5686_i2c_remove,
--
2.25.1
next prev parent reply other threads:[~2020-09-22 18:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 18:40 [PATCH v2 1/3] iio: dac: ad5686: add support for AD5338R Michael Auchter
2020-09-22 18:40 ` Michael Auchter [this message]
2020-09-22 18:40 ` [PATCH v2 3/3] dt-bindings: iio: dac: ad5686: add binding Michael Auchter
2020-09-23 20:15 ` Jonathan Cameron
2020-09-23 20:18 ` [PATCH v2 1/3] iio: dac: ad5686: add support for AD5338R Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200922184012.557622-2-michael.auchter@ni.com \
--to=michael.auchter@ni.com \
--cc=Michael.Hennerich@analog.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).