Skip to contentSkip to conversation

iio: pressure: add driver and bindings for adp810

PATCH In review Akhilesh Patil 3 participants 5 messages Oct 25, 2025 – Oct 27, 2025

Subsystems (4)
lore
Share & tools
lore

Akhilesh Patil

author maintainer
#0 lore raw

v4 cover iio: pressure: add driver and bindings for adp810

This patch series adds support for aosong adp810 differential pressure and temperature sensor driver in the IIO subsystem.

Patch 1: Adds bindings for this hardware. Patch 2: Adds driver code with device tree support.

Overview of adp810:
This is digital differential pressure and temperature sensor from aosong under the brand name of ASAIR. This sensor can measure pressure from -500 to +500Pa and temperature from -40 to +85 degree. It provides simple protocol to measure readings over I2C bus interface.

How to read from sensor (Protocol)?
To read from sensor, i2c master needs to send measure command 0x372d to start the data acquisition. Then host/master should wait for minimum 10ms for data to be ready before reading. Post this delay i2c master can read 9 bytes of measurement data which includes - pressure(u16): crc(u8): temperature(u16): crc(u8) scale factor (u16): crc(8).
Host/master can optionally verify crc for data integrity. Read sequence can be terminated anytime by sending NAK.

Datasheet: https://aosong.com/userfiles/files/media/Datasheet%20ADP810-Digital.pdf

Testing:
Driver is tested on Texas Instruments am62x sk board by connecting sensor at i2c-2. Data communication is validated with i2c bus at 100KHz and 400KHz using logic analyzer. Sensor values are read using iio subsystem's sysfs interface.

Changes in v4:
- Revert reordering of other entries in pressure/Makefile. Only add adp810.o at alphabetically correct place. Makefile reordering will be separate patch.
- Added additional include files types.h, array_size.h and error.h to follow IWYU.
- Fixed trigger command sending logic in case of big endian systems by using u8 array instead of u16 variable.
- Removed ADP810_MEASURE_LATENCY_MS macro and used it directly in msleep() with 20ms delay value. Improved comments for it.
- Tab and spacing cleanup at .read_raw callback.
- Added comments at adp810_read_buf struct declaration regarding usage of __packed.
- Link to v3: https://lore.kernel.org/lkml/[email protected]/

Changes in v3:
- Followed Include What You Use (IWYU) by adding additional include files (mutex.h, dev_printk.h and few others)
- Improved error handling of i2c_master_send() and i2c_master_recv() with additional transfer length checks.
- Changed style of structure initialization from {0} to { }
- Rebased on top of v6.18-rc2
- Link to v2: https://lore.kernel.org/lkml/[email protected]/

Changes in v2:
- Wrapped yaml binding description to 80 lines.
- Dropped block scalar ' | ' from binding description.
- Carry forward Reviewed-by tag from Krzysztof on device tree binding.
- Grammar and spelling fixes at multiple places.
- Ordered makefile alphabetically.
- Ordered include files alphabetically and used IWYU principle
- Explicitly mentioned unit of measure latency macro in MS (milliseconds)
- Added inline comments for explaining CRC8 polynomial for CRC calculation
- Used scoped_guard() for mutex for safe and clean lock handling.
- Used resource managed mutex_init() -> devm_mutex_init()
- Removed dead code in _probe() function.
- Used __be16 and related helpers to handle big endian data processing.
- Apply reverse xmas tree guideline while declaring local variables if possible.
- Used parent device pointer in dev_err() calls.
- Hardcode device name string in _probe() function for simplicity.
- Made default return value of _probe() function to 0.
- Rebased and retested driver on top of 6.18-rc1
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

Akhilesh Patil (2):
dt-bindings: iio: pressure: Add Aosong adp810
iio: pressure: adp810: Add driver for adp810 sensor

 .../bindings/iio/pressure/aosong,adp810.yaml  |  46 ++++
 MAINTAINERS                                   |   7 +
 drivers/iio/pressure/Kconfig                  |  12 +
 drivers/iio/pressure/Makefile                 |   1 +
 drivers/iio/pressure/adp810.c                 | 225 ++++++++++++++++++
 5 files changed, 291 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/pressure/aosong,adp810.yaml
 create mode 100644 drivers/iio/pressure/adp810.c
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH v4 1/2 dt-bindings: iio: pressure: Add Aosong adp810

Add bindings for adp810 differential pressure and temperature sensor. This sensor communicates over I2C with CRC support and can measure pressure in the range -500 to 500Pa and temperature in the range -40 to +85 degree celsius.

---
 .../bindings/iio/pressure/aosong,adp810.yaml  | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/pressure/aosong,adp810.yaml
