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

Jonathan Cameron
2025-10-23T17:34:21Z

On Tue, 21 Oct 2025 11:20:30 +0530
Akhilesh Patil <akhilesh@ee.iitb.ac.in> wrote:

> 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.
>
> Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>

A couple of trivial bits of follow up from me given you are going to be
doing a v4 for the stuff Andy picked up on. Otherwise I'd just have
tweaked it whilst applying for these two.

> diff --git a/drivers/iio/pressure/adp810.c b/drivers/iio/pressure/adp810.c
> new file mode 100644
> index 000000000000..5fcb0447c628
> --- /dev/null
> +++ b/drivers/iio/pressure/adp810.c

> +/*
> + * Time taken in ms by sensor to do measurements after triggering.
> + * As per datasheet 10ms is sufficient but we define 30ms for better margin.
> + */
> +#define ADP810_MEASURE_LATENCY_MS 30
I'd just put this value in the one place that it is used and combine the two
comments on why it has this particular value.

30ms seems like a bit over the top for handling silicon variation etc.
Any background for the large margin? If you've seen this as necessary
in practice then just state that - it's useful info to have available
to a future reader of the driver.

> +static const struct iio_info adp810_info = {
> + .read_raw = adp810_read_raw,
Trivial but there is no benefit in using a tab before the =

In general aligning this stuff isn't a good plan. It causes
a mass of churn in the long run as some of the callbacks have longer
names and suddenly whole thing needs reindenting.

> +};