[PATCH v2 1/2] spi: offload: types: add offset parameter

Marcelo Schmitt posted 2 patches 1 week, 6 days ago
There is a newer version of this series
[PATCH v2 1/2] spi: offload: types: add offset parameter
Posted by Marcelo Schmitt 1 week, 6 days ago
From: Axel Haslam <ahaslam@baylibre.com>

Add an offset parameter that can be passed in the periodic trigger.
This is useful for example when ADC drivers implement a separate periodic
signal to trigger conversion and need offload to read the result with
some delay.

Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
---
 include/linux/spi/offload/types.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/spi/offload/types.h b/include/linux/spi/offload/types.h
index 6f7892347871..0170fd1f42e5 100644
--- a/include/linux/spi/offload/types.h
+++ b/include/linux/spi/offload/types.h
@@ -59,6 +59,7 @@ enum spi_offload_trigger_type {
 
 struct spi_offload_trigger_periodic {
 	u64 frequency_hz;
+	u64 offset_ns;
 };
 
 struct spi_offload_trigger_config {
-- 
2.50.1
Re: [PATCH v2 1/2] spi: offload: types: add offset parameter
Posted by David Lechner 1 week, 6 days ago
On 9/18/25 12:34 PM, Marcelo Schmitt wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
> 
> Add an offset parameter that can be passed in the periodic trigger.
> This is useful for example when ADC drivers implement a separate periodic
> signal to trigger conversion and need offload to read the result with
> some delay.
> 
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> ---
>  include/linux/spi/offload/types.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/spi/offload/types.h b/include/linux/spi/offload/types.h
> index 6f7892347871..0170fd1f42e5 100644
> --- a/include/linux/spi/offload/types.h
> +++ b/include/linux/spi/offload/types.h
> @@ -59,6 +59,7 @@ enum spi_offload_trigger_type {
>  


I think this would be a good time to add some documentation comments:

/**
 * spi_offload_trigger_periodic - configuration parameters for periodic triggers
 * @frequency_hz: The rate that the trigger should fire in Hz.
 * @offset_ns: A delay in nanoseconds between when this trigger fires
 *	compared to another trigger. This requires specialized hardware
 *	that supports such synchronization with a delay between two or
 *	more triggers. Set to 0 when not needed.
 */

>  struct spi_offload_trigger_periodic {
>  	u64 frequency_hz;
> +	u64 offset_ns;
>  };
>  
>  struct spi_offload_trigger_config {