Documentation/devicetree/bindings/iio/pressure/aosong,adp810.yaml new file +46 -0
new file mode 100644
index 000000000000..b35eb63531c2
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/pressure/aosong,adp810.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: aosong adp810 differential pressure sensor
+
+maintainers:
+  - Akhilesh Patil <[email protected]>
+
+description:
+  ADP810 is differential pressure and temperature sensor. It has I2C bus
+  interface with fixed address of 0x25. This sensor supports 8 bit CRC for
+  reliable data transfer. It can measure differential pressure in the
+  range -500 to 500Pa and temperate in the range -40 to +85 degree celsius.
+
+properties:
+  compatible:
+    enum:
+      - aosong,adp810
+
+  reg:
+    maxItems: 1
+
+  vdd-supply: true
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        pressure-sensor@25 {
+            compatible = "aosong,adp810";
+            reg = <0x25>;
+            vdd-supply = <&vdd_regulator>;
+        };
+    };
+
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH v4 2/2 iio: pressure: adp810: Add driver for adp810 sensor

In reply to Akhilesh Patil

Add driver for Aosong adp810 differential pressure and temperature sensor. This sensor provides an I2C interface for reading data. Calculate CRC of the data received using standard crc8 library to verify data integrity.

Tested on TI am62x sk board with sensor connected at i2c-2.

---
 MAINTAINERS                   |   7 ++
 drivers/iio/pressure/Kconfig  |  12 ++
 drivers/iio/pressure/Makefile |   1 +
 drivers/iio/pressure/adp810.c | 225 ++++++++++++++++++++++++++++++++++
 4 files changed, 245 insertions(+)
 create mode 100644 drivers/iio/pressure/adp810.c
MAINTAINERS +7 -0
index 3da2c26a796b..3f10755661e6 100644
@@ -3749,6 +3749,13 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
 F:	drivers/iio/chemical/ags02ma.c
 
+AOSONG ADP810 DIFFERENTIAL PRESSURE SENSOR DRIVER
+M:	Akhilesh Patil <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/iio/pressure/aosong,adp810.yaml
+F:	drivers/iio/pressure/adp810.c
+
 ASC7621 HARDWARE MONITOR DRIVER
 M:	George Joseph <[email protected]>
 L:	[email protected]
drivers/iio/pressure/Kconfig +12 -0
index d2cb8c871f6a..2fe9dc90cceb 100644
@@ -339,4 +339,16 @@ config ZPA2326_SPI
 	tristate
 	select REGMAP_SPI
 
+config ADP810
+	tristate "Aosong adp810 differential pressure and temperature sensor"
+	depends on I2C
+	select CRC8
+	help
+	  Say yes here to build adp810 differential pressure and temperature
+	  sensor driver. ADP810 can measure pressure range up to 500Pa.
+	  It supports an I2C interface for data communication.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called adp810
+
 endmenu
drivers/iio/pressure/Makefile +1 -0
index 6482288e07ee..47bf7656f975 100644
@@ -5,6 +5,7 @@
 
 # When adding new entries keep the list in alphabetical order
 obj-$(CONFIG_ABP060MG) += abp060mg.o
+obj-$(CONFIG_ADP810) += adp810.o
 obj-$(CONFIG_ROHM_BM1390) += rohm-bm1390.o
 obj-$(CONFIG_BMP280) += bmp280.o
 bmp280-objs := bmp280-core.o bmp280-regmap.o
drivers/iio/pressure/adp810.c new file +225 -0

225 lines not on this page · raw message

Signature · 1 line
2.34.1
Reviewed-by on v4 2/2
#3 lore raw

Re: [PATCH v4 2/2] iio: pressure: adp810: Add driver for adp810 sensor

Quoted 6 lines · Akhilesh Patil

Add driver for Aosong adp810 differential pressure and temperature sensor. This sensor provides an I2C interface for reading data. Calculate CRC of the data received using standard crc8 library to verify data integrity.

Tested on TI am62x sk board with sensor connected at i2c-2.

LGTM,

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#4 lore raw

Re: [PATCH v4 2/2] iio: pressure: adp810: Add driver for adp810 sensor

Quoted 10 lines · On Mon, 27 Oct 2025 11:20:19 +0200 Andy Shevchenko…
Quoted 6 lines · Akhilesh Patil

Add driver for Aosong adp810 differential pressure and temperature sensor. This sensor provides an I2C interface for reading data. Calculate CRC of the data received using standard crc8 library to verify data integrity.

Tested on TI am62x sk board with sensor connected at i2c-2.

LGTM,

Thanks as ever for reviewing Andy.

Akhilesh,

Nice little driver. Good work.

Applied to the testing branch of iio.git for now to let the bots poke at it.

thanks,

Jonathan

Quoted 1 line