Re: [PATCH v3 3/6] iio: chemical: add driver for ENS160 sensor
From: Jonathan Cameron
Date: Sun Jun 09 2024 - 05:31:18 EST
On Tue, 4 Jun 2024 19:57:27 -0300
Gustavo Silva <gustavograzs@xxxxxxxxx> wrote:
> ScioSense ENS160 is a digital metal oxide multi-gas sensor, designed
> for indoor air quality monitoring. The driver supports readings of
> CO2 and VOC, and can be accessed via both SPI and I2C.
>
> Datasheet: https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf
>
No blank lines in tags block. Datahsheet is a semi official tag.
I'll tidy up in this and previous patch if everything else fine.
> Signed-off-by: Gustavo Silva <gustavograzs@xxxxxxxxx>
> ---
> drivers/iio/chemical/Kconfig | 22 +++
> drivers/iio/chemical/Makefile | 3 +
> drivers/iio/chemical/ens160.h | 7 +
> drivers/iio/chemical/ens160_core.c | 221 +++++++++++++++++++++++++++++
> drivers/iio/chemical/ens160_i2c.c | 60 ++++++++
> drivers/iio/chemical/ens160_spi.c | 60 ++++++++
> 6 files changed, 373 insertions(+)
> create mode 100644 drivers/iio/chemical/ens160.h
> create mode 100644 drivers/iio/chemical/ens160_core.c
> create mode 100644 drivers/iio/chemical/ens160_i2c.c
> create mode 100644 drivers/iio/chemical/ens160_spi.c
>
> diff --git a/drivers/iio/chemical/Kconfig b/drivers/iio/chemical/Kconfig
> index 02649ab81..e407afab8 100644
> --- a/drivers/iio/chemical/Kconfig
> +++ b/drivers/iio/chemical/Kconfig
> @@ -76,6 +76,28 @@ config CCS811
> Say Y here to build I2C interface support for the AMS
> CCS811 VOC (Volatile Organic Compounds) sensor
>
> +config ENS160
> + tristate "ScioSense ENS160 sensor driver"
> + depends on (I2C || SPI)
> + select REGMAP
> + select ENS160_I2C if I2C
> + select ENS160_SPI if SPI
> + help
> + Say yes here to build support for ScioSense ENS160 multi-gas sensor.
> +
> + This driver can also be built as a module. If so, the module for I2C
> + would be called ens160_i2c and ens160_spi for SPI support.
> +
> +config ENS160_I2C
> + tristate
> + depends on I2C && ENS160
> + select REGMAP_I2C
> +
> +config ENS160_SPI
> + tristate
> + depends on SPI && ENS160
> + select REGMAP_SPI
As these two config symbols aren't exposed I think you don't need the
depends lines.
See the BMA400 entry in drivers/iio/accel/Kconfig for example.
If everything else looks good I'll drop those two lines whilst
applying.
Jonathan