From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Akhilesh Patil <akhilesh.patil@linux.dev>
Cc: jic23@kernel.org, andy@kernel.org, krzk+dt@kernel.org,
robh@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
conor+dt@kernel.org, joshua.crofts1@gmail.com,
maxwell@maxwelld.cc, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
akhileshpatilvnit@gmail.com, akhilesh@ee.iitb.ac.in
Subject: Re: [PATCH v2 2/2] iio: chemical: acd10: Add driver for ACD10 CO2 sensor
Date: Thu, 3 Dec 2026 09:56:44 +0100 [thread overview]
Message-ID: <axEt2HAgqaBG5SC-@monoceros> (raw)
In-Reply-To: <8aad2c61de154bd9ffc82aa94747da6fa8333687.1796211342.git.akhilesh.patil@linux.dev>
[-- Attachment #1: Type: text/plain, Size: 4227 bytes --]
Hello,
On Wed, Dec 02, 2026 at 12:25:22PM +0000, Akhilesh Patil wrote:
> Add driver for Aosong ASAIR ACD10 carbon dioxide sensor.
> Use serdev interface to communicate with sensor over UART.
> Implement read co2, get software revision, get instrument number
> commands.
>
> Tested on TI am62x sk board on UART5 with 1200 baud rate.
>
> Signed-off-by: Akhilesh Patil <akhilesh.patil@linux.dev>
> ---
> MAINTAINERS | 7 +
> drivers/iio/chemical/Kconfig | 10 +
> drivers/iio/chemical/Makefile | 3 +
> drivers/iio/chemical/acd10.c | 389 ++++++++++++++++++++++++++++++++++
> 4 files changed, 409 insertions(+)
> create mode 100644 drivers/iio/chemical/acd10.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e8f06145fb54..a5d70cd11dda 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3743,6 +3743,13 @@ S: Supported
> W: http://www.akm.com/
> F: drivers/iio/magnetometer/ak8974.c
>
> +AOSONG ACD10 CARBON DIOXIDE SENSOR DRIVER
> +M: Akhilesh Patil <akhilesh.patil@linux.dev>
> +L: linux-iio@vger.kernel.org
> +S: Maintained
> +F: Documentation/devicetree/bindings/iio/chemical/aosong,acd10.yaml
> +F: drivers/iio/chemical/acd10.c
> +
> AOSONG AGS02MA TVOC SENSOR DRIVER
> M: Anshul Dalal <anshulusr@gmail.com>
> L: linux-iio@vger.kernel.org
> diff --git a/drivers/iio/chemical/Kconfig b/drivers/iio/chemical/Kconfig
> index b22afa1f6d59..2bbf49135997 100644
> --- a/drivers/iio/chemical/Kconfig
> +++ b/drivers/iio/chemical/Kconfig
> @@ -5,6 +5,16 @@
>
> menu "Chemical Sensors"
>
> +config ACD10
> + tristate "Aosong ACD10 CO2 gas sensor"
> + depends on SERIAL_DEV_BUS
> + help
> + Say Y here to build Aosong ASAIR ACD10 CO2 (carbon dioxide)
> + sensor driver.
> +
> + To compile this ACD10 driver as a loadable kernel module,
> + choose M here: the module will be called acd10
> +
> config AOSONG_AGS02MA
> tristate "Aosong AGS02MA TVOC sensor driver"
> depends on I2C
> diff --git a/drivers/iio/chemical/Makefile b/drivers/iio/chemical/Makefile
> index 2287a00a6b75..2187f596728c 100644
> --- a/drivers/iio/chemical/Makefile
> +++ b/drivers/iio/chemical/Makefile
> @@ -3,7 +3,10 @@
> # Makefile for IIO chemical sensors
> #
>
> +CONTEXT_ANALYSIS_acd10.o := y
> +
> # When adding new entries keep the list in alphabetical order
> +obj-$(CONFIG_ACD10) += acd10.o
> obj-$(CONFIG_AOSONG_AGS02MA) += ags02ma.o
> obj-$(CONFIG_ATLAS_PH_SENSOR) += atlas-sensor.o
> obj-$(CONFIG_ATLAS_EZO_SENSOR) += atlas-ezo-sensor.o
> diff --git a/drivers/iio/chemical/acd10.c b/drivers/iio/chemical/acd10.c
> new file mode 100644
> index 000000000000..a77dde636ea7
> --- /dev/null
> +++ b/drivers/iio/chemical/acd10.c
> @@ -0,0 +1,389 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * ACD10 CO2 gas sensor driver
> + *
> + * Copyright (c) 2026 Akhilesh Patil <akhilesh.patil@linux.dev>
> + *
> + * Datasheet:
> + * https://www.es.co.th/Schemetic/PDF/ACD10.PDF
> + *
> + * TODO additional features:
> + * 1) single-point calibration feature.
> + * 2) Sensor preheat wait feature.
> + */
> +
> +#include <linux/array_size.h>
> +#include <linux/bits.h>
> +#include <linux/cleanup.h>
> +#include <linux/completion.h>
> +#include <linux/dev_printk.h>
> +#include <linux/errno.h>
> +#include <linux/iio/iio.h>
> +#include <linux/iio/sysfs.h>
> +#include <linux/iio/types.h>
> +#include <linux/jiffies.h>
> +#include <linux/mod_devicetable.h>
In his review of v1
(https://lore.kernel.org/linux-iio/20261122192823.6a3430e6@jic23-hlaptop/)
Jonathan wrote about <linux/mod_devicetable.h>:
Not needed any more unless something is wrong in the serdev
header. These are now assumed to always come from the bus header.
With "These" refering to *_device_id
I confirm that <linux/serdev.h> indeed provides of_device_id (which is
the only one used in your driver). As I'm working on removing that
header, please drop it.
> +static const struct of_device_id acd10_of_match_table[] = {
> + { .compatible = "aosong,acd10", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, acd10_of_match_table);
Please also drop the , just before the closing }.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-12-03 8:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 12:23 [PATCH v2 0/2] iio: chemical: Add driver and bindings for acd10 Akhilesh Patil
2026-12-02 12:24 ` [PATCH v2 1/2] dt-bindings: iio: chemical: Add aosong acd10 Akhilesh Patil
2026-12-02 12:25 ` [PATCH v2 2/2] iio: chemical: acd10: Add driver for ACD10 CO2 sensor Akhilesh Patil
2026-12-02 12:33 ` sashiko-bot
2026-12-03 8:56 ` Uwe Kleine-König [this message]
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=axEt2HAgqaBG5SC-@monoceros \
--to=u.kleine-koenig@baylibre.com \
--cc=akhilesh.patil@linux.dev \
--cc=akhilesh@ee.iitb.ac.in \
--cc=akhileshpatilvnit@gmail.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=joshua.crofts1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxwell@maxwelld.cc \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.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.