* [PATCH v4 1/1] spi: offload: Add offset parameter
@ 2025-10-06 14:25 Marcelo Schmitt
2025-10-15 12:14 ` Mark Brown
2025-11-03 15:33 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Marcelo Schmitt @ 2025-10-06 14:25 UTC (permalink / raw)
To: linux-spi, linux-iio, linux-kernel
Cc: Axel Haslam, broonie, jic23, nuno.sa, dlechner, andy,
marcelo.schmitt1
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. While at it, add some documentation to offload periodic trigger
parameters.
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
---
Hello,
This patch adds a small feature that is required for a series improving ad4030
in the IIO subsystem [1]. Can we have an immutable branch with this patch so
that it can be used as base for the IIO driver changes?
[1]: https://lore.kernel.org/linux-iio/cover.1758916484.git.marcelo.schmitt@analog.com/
Thanks,
Marcelo
Change log v3 -> v4
- Picked up David's review tag
Change log v2 -> v3
- Squashed SPI offload trigger commits.
- Added documentation to offload trigger periodic parameters.
Change log v1 -> v2
- Use upper case: adc -> ADC.
- Codestyle/readability improvements according to suggestions.
Link to v3: https://lore.kernel.org/linux-spi/d73804d605d494c6420adb7c0b67f6707628832d.1758913065.git.marcelo.schmitt@analog.com/
Link to v2: https://lore.kernel.org/linux-spi/cover.1758206554.git.marcelo.schmitt@analog.com/
Link to v1: https://lore.kernel.org/linux-iio/cover.1756511030.git.marcelo.schmitt@analog.com/
drivers/spi/spi-offload-trigger-pwm.c | 3 +++
include/linux/spi/offload/types.h | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/drivers/spi/spi-offload-trigger-pwm.c b/drivers/spi/spi-offload-trigger-pwm.c
index 805ed41560df..3e8c19227edb 100644
--- a/drivers/spi/spi-offload-trigger-pwm.c
+++ b/drivers/spi/spi-offload-trigger-pwm.c
@@ -51,12 +51,14 @@ static int spi_offload_trigger_pwm_validate(struct spi_offload_trigger *trigger,
wf.period_length_ns = DIV_ROUND_UP_ULL(NSEC_PER_SEC, periodic->frequency_hz);
/* REVISIT: 50% duty-cycle for now - may add config parameter later */
wf.duty_length_ns = wf.period_length_ns / 2;
+ wf.duty_offset_ns = periodic->offset_ns;
ret = pwm_round_waveform_might_sleep(st->pwm, &wf);
if (ret < 0)
return ret;
periodic->frequency_hz = DIV_ROUND_UP_ULL(NSEC_PER_SEC, wf.period_length_ns);
+ periodic->offset_ns = wf.duty_offset_ns;
return 0;
}
@@ -77,6 +79,7 @@ static int spi_offload_trigger_pwm_enable(struct spi_offload_trigger *trigger,
wf.period_length_ns = DIV_ROUND_UP_ULL(NSEC_PER_SEC, periodic->frequency_hz);
/* REVISIT: 50% duty-cycle for now - may add config parameter later */
wf.duty_length_ns = wf.period_length_ns / 2;
+ wf.duty_offset_ns = periodic->offset_ns;
return pwm_set_waveform_might_sleep(st->pwm, &wf, false);
}
diff --git a/include/linux/spi/offload/types.h b/include/linux/spi/offload/types.h
index 6f7892347871..cd61f8adb7a5 100644
--- a/include/linux/spi/offload/types.h
+++ b/include/linux/spi/offload/types.h
@@ -57,8 +57,17 @@ enum spi_offload_trigger_type {
SPI_OFFLOAD_TRIGGER_PERIODIC,
};
+/**
+ * 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 {
base-commit: 23bd49d3a1c042a3fb262299d86110af4cbd073d
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v4 1/1] spi: offload: Add offset parameter
2025-10-06 14:25 [PATCH v4 1/1] spi: offload: Add offset parameter Marcelo Schmitt
@ 2025-10-15 12:14 ` Mark Brown
2025-10-18 13:13 ` Jonathan Cameron
2025-11-03 15:33 ` Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2025-10-15 12:14 UTC (permalink / raw)
To: linux-spi, linux-iio, linux-kernel, Marcelo Schmitt
Cc: Axel Haslam, jic23, nuno.sa, dlechner, andy, marcelo.schmitt1
On Mon, 06 Oct 2025 11:25:41 -0300, Marcelo Schmitt wrote:
> 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. While at it, add some documentation to offload periodic trigger
> parameters.
>
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: offload: Add offset parameter
commit: b83fb1b14c06bdd765903ac852ba20a14e24f227
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 1/1] spi: offload: Add offset parameter
2025-10-15 12:14 ` Mark Brown
@ 2025-10-18 13:13 ` Jonathan Cameron
2025-10-27 13:53 ` Jonathan Cameron
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2025-10-18 13:13 UTC (permalink / raw)
To: Mark Brown
Cc: linux-spi, linux-iio, linux-kernel, Marcelo Schmitt, Axel Haslam,
nuno.sa, dlechner, andy, marcelo.schmitt1
On Wed, 15 Oct 2025 13:14:06 +0100
Mark Brown <broonie@kernel.org> wrote:
> On Mon, 06 Oct 2025 11:25:41 -0300, Marcelo Schmitt wrote:
> > 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. While at it, add some documentation to offload periodic trigger
> > parameters.
> >
> >
> > [...]
>
> Applied to
>
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
>
> Thanks!
>
> [1/1] spi: offload: Add offset parameter
> commit: b83fb1b14c06bdd765903ac852ba20a14e24f227
>
Hi Mark,
The patch called out that we are after an immutable branch or similar for this one.
"
Hello,
This patch adds a small feature that is required for a series improving ad4030
in the IIO subsystem [1]. Can we have an immutable branch with this patch so
that it can be used as base for the IIO driver changes?
[1]: https://lore.kernel.org/linux-iio/cover.1758916484.git.marcelo.schmitt@analog.com/
"
If you can still set that up, much appreciated.
Thanks,
Jonathan
> All being well this means that it will be integrated into the linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
>
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems and
> send followup patches addressing any issues that are reported if needed.
>
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
>
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
>
> Thanks,
> Mark
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 1/1] spi: offload: Add offset parameter
2025-10-18 13:13 ` Jonathan Cameron
@ 2025-10-27 13:53 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2025-10-27 13:53 UTC (permalink / raw)
To: Mark Brown
Cc: linux-spi, linux-iio, linux-kernel, Marcelo Schmitt, Axel Haslam,
nuno.sa, dlechner, andy, marcelo.schmitt1
On Sat, 18 Oct 2025 14:13:41 +0100
Jonathan Cameron <jic23@kernel.org> wrote:
> On Wed, 15 Oct 2025 13:14:06 +0100
> Mark Brown <broonie@kernel.org> wrote:
>
> > On Mon, 06 Oct 2025 11:25:41 -0300, Marcelo Schmitt wrote:
> > > 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. While at it, add some documentation to offload periodic trigger
> > > parameters.
> > >
> > >
> > > [...]
> >
> > Applied to
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
> >
> > Thanks!
> >
> > [1/1] spi: offload: Add offset parameter
> > commit: b83fb1b14c06bdd765903ac852ba20a14e24f227
> >
> Hi Mark,
>
> The patch called out that we are after an immutable branch or similar for this one.
>
> "
> Hello,
>
> This patch adds a small feature that is required for a series improving ad4030
> in the IIO subsystem [1]. Can we have an immutable branch with this patch so
> that it can be used as base for the IIO driver changes?
>
> [1]: https://lore.kernel.org/linux-iio/cover.1758916484.git.marcelo.schmitt@analog.com/
> "
>
> If you can still set that up, much appreciated.
Hi Mark,
The ad4030 changes are stuck on resolving this or waiting a cycle :(
If you get a chance to take a look and maybe merge it a different way that would be great.
Thanks,
Jonathan
>
> Thanks,
>
> Jonathan
>
> > All being well this means that it will be integrated into the linux-next
> > tree (usually sometime in the next 24 hours) and sent to Linus during
> > the next merge window (or sooner if it is a bug fix), however if
> > problems are discovered then the patch may be dropped or reverted.
> >
> > You may get further e-mails resulting from automated or manual testing
> > and review of the tree, please engage with people reporting problems and
> > send followup patches addressing any issues that are reported if needed.
> >
> > If any updates are required or you are submitting further changes they
> > should be sent as incremental updates against current git, existing
> > patches will not be replaced.
> >
> > Please add any relevant lists and maintainers to the CCs when replying
> > to this mail.
> >
> > Thanks,
> > Mark
> >
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 1/1] spi: offload: Add offset parameter
2025-10-06 14:25 [PATCH v4 1/1] spi: offload: Add offset parameter Marcelo Schmitt
2025-10-15 12:14 ` Mark Brown
@ 2025-11-03 15:33 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2025-11-03 15:33 UTC (permalink / raw)
To: Marcelo Schmitt
Cc: linux-spi, linux-iio, linux-kernel, Axel Haslam, jic23, nuno.sa,
dlechner, andy, marcelo.schmitt1
[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]
On Mon, Oct 06, 2025 at 11:25:41AM -0300, 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. While at it, add some documentation to offload periodic trigger
> parameters.
The following changes since commit 3a8660878839faadb4f1a6dd72c3179c1df56787:
Linux 6.18-rc1 (2025-10-12 13:42:36 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-offload-offset
for you to fetch changes up to b83fb1b14c06bdd765903ac852ba20a14e24f227:
spi: offload: Add offset parameter (2025-10-13 11:27:52 +0100)
----------------------------------------------------------------
spi: offload: Add offset parameter
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. While at it, add some documentation to offload periodic trigger
parameters.
----------------------------------------------------------------
Axel Haslam (1):
spi: offload: Add offset parameter
Mark Brown (1):
Merge existing fixes from spi/for-6.18 into new branch
Documentation/devicetree/bindings/spi/spi-cadence.yaml | 11 ++++++++---
drivers/spi/spi-dw-mmio.c | 4 +++-
drivers/spi/spi-offload-trigger-pwm.c | 3 +++
drivers/spi/spi-rockchip-sfc.c | 12 +++++++++++-
include/linux/spi/offload/types.h | 9 +++++++++
5 files changed, 34 insertions(+), 5 deletions(-)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-11-03 15:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-06 14:25 [PATCH v4 1/1] spi: offload: Add offset parameter Marcelo Schmitt
2025-10-15 12:14 ` Mark Brown
2025-10-18 13:13 ` Jonathan Cameron
2025-10-27 13:53 ` Jonathan Cameron
2025-11-03 15:33 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).