From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Robert Marko <robert.marko@sartura.hr>,
Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.18.y 1/3] spi: atmel-quadspi: add controller init callback
Date: Tue, 10 Nov 2026 09:19:07 -0500 [thread overview]
Message-ID: <20261110141901.1859701-1-sashal@kernel.org> (raw)
In-Reply-To: <20261107050822-failed-6.18-717e45f97246@kernel.org>
From: Robert Marko <robert.marko@sartura.hr>
[ Upstream commit cbbd5a945e85e7835ac5792d855d85c20e40d1e3 ]
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>
Stable-dep-of: 717e45f97246 ("spi: atmel-quadspi: balance runtime PM and pclk across system sleep")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 d7a3d85d00c2f..6c2d3c00409bb 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);
}
@@ -1571,6 +1577,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.53.0
next prev parent reply other threads:[~2026-11-10 14:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 10:08 FAILED: patch "[PATCH] spi: atmel-quadspi: balance runtime PM and pclk across system sleep" failed to apply to 6.18-stable tree Sasha Levin
2026-11-10 14:19 ` Sasha Levin [this message]
2026-11-10 14:19 ` [PATCH 6.18.y 2/3] spi: atmel-quadspi: use init callback for gclk variants Sasha Levin
2026-11-10 14:19 ` [PATCH 6.18.y 3/3] spi: atmel-quadspi: balance runtime PM and pclk across system sleep Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110141901.1859701-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=broonie@kernel.org \
--cc=robert.marko@sartura.hr \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.