From nobody Mon Jun 8 08:28:41 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 610003112C1 for ; Sat, 30 May 2026 20:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174505; cv=none; b=SB6//rkQIQBeq8u1ONt2N39Xw6/ozTnMDFidBXhe9zlfjWZ8XmXKIA+NCJQ2grQkNGqMezj6UOfwbcrF6iPXxJ/NTwVbSAupVXA/uBO86eqB5DB5RljJbX2QkH8MyQVdq6nC6DFiFDYioskv+hx2NCQa0PNz5bxN9SsR62BE+gY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174505; c=relaxed/simple; bh=Nx8EK67/RioyI6Z4M1OApHSBUTezoml6mYEJkUAfw1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XuUKmRTW/sx4xVAGk0TRDcC6MDoTONnE6h/omcmZKzvubsTfWEk9ga6DXX+9Tc4rR+UbbwIKfnqJWk41NVeke1nv12eWa+gpUnL1IehOdbeB1bmo971otOvH9mo/evWYWOJKq10HZrXkUX5Xu57rtS8bn67yQrrUONp2lf1hLXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HhwLfd9a; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HhwLfd9a" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-49041fb8c23so68097625e9.0 for ; Sat, 30 May 2026 13:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780174503; x=1780779303; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8qQ+HP5KO/pNape1oL4kHR1H0GGu6Zsl3upOKWiRgzM=; b=HhwLfd9aV3uHZfViJud7DScv9nE+K5+hkCG9zvUYZcU01jKJ01EBOERV5vZgj4xZSO BQ3+SJ5QFcr8LHlolvW8c/FLwCNaQNTZns6LjDy7CmzPVa9Du5KXuSMU1GNIjCxJ+jyr Z4uLZPooULWV35QLJgrquMuJUWlEKsF2mBboLZhB6cEyjg3pFKl6pmMdq0aX1HlaGma9 eeYXFgIUrqLKIAKvtxa39Vv0eGNlKEnxKbsGysxNbuegnx2ZiiKHK8lNlwG8W9gPd1Zb Qy4hBd04DapvuvZ3m6t/psDhAKx17tHpoE/8CkRbBAHBmX5kqLjSaK8lq2wHJnnuV3dv MzBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780174503; x=1780779303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8qQ+HP5KO/pNape1oL4kHR1H0GGu6Zsl3upOKWiRgzM=; b=HPYUug56NY3M/wsD1HsGqVutHEZJQoApkoGNUu48JJmkxf3j2m8Fv+GqYwJseIvfsQ cdRvCdnHndquauo7x4Mgu/qrTFOJKtN+Hbu8tMyJsNbSf2nYbXz2p5JRrHmucsFmz+UO KDZKFb4xOa+KQ2RAtpbiokCQShqhe5F/uexDp+yJS4xW+2VjnHiEl7o7064E4RevntEY Rj9nf6qLVKCigDyhVRJHfDctvpz0Q7RbZIFZJzDM2CT+VrPzLIRM1IhoUOsEY1QFgn+T SljMheMDrwnU8Z2arpzKtPwtnKbvMfI+OGeP9oQC3BR7H9vcGqKNDToNTxUhUMk6+bj2 LcgA== X-Forwarded-Encrypted: i=1; AFNElJ/qdBfdbAhfVGAxsVXMopaJVcTSz/1j6FTEmpKYo+V5rNAH9qOjKs/x0BLCSv1YQDauwztzY2JXAU7A0gQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7BuJFFyPUCeBLaVMoj4v9eD7PHT7yzpbamZtSOJyskkwjlmjx QsClNqYqU6ZaMMjWaR5w/EHb203x9pEvRnSx+rKAlOFRzBLaytwGoPgE X-Gm-Gg: Acq92OHMxAr0BFY5d3GA310rt37FbfEMfIW27iD7TR3ZDFrw4o4Oxyj5cqbyvQgSEBj Jy6d7hHANpj4Mgs7OVWib5KUn1/TWCuHoAPw1YneUYwurl0yc9haPgXbd6sqd/Toho9tyvsqj0k zDCMvPeORlzEXAyDWOXL+LyptXlMlDmcDup0l5yrGT79cTsvmOUKShQi9NW++4fl6xA/6mGm9HK TQcVnIhpuhQl+vHXSurmkZrZltopqI7lZqpxMf/KDC+EpFAv4/hR7DDszOf1sK0pfH3+hHyyN6e o3IzPn9qdc3Emqkdw0zohDXS8qoJEkFlj/SFxh/Mwl/CDC0uN/3R9d8T6KKJ/vOUn47uJtqmmqO GGtmQifdunKuMGkuBBOxEzTZcR7Vm1e0kME7t/xnx4zzsEqzjnP3m2Xc+Xone3knZP6uLOSH/ua 771b+RjfbFjY1WK4k= X-Received: by 2002:a05:600d:844f:20b0:490:4973:91a0 with SMTP id 5b1f17b1804b1-490a292191fmr65148555e9.10.1780174502753; Sat, 30 May 2026 13:55:02 -0700 (PDT) Received: from sefo-laptop ([2a02:8071:50c5:5c0::361b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4909cab0e94sm132288225e9.12.2026.05.30.13.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 May 2026 13:55:02 -0700 (PDT) From: Wadim Mueller To: Jonathan Cameron , Krzysztof Kozlowski , Rob Herring , Conor Dooley , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Maxwell Doose , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Subject: [PATCH v3 1/3] iio: types: add IIO_VOLUMEFLOW channel type Date: Sat, 30 May 2026 22:54:30 +0200 Message-ID: <20260530205435.37326-2-wafgo01@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260530205435.37326-1-wafgo01@gmail.com> References: <20260530205435.37326-1-wafgo01@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a new IIO channel type for liquid volumetric flow sensors. The unit exposed via the standard _scale attribute is litres per second (l/s), so drivers reporting smaller native units (e.g. ml/min) only need to set a fractional scale. Update iio-core's name table, the iio_event_monitor whitelist and the sysfs-bus-iio ABI document to match. The new _scale attribute is folded into the existing shared _scale block; only the per-type _raw needs a fresh entry. Signed-off-by: Wadim Mueller --- Documentation/ABI/testing/sysfs-bus-iio | 11 +++++++++++ drivers/iio/industrialio-core.c | 1 + include/uapi/linux/iio/types.h | 1 + tools/iio/iio_event_monitor.c | 2 ++ 4 files changed, 15 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/te= sting/sysfs-bus-iio index 5f87dcee7..2188557cb 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -507,6 +507,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_intensity_re= d_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale What: /sys/bus/iio/devices/iio:deviceX/in_concentration_co2_scale +What: /sys/bus/iio/devices/iio:deviceX/in_volumeflow_scale +What: /sys/bus/iio/devices/iio:deviceX/in_volumeflowY_scale KernelVersion: 2.6.35 Contact: linux-iio@vger.kernel.org Description: @@ -2458,3 +2460,12 @@ Description: seconds, expressed as: =20 - a range specified as "[min step max]" + +What: /sys/bus/iio/devices/iio:deviceX/in_volumeflow_raw +What: /sys/bus/iio/devices/iio:deviceX/in_volumeflowY_raw +KernelVersion: 6.19 +Contact: linux-iio@vger.kernel.org +Description: + Raw (unscaled) volumetric flow rate reading from the channel. + To convert to standard units (litres per second) apply the + channel's _scale (and _offset, when present). diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-cor= e.c index 22eefd048..aa34fcd8e 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -98,6 +98,7 @@ static const char * const iio_chan_type_name_spec[] =3D { [IIO_CHROMATICITY] =3D "chromaticity", [IIO_ATTENTION] =3D "attention", [IIO_ALTCURRENT] =3D "altcurrent", + [IIO_VOLUMEFLOW] =3D "volumeflow", }; =20 static const char * const iio_modifier_names[] =3D { diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h index 6d269b844..49480f321 100644 --- a/include/uapi/linux/iio/types.h +++ b/include/uapi/linux/iio/types.h @@ -53,6 +53,7 @@ enum iio_chan_type { IIO_CHROMATICITY, IIO_ATTENTION, IIO_ALTCURRENT, + IIO_VOLUMEFLOW, }; =20 enum iio_modifier { diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c index 03ca33869..078004750 100644 --- a/tools/iio/iio_event_monitor.c +++ b/tools/iio/iio_event_monitor.c @@ -65,6 +65,7 @@ static const char * const iio_chan_type_name_spec[] =3D { [IIO_CHROMATICITY] =3D "chromaticity", [IIO_ATTENTION] =3D "attention", [IIO_ALTCURRENT] =3D "altcurrent", + [IIO_VOLUMEFLOW] =3D "volumeflow", }; =20 static const char * const iio_ev_type_text[] =3D { @@ -193,6 +194,7 @@ static bool event_is_known(struct iio_event_data *event) case IIO_CHROMATICITY: case IIO_ATTENTION: case IIO_ALTCURRENT: + case IIO_VOLUMEFLOW: break; default: return false; --=20 2.52.0 From nobody Mon Jun 8 08:28:41 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B15129AAFA for ; Sat, 30 May 2026 20:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174507; cv=none; b=rKsqAYEij4p8DbsacrjhfGTBWnz9KrA43sa66m54s7rxgQoOBPjJ4LIm9B+fBAaUvWWIzsjJbqU4P42DYYVJaT495kaLtSjlWFRFa+moBKwX0CwAugZ9WqAT1bC2n47RWnauufniREe1SsZuToOwrP3EI7uhL3Dpn4RPGl6hzN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174507; c=relaxed/simple; bh=hwGl3EPuphO2HwbxFoFnDldoXbDsAWGoIy1kLT4Cp5g=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=niyUBkHZxC3t7HUw6SkVH+yVuv3UPzkXx1aTvnB26ruZsVlptAnOwx3LpaiU0lFrmNOHBQJpUJ+6HQixo57BI9EBb6B3ayOLDi3obguINqYNdZYVxEF9LjLaUAYtWu2hdi2kjnjD617kTpisd3ZuWG66U8sAVoaXRWFu+Zv2Bxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=K6MuVJXM; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K6MuVJXM" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-45f3cf907ceso201600f8f.2 for ; Sat, 30 May 2026 13:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780174504; x=1780779304; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fP/yeBc6tDGnYnwkYYiLHLYGfPjF9AFGOqGTC6mRuYQ=; b=K6MuVJXMtCKJnnL3zr6rtTD7fo0JObyDg1Mq7XSDFppzGCnQ5AYO9cU5YkrVe770MD bYgNcty23Y+TMUMEjQFLgndu15pMoh2nL+rmwU4f+t9eWlclbT0r8bTw/KPJkb8r/d6p +Ywm7VTN6wfruN74hEd0kYIa3NK61d4G5c1M3CPWLts5f8HbofwpQh/yduNL7zWvI5qH E8xw4mlwqEOLGocJyDWp0dek3M5n1KN7zxva86RCLs069IkuS45FCmlCiD76vhd1OGg5 MPHO3yFSW7yZGxOnPzRshLGLj6nAuNld7jqnnfhGOFjNKjFik0vA4km7+2rCXE5hYiti WMEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780174504; x=1780779304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=fP/yeBc6tDGnYnwkYYiLHLYGfPjF9AFGOqGTC6mRuYQ=; b=XVICuo+2sbsZlrr3RkMminOSJsIPuwldqRi6McxqR1rq/yo8FsdhzcW2xUFPPl87RP sAQnUdfX6R90QdDGLyBkzkDwr5WHewr3hc5VoGdYECBYPAUtc0BeJuJ6T263StH8GV9/ dgj52fta4tG6lUko190pKRUSs8eFgJFfOJQ8vHmV1smGdRrgwAPRj2eo1iQOSWZcV9LK kwW9gvVnZmkYmfQ0Z2FD2t6m+Tef+57F7AfaDZ0Y5bano2DNgAWHODGOE5hvOvxhoVVp IZEg7RbaBxRHZHYLhU/AXihtVOOtUFNKiJLAh6WhBTW43paTScnYYQycTFltAdkw+SqA /lYg== X-Forwarded-Encrypted: i=1; AFNElJ/A2Srk7sU6xlW6Lvd0YTMQ+lWsZbSkkp+vFAImmzW1Xv2+VaaYcfMrubFCE+amuQ1Uxtn6ZnwS0F8BTlU=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4rHkbS+4d7qmiBk77d3kHccf4mgZelH8xufVJ6GNSikxGvl9F AHn5dKdJhb7A8VSWf36JOHa6ObOJI6HXbTXCi5y8fwDBP3Kb1dBZhzk8 X-Gm-Gg: Acq92OFBVcN7Kssj8AYef3eo3tzPVYRlx9XhwKJPdhNPtN7UOwjZA8gL4oYxtrkLnPx Jvb4Z7by1CcPiEGffyOmkxvBVWOS7NL6d8XQGYu0NzIPJAbDp2pa+xkwDj5RK6NjQR21xkaoC/n vPJR73KDcwf+oMaW6arHbSLhmWrg8x0v6LX3+nfWUWEERThyJqYTvupXu8BdiRBs2W+bVEp/cNR USeBVQ2+knk5JT6eW79StwVGW8kcgMBUWABmiNBm2tGOHxIJNJRPZQEPOXPMtKo6x+Zmv37pFYc PQE/8GklG/eCfupijZ3W/2xHdgih7QBnQQeCtU18znCf1RCJiyP6RDdmZaXNo5oiKWZPdIsp2Zi /h9M/HJCLYrsZGVCW4QT2+a0iuumic3/02/qXPko4WxFPnrVTtnl6rdagHILDeOTAz+WEDDPDUT 3DXe/Svjc99SfDEg0= X-Received: by 2002:a05:600c:6287:b0:490:5429:1513 with SMTP id 5b1f17b1804b1-490a2901c14mr93218935e9.6.1780174504103; Sat, 30 May 2026 13:55:04 -0700 (PDT) Received: from sefo-laptop ([2a02:8071:50c5:5c0::361b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4909cab0e94sm132288225e9.12.2026.05.30.13.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 May 2026 13:55:03 -0700 (PDT) From: Wadim Mueller To: Jonathan Cameron , Krzysztof Kozlowski , Rob Herring , Conor Dooley , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Maxwell Doose , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/3] dt-bindings: iio: flow: add Sensirion SLF3S liquid flow sensor Date: Sat, 30 May 2026 22:54:31 +0200 Message-ID: <20260530205435.37326-3-wafgo01@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260530205435.37326-1-wafgo01@gmail.com> References: <20260530205435.37326-1-wafgo01@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document the bindings for the Sensirion SLF3S family of digital liquid-flow sensors on I2C. The family currently covers the SLF3S-0600F, SLF3S-1300F and SLF3S-4000B variants. The driver auto-detects the variant from the product-information register at probe time; the per-variant compatible strings exist for documentation and dt_binding_check purposes. The active calibration medium (water / IPA) is runtime-switchable via the in_volumeflow_medium sysfs attribute and therefore not a DT property. Signed-off-by: Wadim Mueller Reviewed-by: Marcelo Schmitt --- .../bindings/iio/flow/sensirion,slf3s.yaml | 49 +++++++++++++++++++ MAINTAINERS | 8 +++ 2 files changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/flow/sensirion,sl= f3s.yaml diff --git a/Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yam= l b/Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yaml new file mode 100644 index 000000000..dc41120e0 --- /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 SLF3S liquid flow sensor + +maintainers: + - Wadim Mueller + +description: + Family of digital liquid-flow sensors from Sensirion with I2C + interface. All family members share the same register map; sub-types + differ only in the flow scale factor and the calibrated measurement + range, both of which are detected at probe time via the + product-information register. + +properties: + compatible: + enum: + - sensirion,slf3s-0600f + - sensirion,slf3s-1300f + - sensirion,slf3s-4000b + + reg: + maxItems: 1 + + vdd-supply: true + +required: + - compatible + - reg + - vdd-supply + +additionalProperties: false + +examples: + - | + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + flow-sensor@8 { + compatible =3D "sensirion,slf3s-0600f"; + reg =3D <0x08>; + vdd-supply =3D <®_3v3>; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 06a8c7457..222a03b6d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24187,6 +24187,14 @@ S: Maintained F: Documentation/ABI/testing/sysfs-bus-iio-chemical-sgp40 F: drivers/iio/chemical/sgp40.c =20 +SENSIRION SLF3S LIQUID FLOW SENSOR DRIVER +M: Wadim Mueller +R: Maxwell Doose +L: linux-iio@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yaml +F: drivers/iio/flow/slf3s.c + SENSIRION SPS30 AIR POLLUTION SENSOR DRIVER M: Tomasz Duszynski S: Maintained --=20 2.52.0 From nobody Mon Jun 8 08:28:41 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEFBB296BC1 for ; Sat, 30 May 2026 20:55:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174510; cv=none; b=HCNHJ9v92kbqe+J+ZQZ/Ci7ee4Mayodj5xTj9RPiKRudqXSV5sOD8w5HT8lW+DDS0zmO9vWhAhpLcnqNJWuXD/iwDMfL/CeV5OhC6iQ5DBkjK6l1jeW00E2B1CqveeGSuY1mKx0rygf53nbaeCt9pI65JoDLBeF5V9gbK+SOVkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174510; c=relaxed/simple; bh=uTRMtYQA+s0MhtyxEJpZLkWNUZft06Eg5SmnngQ+MN4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WrDZ9K7RdJ92Fzr9jQcc3ioH6+mWtKg+8xwZX3M6EwVxXAgI2LkfDJsvvDLTFJux9DI7n/NaV/LplPH5rRgPCpud3rmJ1RWtiTjYfwLCbXE/GBq5fZDkyJISd2mD/pAInGJow61H46+fQIeDzXTanVtYjtgLrPR+yuUkHsi67qw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=En1y/Ybi; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="En1y/Ybi" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-49042aeeb75so106244595e9.1 for ; Sat, 30 May 2026 13:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780174507; x=1780779307; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g/r91x18F44nECj79mEs4JTmbgxq8t6M9pdhsna8uxc=; b=En1y/Ybi6mqcSPz7zuM3fwJ/67+ky1qdfZE1Ply1oyndppN3DOpadzG3oUN+IrOZnu taGf/6CAQgfW3wxeFX325Ba997ldIpXhIxkHCUQfjjCb52wQ6ZENmq3xobKIhonMMfV9 peiDG2LZm4FIJpp0EmkKpwyTLkTHykChtm/igXxEWIxQP2wGo01L9WAP1RELD/hHYTOg dEUfz3Tt14FYETu0angRBvvJHbps561B9XddJxKaoknqUhHHU0Gv2kvHpiluxtH89U1x c5RTS1AuSRpESC4GNebYvJRat1uSR+mNCedn+p27SAGL5w0CoCECDHIr7LgqflG4gXG6 CnoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780174507; x=1780779307; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=g/r91x18F44nECj79mEs4JTmbgxq8t6M9pdhsna8uxc=; b=WO+yhkGtFnpUq1TfustwU7NAfjZP6Z6+JIZhSE7+IeyHQiPY7rtRxEA2ryl8U/1n09 r6dkj1+4PEKq36SOOdALqT0XxAtqUT8muThyCZLaCJ4wlKTXsO2JzUvoyXHznqCXpjN4 lZRrhIv+2/rtxerIFbgOVN3EyTwip+hpgTIWlCoRJJd7rt/GrPPdKQ37EcHGQ7vbNYXc EZaOmTxFtn2+XRrwFyMSYsWKMNzaAfsRWmDPLNeocsHDdBTo6XpnSt80auRpVXL9Tzwf sXCFrQlbqPKarRUa6jpgCdU62wCBRLxETLZIFPNCb31po2iqdzJuv2HmifpZf3e1D7UB zvAg== X-Forwarded-Encrypted: i=1; AFNElJ8U+T5uxzTCg+gd2dZ2BnQJQN25v+uCfSzIVokEE4JiK3Bejt7TgnxOOKw8LcxD81ksN4+B+LeevexT4ts=@vger.kernel.org X-Gm-Message-State: AOJu0Yx75w7D6gFYHGmYKTE7WSmv1u23aAk3bTJMy8spksrPqaC/9n5r HkChLnbczuUYgfavyHoTl/pQWqCOd4A/++jbzGdDioJ/ppmiA82302UM X-Gm-Gg: Acq92OGPOuN8t1YWLQjps89RWPoZkXFxaL3Uf6BfPWVYGY+IDks6LiGmw6cANiqkoQ3 rds8fJI82Nxrdgz1Eu1Bt+xNg3wKc6Vh8/+e98aQ44eoP68h87rHIA8WoB9c2ZG0fSm38im1upt lac2sn1szWGrBojcotWbwGy+LAbJg5RDO0AvKcWG3XbC2iQ+AJ1mm1meIoCo/m3EwvmO36fTl04 mX781I9gp/3mO+DFo7pjDMnHSk+UNo+pvKWgUfUNGHjgg+OZGtyKKAPOue+RZ/aakkueacohwxZ 9biVzyMb0d3gbdopLEY6DuZyW0cCqnagEZzTSeId6gjENQKCAvi4zyLrH/Lf10ReOQx8/ZNenJn LcRrVQYs4GyY/NeqZ1rBdz7vonsaZpYlkZK5Ywd5riqU+kUyUH4J9g9xPlEvoqSWtgMiZEAfG+D fai4ygTROfMfSiZ5Y= X-Received: by 2002:a05:600c:8b57:b0:490:3c15:7146 with SMTP id 5b1f17b1804b1-490a5013670mr53129565e9.19.1780174507013; Sat, 30 May 2026 13:55:07 -0700 (PDT) Received: from sefo-laptop ([2a02:8071:50c5:5c0::361b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4909cab0e94sm132288225e9.12.2026.05.30.13.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 May 2026 13:55:06 -0700 (PDT) From: Wadim Mueller To: Jonathan Cameron , Krzysztof Kozlowski , Rob Herring , Conor Dooley , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Maxwell Doose , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Cc: devicetree@vger.kernel.org Subject: [PATCH v3 3/3] iio: flow: add Sensirion SLF3S liquid flow sensor driver Date: Sat, 30 May 2026 22:54:32 +0200 Message-ID: <20260530205435.37326-4-wafgo01@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260530205435.37326-1-wafgo01@gmail.com> References: <20260530205435.37326-1-wafgo01@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a driver for the Sensirion SLF3S family of digital liquid-flow sensors on I2C. Currently supported variants are SLF3S-0600F, SLF3S-1300F and SLF3S-4000B; they share the same register map and differ only in flow-scale factor and calibrated measurement range. The variant (and therefore the scale) is auto-detected from the product-information register at probe time. Each measurement frame returns a 16-bit signed flow value, a 16-bit signed temperature reading and a status word, each protected by a CRC-8 byte. The driver exposes the flow rate as IIO_VOLUMEFLOW and the temperature as IIO_TEMP via the standard IIO read_raw / read_scale interface. The active calibration medium can be switched at runtime between the factory-calibrated water and isopropyl-alcohol modes via the in_volumeflow_medium sysfs attribute; the sensor starts in water mode after probe. This driver also creates the drivers/iio/flow/ subdirectory and the corresponding Kconfig/Makefile glue. Signed-off-by: Wadim Mueller --- drivers/iio/Kconfig | 1 + drivers/iio/Makefile | 1 + drivers/iio/flow/Kconfig | 27 +++ drivers/iio/flow/Makefile | 7 + drivers/iio/flow/slf3s.c | 406 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 442 insertions(+) create mode 100644 drivers/iio/flow/Kconfig create mode 100644 drivers/iio/flow/Makefile create mode 100644 drivers/iio/flow/slf3s.c diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig index 661127aed..652557a5b 100644 --- a/drivers/iio/Kconfig +++ b/drivers/iio/Kconfig @@ -92,6 +92,7 @@ source "drivers/iio/common/Kconfig" source "drivers/iio/dac/Kconfig" source "drivers/iio/dummy/Kconfig" source "drivers/iio/filter/Kconfig" +source "drivers/iio/flow/Kconfig" source "drivers/iio/frequency/Kconfig" source "drivers/iio/gyro/Kconfig" source "drivers/iio/health/Kconfig" diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile index cb80ef837..f03a4100c 100644 --- a/drivers/iio/Makefile +++ b/drivers/iio/Makefile @@ -29,6 +29,7 @@ obj-y +=3D dac/ obj-y +=3D dummy/ obj-y +=3D gyro/ obj-y +=3D filter/ +obj-y +=3D flow/ obj-y +=3D frequency/ obj-y +=3D health/ obj-y +=3D humidity/ diff --git a/drivers/iio/flow/Kconfig b/drivers/iio/flow/Kconfig new file mode 100644 index 000000000..1eee131ea --- /dev/null +++ b/drivers/iio/flow/Kconfig @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Liquid / gas flow sensor drivers +# +# When adding new entries keep the list in alphabetical order + +menu "Flow sensors" + +config SENSIRION_SLF3S + tristate "Sensirion SLF3S liquid flow sensor" + depends on I2C + select CRC8 + help + Say yes here to build support for the Sensirion SLF3S family + of digital liquid-flow sensors: + + - SLF3S-0600F + - SLF3S-1300F + - SLF3S-4000B + + The driver reports the volumetric flow rate and the embedded + temperature reading via the standard IIO interface. + + To compile this driver as a module, choose M here: the module + will be called slf3s. + +endmenu diff --git a/drivers/iio/flow/Makefile b/drivers/iio/flow/Makefile new file mode 100644 index 000000000..3cf4ab95c --- /dev/null +++ b/drivers/iio/flow/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for industrial I/O flow sensor drivers +# + +# When adding new entries keep the list in alphabetical order +obj-$(CONFIG_SENSIRION_SLF3S) +=3D slf3s.o diff --git a/drivers/iio/flow/slf3s.c b/drivers/iio/flow/slf3s.c new file mode 100644 index 000000000..497a56f59 --- /dev/null +++ b/drivers/iio/flow/slf3s.c @@ -0,0 +1,406 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Sensirion SLF3S liquid flow sensor driver. + * + * Supports the SLF3S-0600F, SLF3S-1300F and SLF3S-4000B liquid-flow + * sensors over I2C. Each measurement frame returns a 16-bit signed + * flow value, a 16-bit signed temperature value and a status word, + * each protected by a CRC-8 byte. + * + * The active calibration medium (water or isopropyl alcohol) is + * runtime-switchable via the in_volumeflow_medium sysfs attribute and + * defaults to water. + * + * Datasheet: https://sensirion.com/products/catalog/SLF3S-0600F/ + * + * Copyright (C) 2026 CMBlu Energy GmbH + * Author: Wadim Mueller + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define SLF3S_CRC8_POLY 0x31 +#define SLF3S_CRC8_INIT 0xff + +#define SLF3S_PRODUCT_ID_LEN 18 +#define SLF3S_PRODUCT_FAMILY_BYTE 1 +#define SLF3S_PRODUCT_SUBTYPE_BYTE 3 +#define SLF3S_PRODUCT_FAMILY_ID 0x03 + +/* Datasheet section 2.2: tPU =3D 25 ms max from power-on to first cmd. */ +#define SLF3S_POWER_UP_DELAY_US (25 * USEC_PER_MSEC) +/* Datasheet section 2.2: tw =3D 60 ms typical until first valid sample. */ +#define SLF3S_MEAS_START_DELAY_US (60 * USEC_PER_MSEC) + +static const u8 slf3s_cmd_prep_pid[] =3D { 0x36, 0x7c }; +static const u8 slf3s_cmd_read_pid[] =3D { 0xe1, 0x02 }; +static const u8 slf3s_cmd_start_water[] =3D { 0x36, 0x08 }; +static const u8 slf3s_cmd_start_ipa[] =3D { 0x36, 0x15 }; +static const u8 slf3s_cmd_stop_meas[] =3D { 0x3f, 0xf9 }; + +enum slf3s_medium { + SLF3S_MEDIUM_WATER, + SLF3S_MEDIUM_IPA, +}; + +static const char * const slf3s_medium_modes[] =3D { + [SLF3S_MEDIUM_WATER] =3D "water", + [SLF3S_MEDIUM_IPA] =3D "ipa", +}; + +/** + * struct slf3s_variant - per-variant calibration constants + * @sub_type: product-info sub-type byte returned by the sensor + * @name: name reported via @iio_dev.name + * @scale_num: flow scale numerator (l/s per LSB) + * @scale_den: flow scale denominator (l/s per LSB) + */ +struct slf3s_variant { + u8 sub_type; + const char *name; + int scale_num; + int scale_den; +}; + +static const struct slf3s_variant slf3s_variants[] =3D { + [0] =3D { + .sub_type =3D 0x03, + .name =3D "slf3s-0600f", + .scale_num =3D 1, + .scale_den =3D 600 * MICRO, + }, + [1] =3D { + .sub_type =3D 0x02, + .name =3D "slf3s-1300f", + .scale_num =3D 1, + .scale_den =3D 30 * MICRO, + }, + [2] =3D { + .sub_type =3D 0x05, + .name =3D "slf3s-4000b", + .scale_num =3D 1, + .scale_den =3D 1920 * MILLI, + }, +}; + +/** + * struct slf3s_data - per-device state + * @client: I2C client this instance is bound to + * @variant: pointer into @slf3s_variants for the detected device + * @medium: currently active calibration medium + * @crc_table: pre-computed CRC-8 lookup table for SLF3S_CRC8_POLY + */ +struct slf3s_data { + struct i2c_client *client; + const struct slf3s_variant *variant; + enum slf3s_medium medium; + u8 crc_table[CRC8_TABLE_SIZE]; +}; + +static bool slf3s_crc_valid(const struct slf3s_data *sf, const u8 *block) +{ + return crc8(sf->crc_table, block, 2, SLF3S_CRC8_INIT) =3D=3D block[2]; +} + +static int slf3s_send_cmd(struct i2c_client *client, const u8 cmd[at_least= 2]) +{ + int ret =3D i2c_master_send(client, cmd, 2); + + if (ret =3D=3D 2) + return 0; + + return ret < 0 ? ret : -EIO; +} + +/* + * Read the product-info block and pick the matching variant. The + * sub-type byte returned by the sensor is the source of truth; a + * DT-supplied compatible only seeds an initial guess and is overridden + * on mismatch (with an informational message so misconfigured device + * trees are easy to spot). + * + * Bus / CRC failures are real errors and fail probe. An unknown + * sub-type byte fails probe too: we cannot publish a meaningful scale + * without a matching entry in slf3s_variants[]. + */ +static int slf3s_detect_variant(struct slf3s_data *sf) +{ + struct i2c_client *client =3D sf->client; + u8 buf[SLF3S_PRODUCT_ID_LEN]; + int ret; + + ret =3D slf3s_send_cmd(client, slf3s_cmd_prep_pid); + if (ret) + return ret; + + ret =3D slf3s_send_cmd(client, slf3s_cmd_read_pid); + if (ret) + return ret; + + ret =3D i2c_master_recv(client, buf, sizeof(buf)); + if (ret < 0) + return ret; + if (ret !=3D sizeof(buf)) + return -EIO; + + for (unsigned int i =3D 0; i < SLF3S_PRODUCT_ID_LEN; i +=3D 3) { + if (!slf3s_crc_valid(sf, &buf[i])) + return -EIO; + } + + if (buf[SLF3S_PRODUCT_FAMILY_BYTE] !=3D SLF3S_PRODUCT_FAMILY_ID) + dev_info(&client->dev, + "unexpected family byte 0x%02x (expected 0x%02x)\n", + buf[SLF3S_PRODUCT_FAMILY_BYTE], + SLF3S_PRODUCT_FAMILY_ID); + + for (unsigned int i =3D 0; i < ARRAY_SIZE(slf3s_variants); i++) { + if (buf[SLF3S_PRODUCT_SUBTYPE_BYTE] !=3D + slf3s_variants[i].sub_type) + continue; + + if (sf->variant && sf->variant !=3D &slf3s_variants[i]) + dev_info(&client->dev, + "DT compatible says %s but sensor reports %s; using %s\n", + sf->variant->name, + slf3s_variants[i].name, + slf3s_variants[i].name); + + sf->variant =3D &slf3s_variants[i]; + + return 0; + } + + dev_err(&client->dev, "unknown SLF3S sub-type 0x%02x\n", + buf[SLF3S_PRODUCT_SUBTYPE_BYTE]); + + return -ENODEV; +} + +static int slf3s_read_sample(struct slf3s_data *sf, int *flow, int *temp) +{ + u8 buf[9]; + int ret; + + ret =3D i2c_master_recv(sf->client, buf, ARRAY_SIZE(buf)); + if (ret < 0) + return ret; + if (ret !=3D ARRAY_SIZE(buf)) + return -EIO; + + for (unsigned int i =3D 0; i < ARRAY_SIZE(buf); i +=3D 3) { + if (!slf3s_crc_valid(sf, &buf[i])) + return -EIO; + } + + *flow =3D sign_extend32(get_unaligned_be16(&buf[0]), 15); + *temp =3D sign_extend32(get_unaligned_be16(&buf[3]), 15); + + return 0; +} + +static int slf3s_get_medium(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan) +{ + struct slf3s_data *sf =3D iio_priv(indio_dev); + + return sf->medium; +} + +static int slf3s_set_medium(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan, unsigned int mode) +{ + struct slf3s_data *sf =3D iio_priv(indio_dev); + const u8 *start_cmd; + int ret; + + if (!iio_device_claim_direct(indio_dev)) + return -EBUSY; + + ret =3D slf3s_send_cmd(sf->client, slf3s_cmd_stop_meas); + if (ret) + goto out; + + start_cmd =3D (mode =3D=3D SLF3S_MEDIUM_IPA) ? slf3s_cmd_start_ipa + : slf3s_cmd_start_water; + + ret =3D slf3s_send_cmd(sf->client, start_cmd); + if (ret) + goto out; + + fsleep(SLF3S_MEAS_START_DELAY_US); + sf->medium =3D mode; +out: + iio_device_release_direct(indio_dev); + + return ret; +} + +static const struct iio_enum slf3s_medium_enum =3D { + .items =3D slf3s_medium_modes, + .num_items =3D ARRAY_SIZE(slf3s_medium_modes), + .get =3D slf3s_get_medium, + .set =3D slf3s_set_medium, +}; + +static const struct iio_chan_spec_ext_info slf3s_ext_info[] =3D { + IIO_ENUM("medium", IIO_SHARED_BY_TYPE, &slf3s_medium_enum), + IIO_ENUM_AVAILABLE("medium", IIO_SHARED_BY_TYPE, &slf3s_medium_enum), + { } +}; + +static const struct iio_chan_spec slf3s_channels[] =3D { + { + .type =3D IIO_VOLUMEFLOW, + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_SCALE), + .ext_info =3D slf3s_ext_info, + }, + { + .type =3D IIO_TEMP, + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_SCALE), + }, +}; + +static int slf3s_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long mask) +{ + struct slf3s_data *sf =3D iio_priv(indio_dev); + int flow, temp, ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + if (!iio_device_claim_direct(indio_dev)) + return -EBUSY; + + ret =3D slf3s_read_sample(sf, &flow, &temp); + iio_device_release_direct(indio_dev); + if (ret) + return ret; + + *val =3D (chan->type =3D=3D IIO_VOLUMEFLOW) ? flow : temp; + + return IIO_VAL_INT; + case IIO_CHAN_INFO_SCALE: + if (chan->type =3D=3D IIO_VOLUMEFLOW) { + *val =3D sf->variant->scale_num; + *val2 =3D sf->variant->scale_den; + + return IIO_VAL_FRACTIONAL; + } + /* Temperature LSB =3D 1/200 degC; IIO_TEMP wants milli-degC. */ + *val =3D 1000 / 200; + + return IIO_VAL_INT; + default: + return -EINVAL; + } +} + +static const struct iio_info slf3s_info =3D { + .read_raw =3D slf3s_read_raw, +}; + +static void slf3s_stop_meas(void *data) +{ + struct slf3s_data *sf =3D data; + + slf3s_send_cmd(sf->client, slf3s_cmd_stop_meas); +} + +static int slf3s_probe(struct i2c_client *client) +{ + struct device *dev =3D &client->dev; + struct iio_dev *indio_dev; + struct slf3s_data *sf; + int ret; + + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*sf)); + if (!indio_dev) + return -ENOMEM; + + sf =3D iio_priv(indio_dev); + sf->client =3D client; + sf->variant =3D i2c_get_match_data(client); + sf->medium =3D SLF3S_MEDIUM_WATER; + crc8_populate_msb(sf->crc_table, SLF3S_CRC8_POLY); + + ret =3D devm_regulator_get_enable(dev, "vdd"); + if (ret) + return dev_err_probe(dev, ret, "failed to enable vdd supply\n"); + + fsleep(SLF3S_POWER_UP_DELAY_US); + + ret =3D slf3s_detect_variant(sf); + if (ret) + return dev_err_probe(dev, ret, "product info read failed\n"); + + ret =3D slf3s_send_cmd(client, slf3s_cmd_start_water); + if (ret) + return dev_err_probe(dev, ret, + "failed to start measurement\n"); + + fsleep(SLF3S_MEAS_START_DELAY_US); + + ret =3D devm_add_action_or_reset(dev, slf3s_stop_meas, sf); + if (ret) + return ret; + + indio_dev->name =3D sf->variant->name; + indio_dev->channels =3D slf3s_channels; + indio_dev->num_channels =3D ARRAY_SIZE(slf3s_channels); + indio_dev->info =3D &slf3s_info; + indio_dev->modes =3D INDIO_DIRECT_MODE; + + return devm_iio_device_register(dev, indio_dev); +} + +static const struct i2c_device_id slf3s_id[] =3D { + { .name =3D "slf3s-0600f", + .driver_data =3D (kernel_ulong_t)&slf3s_variants[0] }, + { .name =3D "slf3s-1300f", + .driver_data =3D (kernel_ulong_t)&slf3s_variants[1] }, + { .name =3D "slf3s-4000b", + .driver_data =3D (kernel_ulong_t)&slf3s_variants[2] }, + { } +}; +MODULE_DEVICE_TABLE(i2c, slf3s_id); + +static const struct of_device_id slf3s_of_match[] =3D { + { .compatible =3D "sensirion,slf3s-0600f", .data =3D &slf3s_variants[0] }, + { .compatible =3D "sensirion,slf3s-1300f", .data =3D &slf3s_variants[1] }, + { .compatible =3D "sensirion,slf3s-4000b", .data =3D &slf3s_variants[2] }, + { } +}; +MODULE_DEVICE_TABLE(of, slf3s_of_match); + +static struct i2c_driver slf3s_driver =3D { + .driver =3D { + .name =3D "slf3s", + .of_match_table =3D slf3s_of_match, + }, + .probe =3D slf3s_probe, + .id_table =3D slf3s_id, +}; +module_i2c_driver(slf3s_driver); + +MODULE_AUTHOR("Wadim Mueller "); +MODULE_DESCRIPTION("Sensirion SLF3S liquid flow sensor driver"); +MODULE_LICENSE("GPL"); --=20 2.52.0