mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
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; a sensor reporting an unknown sub-type falls back to the variant named in the device tree / I2C table, so a drop-in replacement part keeps working on a kernel that does not know its sub-type yet. 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 volume-flow scale is reported in m^3/s. As the per-LSB scale is on the order of 1e-12 m^3/s, it is emitted as a 64-bit fixed-point value with femto (1e-15) resolution (IIO_VAL_DECIMAL64_FEMTO) so the small SI value keeps full precision. This relies on the IIO_VAL_DECIMAL64_FEMTO format type added earlier in this series. 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. The sensor has no low-power state of its own, so system suspend stops the measurement and disables the vdd supply; resume powers the sensor back up, waits out the power-up time and restarts the measurement with the previously active medium, following the scd30/scd4x precedent. This driver also creates the drivers/iio/flow/ subdirectory and the corresponding Kconfig/Makefile glue. Signed-off-by: Wadim Mueller <wafgo01@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
50 lines
1.2 KiB
Makefile
50 lines
1.2 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the industrial I/O core.
|
|
#
|
|
|
|
obj-$(CONFIG_IIO) += industrialio.o
|
|
industrialio-y := industrialio-core.o industrialio-event.o inkern.o
|
|
industrialio-$(CONFIG_IIO_BUFFER) += industrialio-buffer.o
|
|
industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o
|
|
industrialio-$(CONFIG_ACPI) += industrialio-acpi.o
|
|
|
|
obj-$(CONFIG_IIO_CONFIGFS) += industrialio-configfs.o
|
|
obj-$(CONFIG_IIO_GTS_HELPER) += industrialio-gts-helper.o
|
|
obj-$(CONFIG_IIO_SW_DEVICE) += industrialio-sw-device.o
|
|
obj-$(CONFIG_IIO_SW_TRIGGER) += industrialio-sw-trigger.o
|
|
obj-$(CONFIG_IIO_TRIGGERED_EVENT) += industrialio-triggered-event.o
|
|
obj-$(CONFIG_IIO_BACKEND) += industrialio-backend.o
|
|
|
|
obj-y += accel/
|
|
obj-y += adc/
|
|
obj-y += addac/
|
|
obj-y += afe/
|
|
obj-y += amplifiers/
|
|
obj-y += buffer/
|
|
obj-y += cdc/
|
|
obj-y += chemical/
|
|
obj-y += common/
|
|
obj-y += dac/
|
|
obj-y += dummy/
|
|
obj-y += gyro/
|
|
obj-y += filter/
|
|
obj-y += flow/
|
|
obj-y += frequency/
|
|
obj-y += health/
|
|
obj-y += humidity/
|
|
obj-y += imu/
|
|
obj-y += light/
|
|
obj-y += magnetometer/
|
|
obj-y += multiplexer/
|
|
obj-y += orientation/
|
|
obj-y += position/
|
|
obj-y += potentiometer/
|
|
obj-y += potentiostat/
|
|
obj-y += pressure/
|
|
obj-y += proximity/
|
|
obj-y += resolver/
|
|
obj-y += temperature/
|
|
obj-y += test/
|
|
obj-y += trigger/
|