[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGaVeW4l6HkiMtql@smile.fi.intel.com>
Date: Thu, 3 Jul 2025 17:36:41 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Lothar Rubusch <l.rubusch@...il.com>
Cc: jic23@...nel.org, dlechner@...libre.com, nuno.sa@...log.com,
andy@...nel.org, corbet@....net, lucas.p.stankus@...il.com,
lars@...afoo.de, Michael.Hennerich@...log.com, bagasdotme@...il.com,
linux-iio@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 3/8] iio: accel: adxl313: add buffered FIFO watermark
with interrupt handling
On Wed, Jul 02, 2025 at 11:08:14PM +0000, Lothar Rubusch 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.
...
> +err:
The rule of thumb for naming error labels is an answer to "what does code do
when I goto $LABEL?". In other words name should encode what will be done when
goto. In this case I would make it
err_fifo_reset:
The rationale is that reading the code won't require to "goto" to understand
what 'err' means.
> + adxl313_fifo_reset(data);
> +
> + return IRQ_HANDLED;
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists