[PATCH v3 0/4] iio: cdc: add Texas Instruments FDC1004 driver
From: Victor Chernyakin
Date: Mon Oct 26 2026 - 12:56:54 EST
This series adds support for the FDC1004 4-channel I2C capacitive sensor.
This sensor can report single-ended measurements of any one of its
channels, as well as differential measurements between any pair
of them. It has a measurement range of +-15 pF and a resolution of 0.5 fF.
Patch 1 prepares iio_format_value to handle IIO_VAL_DECIMAL64_* formats
introduced in Patch 2.
Patch 2 adds higher-precision IIO_VAL_DECIMAL64_* formats, used
in the driver.
Patch 3 adds the devicetree bindings.
Patch 4 adds the driver itself.
Tested with the sensor connected over an i2c-tiny-usb adapter.
---
Changes in v3:
Split Patch 1 into two patches.
- Patch 1
- Expanded the comment above abs_s64_no_overflow()
- Patch 4 (previously Patch 3)
- Added comment on what a negative capacitance bias is used for
- Reduced some line lengths by introducing a variable with a short name
- Joined consecutive assignments into single ones
- Fixed indentation
- Link to v2: https://lore.kernel.org/SN1PR12MB2528DD1E6067CC4C0B76746FA5622@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
---
Changes in v2:
- Patch 1
- Added tests
- Fixed overflow in iio_format_value on 10^scale and UB on abs(LLONG_MIN)
- Patch 2
- Made the power supply mandatory
- Patch 3
- Switched from direct I2C calls to regmap
- Added of device table
- Removed scan indexes
- Build up complex values incrementally
- Adjusted list of includes
- More designed initializers
- Various style/whitespace tweaks
- Link to v1: https://lore.kernel.org/SN1PR12MB25286BE4E1EA3B75F8E563A9A5652@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
---
Victor Chernyakin (4):
iio: prepare iio_format_value to handle higher-precision
IIO_VAL_DECIMAL64_* formats
iio: add IIO_VAL_DECIMAL64_{ATTO,ZEPTO,YOCTO} formats
dt-bindings: iio: cdc: add Texas Instruments FDC1004
iio: cdc: add Texas Instruments FDC1004 driver
.../bindings/iio/cdc/ti,fdc1004.yaml | 46 ++
MAINTAINERS | 6 +
drivers/iio/cdc/Kconfig | 10 +
drivers/iio/cdc/Makefile | 1 +
drivers/iio/cdc/fdc1004.c | 488 ++++++++++++++++++
drivers/iio/industrialio-core.c | 32 +-
drivers/iio/test/iio-test-format.c | 16 +
include/linux/iio/types.h | 3 +
8 files changed, 598 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/cdc/ti,fdc1004.yaml
create mode 100644 drivers/iio/cdc/fdc1004.c
--
2.53.0