From: Lars-Peter Clausen <lars@metafoo.de>
To: Michael Auchter <michael.auchter@ni.com>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] iio: dac: ad5686: add of_match_table
Date: Wed, 18 Mar 2020 18:33:58 +0100 [thread overview]
Message-ID: <b67c7147-e35c-2408-8324-c688af4e82b7@metafoo.de> (raw)
In-Reply-To: <20200318153434.62833-2-michael.auchter@ni.com>
On 3/18/20 4:34 PM, Michael Auchter wrote:
> 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" },
Same here, table should be ordered.
> + {}
> +};
> +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,
>
next prev parent reply other threads:[~2020-03-18 17:34 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 ` [PATCH 2/3] iio: dac: ad5686: add of_match_table Michael Auchter
2020-03-18 17:33 ` Lars-Peter Clausen [this message]
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=b67c7147-e35c-2408-8324-c688af4e82b7@metafoo.de \
--to=lars@metafoo.de \
--cc=Michael.Hennerich@analog.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=michael.auchter@ni.com \
--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).