iio: flow: add Sensirion SLF3S liquid flow sensor driverAdd a driver for the Sensirion SLF3S family of digitalliquid-flow sensors on I2C. Currently supported variants areSLF3S-0600F, SLF3S-1300F
iio: flow: add Sensirion SLF3S liquid flow sensor driverAdd a driver for the Sensirion SLF3S family of digitalliquid-flow sensors on I2C. Currently supported variants areSLF3S-0600F, SLF3S-1300F and SLF3S-4000B; they share the sameregister map and differ only in flow-scale factor and calibratedmeasurement range. The variant (and therefore the scale) isauto-detected from the product-information register at probe time;a sensor reporting an unknown sub-type falls back to the variantnamed in the device tree / I2C table, so a drop-in replacement partkeeps working on a kernel that does not know its sub-type yet.Each measurement frame returns a 16-bit signed flow value, a16-bit signed temperature reading and a status word, eachprotected by a CRC-8 byte. The driver exposes the flow rate asIIO_VOLUMEFLOW and the temperature as IIO_TEMP via the standardIIO read_raw / read_scale interface.The volume-flow scale is reported in m^3/s. As the per-LSB scaleis on the order of 1e-12 m^3/s, it is emitted as a 64-bitfixed-point value with femto (1e-15) resolution(IIO_VAL_DECIMAL64_FEMTO) so the small SI value keeps fullprecision. This relies on the IIO_VAL_DECIMAL64_FEMTO format typeadded earlier in this series.The active calibration medium can be switched at runtime betweenthe factory-calibrated water and isopropyl-alcohol modes via thein_volumeflow_medium sysfs attribute; the sensor starts in watermode after probe.The sensor has no low-power state of its own, so system suspendstops the measurement and disables the vdd supply; resume powersthe sensor back up, waits out the power-up time and restarts themeasurement with the previously active medium, following thescd30/scd4x precedent.This driver also creates the drivers/iio/flow/ subdirectory andthe corresponding Kconfig/Makefile glue.Signed-off-by: Wadim Mueller <wafgo01@gmail.com>Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
show more ...