From: "Nicolás Antinori" <nico.antinori.7@gmail.com>
To: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Andy Shevchenko" <andy@kernel.org>,
"Brigham Campbell" <me@brighamcampbell.com>,
"David Lechner" <dlechner@baylibre.com>,
"Jori Koolstra" <jkoolstra@xs4all.nl>,
"Nuno Sá" <nuno.sa@analog.com>,
"Shuah Khan" <skhan@linuxfoundation.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH v2] iio: humidity: am2315: add am2320 to i2c_device_id table
Date: Tue, 11 Aug 2026 12:12:57 -0300 [thread overview]
Message-ID: <DKM7MV8J10HS.2OIM1TDHB9VHQ@gmail.com> (raw)
In-Reply-To: <anrRkty6ugdJUGmE@ashevche-desk.local>
On Mon Aug 10, 2026 at 4:28 PM -03, David Lechner wrote:
> On 8/10/26 1:32 PM, Nicolás Antinori wrote:
>> The AM2320 is fully compatible with the AM2315 sensor in terms of I2C
>> communication protocol and measurement conversions.
>>
>> Add the "am2320" entry to the i2c_device_id table.
>
> Interesting. No devicetree bindings for this one? What kind of
> system is it on?
>
I am testing this on a Raspberry Pi 3b mounted on a protoboard.
On Tue Aug 11, 2026 at 4:38 AM -03, Andy Shevchenko wrote:
> On Mon, Aug 10, 2026 at 11:36:48PM -0300, Marcelo Schmitt wrote:
>> On 08/10, Nicolás Antinori wrote:
>
> ...
>
>> David's comment about the IIO device name sounds appropriate.
>> The am2315 driver might use a chip_info struct to hold the name of each specific design.
>> There are many drivers in IIO that already have such things.
>> drivers/iio/accel/adxl372_i2c.c is one example.
>>
>> An alternative might be to use the device id.
>>
>> const struct i2c_device_id *id = i2c_client_get_device_id(client);
>> ...
>>
>> indio_dev->name = id->name;
>>
>> Not sure if the second option works well for both i2c and dt (probably not), so
>> I'd suggest the chip_info approach if you intend to add a device tree id table.
>
> Indeed, we suggest chip_info for the more robust approach when name is provided
> via string literals independently on the ID tables (as there maybe same ID in
> the tables for the slightly different devices that may be autodetected runtime,
> or different IDs for the same or fully compatible component; the chip_info works
> for the latter case).
Thank you all for the suggestions. I am going to try to implement
chip_info struct.
I'll wait a little bit to send the v3 in case there are some more
comments on this version.
Regards,
Nicolás
next prev parent reply other threads:[~2026-08-11 15:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 18:32 [PATCH v2] iio: humidity: am2315: add am2320 to i2c_device_id table Nicolás Antinori
2026-08-10 18:53 ` Andy Shevchenko
2026-08-10 19:28 ` David Lechner
2026-08-11 2:36 ` Marcelo Schmitt
2026-08-11 7:38 ` Andy Shevchenko
2026-08-11 15:12 ` Nicolás Antinori [this message]
2026-08-11 15:49 ` David Lechner
2026-08-11 17:58 ` Nicolás Antinori
2026-08-11 18:06 ` David Lechner
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=DKM7MV8J10HS.2OIM1TDHB9VHQ@gmail.com \
--to=nico.antinori.7@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=jkoolstra@xs4all.nl \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=me@brighamcampbell.com \
--cc=nuno.sa@analog.com \
--cc=skhan@linuxfoundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.