mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
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:
parent
f718ea6cb3
commit
cbbd5a945e
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user