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

Akhilesh Patil
2025-10-25T05:48:36Z

On Thu, Oct 23, 2025 at 06:34:17PM +0100, Jonathan Cameron wrote:
> 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.

Sure.

>
> > 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.

Okay. Removed this macro and used value directly along with
improved comment.

>
> 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.

Datasheet recommends value greater than 10ms.
30ms is what I started with for initial testing.
I have checked it working for even 10ms, 20ms etc.
Let me use 20ms here with margin over 10 and mention it
in the comment in code.

>
>
> > +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.

okay, got it. Fixed.

Regards,
Akhilesh