Re: [RFC PATCH v1 2/4] dt-bindings: iio: flow: add Sensirion SLF3x liquid flow sensor

From: Jonathan Cameron

Date: Tue May 26 2026 - 12:22:21 EST


On Sun, 24 May 2026 22:49:37 +0200
Wadim Mueller <wafgo01@xxxxxxxxx> wrote:

> From: Wadim Mueller <wadim.mueller@xxxxxxxx>
>
> Add a DT binding for the Sensirion SLF3x family of I2C liquid-flow
> sensors. A single 'sensirion,slf3s' compatible is exposed because
> the sub-types share the same register map and are detected at
> runtime via the product-information register.
>
> Signed-off-by: Wadim Mueller <wadim.mueller@xxxxxxxx>
Hi Wadim.

A few things inline.

Thanks,

Jonathan

> ---
> .../bindings/iio/flow/sensirion,slf3s.yaml | 49 +++++++++++++++++++
> 1 file changed, 49 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yaml b/Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yaml
> new file mode 100644
> index 000000000..5ef62435f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/flow/sensirion,slf3s.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sensirion SLF3x liquid flow sensor
> +
> +maintainers:
> + - Wadim Mueller <wadim.mueller@xxxxxxxx>
> +
> +description: |
> + Family of digital liquid-flow sensors from Sensirion with I2C interface.
> + The same register map is shared by all family members; sub-types differ
> + only in the flow scale factor exposed by the device and are detected at
> + probe time via the product-information register.

Because that doesn't work for fallback compatibles, we often give devices
their own compatibles anyway. Fine to also detect in driver but if we get
something that falls back to an SLF3S-0600F I don't think there is any reason
to think the subtype will match, so we have to trust DT to have given us
all the necessary info.

> +
> + Supported sub-types:
> + - SLF3S-0600F (calibrated range ±2 ml/min)
> + - SLF3S-4000B (calibrated range ±80 ml/min)
> +
> +properties:
> + compatible:
> + enum:
> + - sensirion,slf3s

If you don't expect to add more sensors this in near future would be fine
as a const rather than an enum.

> +
> + reg:
> + maxItems: 1

There seems to be an irq. Given bindings should be complete that should
be here even if the driver doesn't use it.

> +
> + vdd-supply: true
> +
> +required:
> + - compatible
> + - reg

vdd-supply presumably needed for device to function so should be here.
From dt-binding point of view we don't care about the kernel providing
stub regulators etc. The supply documentation should reflect what must
actually be supplied.

> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + flow-sensor@8 {
> + compatible = "sensirion,slf3s";
> + reg = <0x08>;
> + vdd-supply = <&reg_3v3>;
> + };
> + };