Re: [PATCH v5 2/2] iio: pressure: add Sensirion SDP31 driver
From: Andy Shevchenko
Date: Sat Oct 03 2026 - 15:14:21 EST
On Sat, Oct 03, 2026 at 09:09:49PM +0500, Muhammad Abu Bakar wrote:
> Add an IIO driver for the Sensirion SDP3x family of differential pressure
> sensors (SDP31, SDP32 and SDP33). The devices are accessed over I2C and
> report differential pressure and temperature. Each measurement is
> validated using the sensor's CRC-8 checksum. The scale factor is read
> from the sensor at runtime, so all three parts are supported.
>
> Tested on an SDP31 connected to a Raspberry Pi 4 I2C bus.
With the nit-picks addressed,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> Assisted-by: Claude:claude-opus-4-8
> Assisted-by: Claude:claude-opus-5-5
Assisted-by: LLM
> Signed-off-by: Muhammad Abu Bakar <m.abubakar365@xxxxxxxxx>
...
> +#include <linux/array_size.h>
> +#include <linux/bits.h>
> +#include <linux/cleanup.h>
> +#include <linux/crc8.h>
> +#include <linux/delay.h>
> +#include <linux/device.h>
> +#include <linux/errno.h>
> +#include <linux/i2c.h>
> +#include <linux/mod_devicetable.h>
Not in the new code.
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/once.h>
> +#include <linux/regulator/consumer.h>
> +#include <linux/types.h>
> +#include <linux/unaligned.h>
> +#include <linux/units.h>
...
> +static int sdp31_read_measurement(struct sdp31_data *data, s16 *pressure,
> + s16 *temp)
Better to split on logical boundary
static int sdp31_read_measurement(struct sdp31_data *data,
s16 *pressure, s16 *temp)
--
With Best Regards,
Andy Shevchenko