[PATCH v2 0/2] iio: pressure: add Sensirion SDP31 driver

Muhammad Abu Bakar posted 2 patches 4 days, 3 hours ago
.../iio/pressure/sensirion,sdp31.yaml         |  41 ++++
MAINTAINERS                                   |   6 +
drivers/iio/pressure/Kconfig                  |  11 +
drivers/iio/pressure/Makefile                 |   1 +
drivers/iio/pressure/sdp31.c                  | 209 ++++++++++++++++++
5 files changed, 268 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/pressure/sensirion,sdp31.yaml
create mode 100644 drivers/iio/pressure/sdp31.c
[PATCH v2 0/2] iio: pressure: add Sensirion SDP31 driver
Posted by Muhammad Abu Bakar 4 days, 3 hours ago
This series adds support for the Sensirion SDP31 differential pressure
sensor, an I2C device that also reports temperature.

The SDP31 uses a completely different I2C command protocol from the
already supported SDP500 (command-triggered measurements with a per-word
CRC-8), so extending the sdp500 driver does not make sense. No compatible
parts from other vendors were found.

Patch 1 adds the device tree binding.
Patch 2 adds the IIO driver, which exposes differential pressure and
temperature channels and validates each measurement using the sensor's
CRC-8 checksum.

The driver was developed and tested on an SDP31 wired to the I2C bus of
a Raspberry Pi 4.

Changes since v1:
- Explain in this cover letter why a new driver is added instead of
  extending the sdp500 driver.
- dt-bindings: make vdd-supply required, and enable the regulator in the
  driver using devm_regulator_get_enable().
- Move the MAINTAINERS entry into the dt-bindings patch; the driver patch
  only adds its own file.
- Populate the CRC-8 table with DO_ONCE() to avoid a race between
  concurrent probes.
- Use devm_mutex_init() and take the lock inside sdp31_measure() using
  guard(mutex).
- Build the command with __be16/cpu_to_be16() and parse the reply with
  get_unaligned_be16().
- Use a named initializer in the i2c_device_id table.
- Minor cleanups: local struct device *dev, single-line dev_err_probe(),
  and a comment on the mutex.

v1: https://lore.kernel.org/linux-iio/20260919223650.13396-1-m.abubakar365@yahoo.com/

Muhammad Abu Bakar (2):
  dt-bindings: iio: pressure: add Sensirion SDP31
  iio: pressure: add Sensirion SDP31 driver

 .../iio/pressure/sensirion,sdp31.yaml         |  41 ++++
 MAINTAINERS                                   |   6 +
 drivers/iio/pressure/Kconfig                  |  11 +
 drivers/iio/pressure/Makefile                 |   1 +
 drivers/iio/pressure/sdp31.c                  | 209 ++++++++++++++++++
 5 files changed, 268 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/pressure/sensirion,sdp31.yaml
 create mode 100644 drivers/iio/pressure/sdp31.c

-- 
2.43.0
Re: [PATCH v2 0/2] iio: pressure: add Sensirion SDP31 driver
Posted by Krzysztof Kozlowski 7 hours ago
On Sun, Sep 20, 2026 at 09:47:22PM +0500, Muhammad Abu Bakar wrote:
> This series adds support for the Sensirion SDP31 differential pressure
> sensor, an I2C device that also reports temperature.
> 
> The SDP31 uses a completely different I2C command protocol from the
> already supported SDP500 (command-triggered measurements with a per-word
> CRC-8), so extending the sdp500 driver does not make sense. No compatible
> parts from other vendors were found.
> 
> Patch 1 adds the device tree binding.
> Patch 2 adds the IIO driver, which exposes differential pressure and
> temperature channels and validates each measurement using the sensor's
> CRC-8 checksum.
> 
> The driver was developed and tested on an SDP31 wired to the I2C bus of
> a Raspberry Pi 4.
> 
> Changes since v1:
> - Explain in this cover letter why a new driver is added instead of
>   extending the sdp500 driver.
> - dt-bindings: make vdd-supply required, and enable the regulator in the
>   driver using devm_regulator_get_enable().
> - Move the MAINTAINERS entry into the dt-bindings patch; the driver patch
>   only adds its own file.
> - Populate the CRC-8 table with DO_ONCE() to avoid a race between
>   concurrent probes.
> - Use devm_mutex_init() and take the lock inside sdp31_measure() using
>   guard(mutex).
> - Build the command with __be16/cpu_to_be16() and parse the reply with
>   get_unaligned_be16().
> - Use a named initializer in the i2c_device_id table.
> - Minor cleanups: local struct device *dev, single-line dev_err_probe(),
>   and a comment on the mutex.
> 
> v1: https://lore.kernel.org/linux-iio/20260919223650.13396-1-m.abubakar365@yahoo.com/

Link does not work.

Best regards,
Krzysztof