From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Daniel Lezcano" <daniel.lezcano@linaro.org>
Subject: Re: [PATCH 3/7] iio: buffer: document iio_push_to_buffers_with_ts()
Date: Sat, 13 Sep 2025 14:54:03 +0100 [thread overview]
Message-ID: <20250913145403.6e07d7a9@jic23-huawei> (raw)
In-Reply-To: <20250912-iio-doc-push-to-buffers-context-v1-3-c4aad013d96e@baylibre.com>
On Fri, 12 Sep 2025 11:05:54 -0500
David Lechner <dlechner@baylibre.com> wrote:
> Document the iio_push_to_buffers_with_ts() function.
>
> This is copied and slightly cleaned up from
> iio_push_to_buffers_with_timestamp().
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
> include/linux/iio/buffer.h | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
> index 5c84ec4a981001dfba3b369f811368bab70a3117..47f23bc0470eaf308fc3a739faaf9b56cac0ef67 100644
> --- a/include/linux/iio/buffer.h
> +++ b/include/linux/iio/buffer.h
> @@ -45,6 +45,22 @@ static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev,
> return iio_push_to_buffers(indio_dev, data);
> }
>
> +/**
> + * iio_push_to_buffers_with_ts() - push data and timestamp to buffers
> + * @indio_dev: iio_dev structure for device.
> + * @data: Pointer to sample data buffer.
> + * @data_total_len: The size of @data in bytes.
> + * @timestamp: Timestamp for the sample data.
> + *
> + * Pushes data to the IIO device's buffers. If timestamps are enabled for the
> + * device the function will store the supplied timestamp as the last element in
> + * the sample data buffer before pushing it to the device buffers. The sample
> + * data buffer needs to be large enough to hold the additional timestamp
> + * (usually the buffer should be indio->scan_bytes bytes large).
usually the buffer should be at least indio->scan_bytes bytes large)
It is really common for it to be bigger and don't want people thinking the
need to dynamically resize it!
> + *
> + * Context: Any context.
> + * Return: 0 on success, a negative error code otherwise.
> + */
> static inline int iio_push_to_buffers_with_ts(struct iio_dev *indio_dev,
> void *data, size_t data_total_len,
> s64 timestamp)
>
next prev parent reply other threads:[~2025-09-13 13:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 16:05 [PATCH 0/7] iio: buffer: document calling context when pushing to buffers David Lechner
2025-09-12 16:05 ` [PATCH 1/7] iio: buffer: document iio_push_to_buffers_with_ts_unaligned() may sleep David Lechner
2025-09-12 18:12 ` Andy Shevchenko
2025-09-12 16:05 ` [PATCH 2/7] iio: buffer: iio_push_to_buffers_with_ts_unaligned() might_sleep() David Lechner
2025-09-12 18:10 ` Andy Shevchenko
2025-09-12 18:40 ` David Lechner
2025-09-13 13:52 ` Jonathan Cameron
2025-09-12 16:05 ` [PATCH 3/7] iio: buffer: document iio_push_to_buffers_with_ts() David Lechner
2025-09-13 13:54 ` Jonathan Cameron [this message]
2025-09-12 16:05 ` [PATCH 4/7] iio: buffer: deprecated iio_push_to_buffers_with_timestamp() David Lechner
2025-09-12 18:11 ` Andy Shevchenko
2025-09-12 16:05 ` [PATCH 5/7] iio: buffer: document iio_push_to_buffers() calling context David Lechner
2025-09-12 16:05 ` [PATCH 6/7] iio: buffer: document store_to() callback may be called in any context David Lechner
2025-09-12 16:05 ` [PATCH 7/7] iio: buffer: document that buffer callback must be context safe David Lechner
2025-09-13 13:57 ` [PATCH 0/7] iio: buffer: document calling context when pushing to buffers Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250913145403.6e07d7a9@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox