From: Jonathan Cameron <jic23@kernel.org>
To: Siddharth Manthan <siddharth_manthan@outlook.com>
Cc: robh+dt@kernel.org, ktsai@capellamicro.com, lars@metafoo.de,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, nikita@trvn.ru
Subject: Re: [PATCH 2/2] drivers: iio: light: cm3323: Add device tree support
Date: Wed, 28 Jul 2021 18:56:41 +0100 [thread overview]
Message-ID: <20210728185641.7ea37875@jic23-huawei> (raw)
In-Reply-To: <SG2PR02MB38141E2560616F0514CF9A768FEA9@SG2PR02MB3814.apcprd02.prod.outlook.com>
On Wed, 28 Jul 2021 17:52:16 +0530
Siddharth Manthan <siddharth_manthan@outlook.com> wrote:
> Add Device Tree support for Capella cm3323 Ambient Light Sensor
>
> Signed-off-by: Siddharth Manthan <siddharth_manthan@outlook.com>
It 'should' have worked without the explicit of_device_id table,
via the fallback that I2C has to use the i2c_device_id table.
I'm fine with making it explicit though as that route doesn't
use the vendor ID at all, so we 'might' get a clash.
I'll change the patch title when applying to something like
iio:light:cm3323: Add of_device_id table
Note also drop the drivers bit as we don't normally have that for
IIO devices.
Jonathan
> ---
> drivers/iio/light/cm3323.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/iio/light/cm3323.c b/drivers/iio/light/cm3323.c
> index 6d1b0ffd1..fd9a8c27d 100644
> --- a/drivers/iio/light/cm3323.c
> +++ b/drivers/iio/light/cm3323.c
> @@ -256,9 +256,16 @@ static const struct i2c_device_id cm3323_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, cm3323_id);
>
> +static const struct of_device_id cm3323_of_match[] = {
> + { .compatible = "capella,cm3323", },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, cm3323_of_match);
> +
> static struct i2c_driver cm3323_driver = {
> .driver = {
> .name = CM3323_DRV_NAME,
> + .of_match_table = cm3323_of_match,
> },
> .probe = cm3323_probe,
> .id_table = cm3323_id,
next parent reply other threads:[~2021-07-28 17:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210728122216.22849-1-siddharth_manthan@outlook.com>
[not found] ` <SG2PR02MB38141E2560616F0514CF9A768FEA9@SG2PR02MB3814.apcprd02.prod.outlook.com>
2021-07-28 17:56 ` Jonathan Cameron [this message]
2021-07-28 11:00 [PATCH 1/2] dt-bindings: Add bindings for Capella cm3323 Ambient Light Sensor Siddharth Manthan
2021-07-28 11:00 ` [PATCH 2/2] drivers: iio: light: cm3323: Add device tree support Siddharth Manthan
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=20210728185641.7ea37875@jic23-huawei \
--to=jic23@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=ktsai@capellamicro.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nikita@trvn.ru \
--cc=robh+dt@kernel.org \
--cc=siddharth_manthan@outlook.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;
as well as URLs for NNTP newsgroup(s).