]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: accel: adxl313: add buffered FIFO watermark with interrupt handling
authorLothar Rubusch <l.rubusch@gmail.com>
Wed, 2 Jul 2025 23:08:14 +0000 (23:08 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Jul 2025 14:36:26 +0000 (15:36 +0100)
commitff8093fa6ba4dd7235a7ad57d5c61b5d3bc9ad8a
tree17d1852c27e570aae58c551ebc8b4a5e8c868fdd
parenta1576623416a564c6561c722279c03fd0128f39d
iio: accel: adxl313: add buffered FIFO watermark with interrupt handling

Cover the following tasks:
- Add scan_mask and scan_index to the IIO channel configuration. The
scan_index sets up buffer usage. According to the datasheet, the ADXL313
uses a 13-bit wide data field in full-resolution mode. Set the
signedness, number of storage bits, and endianness accordingly.

- Parse the devicetree for an optional interrupt line and configure the
interrupt mapping based on its presence. If no interrupt line is
specified, keep the FIFO in bypass mode as currently implemented.

- Set up the interrupt handler. Add register access to detect and
evaluate interrupts. Implement functions to clear status registers and
reset the FIFO.

- Implement FIFO watermark configuration and handling. Allow the
watermark level to be set, evaluate the corresponding interrupt, read
the FIFO contents, and push the data to the IIO channel.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250702230819.19353-4-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl313.h
drivers/iio/accel/adxl313_core.c