Re: [PATCH v2] iio: humidity: am2315: add am2320 to i2c_device_id table

From: Marcelo Schmitt

Date: Mon Aug 10 2026 - 22:36:28 EST


On 08/10, 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.
>
> Signed-off-by: Nicolás Antinori <nico.antinori.7@xxxxxxxxx>
> ---
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.

> v2:
> - Adapted KConfig text using the suggestions from v1 by Nuno Sá and Andy
> Shevchenko
>
> v1: https://lore.kernel.org/all/20260805183733.1000550-1-nico.antinori.7@xxxxxxxxx/T/#u