Re: [PATCH v5 3/8] iio: accel: adxl313: add buffered FIFO watermark with interrupt handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 15 Jun 2025 22:22:53 +0000
Lothar Rubusch <l.rubusch@xxxxxxxxx> wrote:

> 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@xxxxxxxxx>

Just the follow on comment that I posted on v4 thread after you sent this.
(obviously in addition to what you've been discussing with Andy)

> diff --git a/drivers/iio/accel/adxl313_core.c b/drivers/iio/accel/adxl313_core.c
> index 99a7f3755031..488680807a8f 100644
> --- a/drivers/iio/accel/adxl313_core.c
> +++ b/drivers/iio/accel/adxl313_core.c

> +
> +static int adxl313_fifo_transfer(struct adxl313_data *data, int samples)
> +{
> +	unsigned int i;
> +	int ret;
> +
> +	for (i = 0; i < samples; i++) {
> +		ret = regmap_bulk_read(data->regmap, ADXL313_REG_XYZ_BASE,
> +				       data->fifo_buf + (i * ADXL313_NUM_AXIS),
> +				       2 * ADXL313_NUM_AXIS);

the sizeof() thing that I gave a late reply to in v4 thread applies here.

> +		if (ret)
> +			return ret;
> +	}
> +
> +	return 0;
> +}





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux