From: Michael Auchter <michael.auchter@ni.com>
To: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Stefan Popa <stefan.popa@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 2/3] iio: dac: ad5686: add of_match_table
Date: Wed, 18 Mar 2020 10:34:33 -0500 [thread overview]
Message-ID: <20200318153434.62833-2-michael.auchter@ni.com> (raw)
In-Reply-To: <20200318153434.62833-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>
---
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 f100a5fe4219..26818bccffa2 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,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" },
+ { .compatible = "adi,ad5338r" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ad5686_of_match);
+
static struct i2c_driver ad5686_i2c_driver = {
.driver = {
.name = "ad5696",
+ .of_match_table = of_match_ptr(ad5686_of_match),
},
.probe = ad5686_i2c_probe,
.remove = ad5686_i2c_remove,
--
2.24.1
next prev parent reply other threads:[~2020-03-18 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 15:34 [PATCH 1/3] iio: dac: ad5686: add support for AD5338R Michael Auchter
2020-03-18 15:34 ` Michael Auchter [this message]
2020-03-18 17:33 ` [PATCH 2/3] iio: dac: ad5686: add of_match_table Lars-Peter Clausen
2020-03-22 0:33 ` Andy Shevchenko
2020-03-18 15:34 ` [PATCH 3/3] dt-bindings: iio: dac: ad5686: add binding Michael Auchter
2020-03-19 17:12 ` Rob Herring
2020-03-18 17:30 ` [PATCH 1/3] iio: dac: ad5686: add support for AD5338R Lars-Peter Clausen
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=20200318153434.62833-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 \
--cc=stefan.popa@analog.com \
/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