Devicetree
 help / color / mirror / Atom feed
* [PATCH 1/4] spi: atmel-quadspi: add controller init callback
@ 2026-07-08 16:51 Robert Marko
  2026-07-08 16:51 ` [PATCH 2/4] spi: atmel-quadspi: use init callback for gclk variants Robert Marko
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Robert Marko @ 2026-07-08 16:51 UTC (permalink / raw)
  To: conor, nicolas.ferre, claudiu.beznea, robh, krzk+dt, broonie,
	alexandre.belloni, linux-arm-kernel, devicetree, linux-kernel,
	daniel.machon
  Cc: luka.perkov, Robert Marko

Allow controller variants to provide a custom initialization callback
through their capability data.

This prepares the driver for variants which require a different hardware
initialization sequence without adding SoC checks to the common path.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 drivers/spi/atmel-quadspi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index aaf7f4c46b22..62ea84d234d0 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -256,8 +256,11 @@ static const struct atmel_qspi_pcal pcal[ATMEL_QSPI_PCAL_ARRAY_SIZE] = {
 	{200000000, 7},
 };
 
+struct atmel_qspi;
+
 struct atmel_qspi_caps {
 	u32 max_speed_hz;
+	int (*init)(struct atmel_qspi *aq);
 	bool has_qspick;
 	bool has_gclk;
 	bool has_ricr;
@@ -1156,6 +1159,9 @@ static int atmel_qspi_sama7g5_setup(struct spi_device *spi)
 	/* The controller can communicate with a single peripheral device (target). */
 	aq->target_max_speed_hz = spi->max_speed_hz;
 
+	if (aq->caps->init)
+		return aq->caps->init(aq);
+
 	return atmel_qspi_sama7g5_init(aq);
 }
 
@@ -1570,6 +1576,9 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev)
 		return ret;
 	}
 
+	if (aq->caps->init)
+		return aq->caps->init(aq);
+
 	if (aq->caps->has_gclk)
 		return atmel_qspi_sama7g5_init(aq);
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-08 17:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 16:51 [PATCH 1/4] spi: atmel-quadspi: add controller init callback Robert Marko
2026-07-08 16:51 ` [PATCH 2/4] spi: atmel-quadspi: use init callback for gclk variants Robert Marko
2026-07-08 16:51 ` [PATCH 3/4] spi: atmel-quadspi: add LAN969x QSPI support Robert Marko
2026-07-08 17:02   ` Conor Dooley
2026-07-08 17:05     ` Robert Marko
2026-07-08 16:51 ` [PATCH 4/4] arm64: dts: microchip: lan969x: add QSPI nodes Robert Marko
2026-07-08 17:23 ` [PATCH 1/4] spi: atmel-quadspi: add controller init callback Mark Brown
2026-07-08 17:46   ` Robert Marko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox