spi: atmel-quadspi: add controller init callback

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>
Link: https://patch.msgid.link/20260709112006.390742-3-robert.marko@sartura.hr
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Robert Marko 2026-07-09 13:19:08 +02:00 committed by Mark Brown
parent f718ea6cb3
commit cbbd5a945e
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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);