Re: [RFC PATCH v1 3/4] iio: flow: add Sensirion SLF3x liquid flow sensor driver

From: Wadim Mueller

Date: Wed May 27 2026 - 10:36:09 EST


On Tue, 26 May 2026 17:42:29 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:

> Also see:
> https://sashiko.dev/#/patchset/20260524205112.26638-1-wafgo01%40gmail.com
> It may well not be correct in all cases, but it often is!

Thanks for the pointer - went through the Sashiko output and
folded the actionable items in (bool returns, unsigned ints in
loops, fallback-compatible cleanup etc.); the rest is in v2.

> The value of _scale seems like a plausible issue to me.
> We have discussed expanding the range further than 9 decimal places
> in the past. Seems like this might be the time we need to do it.
> There is some work under review at the moment to allow more complex
> fixed point handling but not sure it applies usefully here.

Going back to the datasheets, v1 had the SLF3S-0600F and -4000B
scale_den values wrong; the SLF3S-1300F entry I added was just
carried over from 0600F as a placeholder. v2 now uses the
published scale factors (Table 16 for 0600F, Table 15 for 1300F
and 4000B):

SLF3S-0600F: 10 (ul/min)^-1 -> 1 / 600 000 000 (l/s)/LSB
SLF3S-1300F: 500 (ml/min)^-1 -> 1 / 30 000 000 (l/s)/LSB
SLF3S-4000B: 32 (ml/min)^-1 -> 1 / 1 920 000 (l/s)/LSB

So the SLF3S-4000B scale_den drops from ~1.67e9 to 1.92e6 and the
INT_MAX concern is gone. Happy to follow up on top if the
extended fixed-point work lands in a useful form.

> I also missed the crc table is global. Easy solution is take a copy.

Done in v2 - the table lives now in struct slf3s_data and
crc8_populate_msb() runs per-instance in probe().

> Suspend / resume one is a value add for the future.

Acknowledged, parked for now. Easy to add as soon as there is a
user for it.

Thanks,
Wadim