mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-18 06:15:12 +00:00
spi: cadence-qspi: add system-wide suspend and resume callbacks
Each SPI controller is expected to call the spi_controller_suspend() and spi_controller_resume() callbacks at system-wide suspend and resume. It (1) handles the kthread worker for queued controllers and (2) marks the controller as suspended to have spi_sync() fail while the controller is unavailable. Those two operations do not require the controller to be active, we do not need to increment the runtime PM usage counter. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://msgid.link/r/20240222-cdns-qspi-pm-fix-v4-4-6b6af8bcbf59@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4efa1250b5
commit
078d62de43
@ -1949,8 +1949,24 @@ static int cqspi_runtime_resume(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEFINE_RUNTIME_DEV_PM_OPS(cqspi_dev_pm_ops, cqspi_runtime_suspend,
|
static int cqspi_suspend(struct device *dev)
|
||||||
cqspi_runtime_resume, NULL);
|
{
|
||||||
|
struct cqspi_st *cqspi = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
return spi_controller_suspend(cqspi->host);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cqspi_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
struct cqspi_st *cqspi = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
return spi_controller_resume(cqspi->host);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct dev_pm_ops cqspi_dev_pm_ops = {
|
||||||
|
RUNTIME_PM_OPS(cqspi_runtime_suspend, cqspi_runtime_resume, NULL)
|
||||||
|
SYSTEM_SLEEP_PM_OPS(cqspi_suspend, cqspi_resume)
|
||||||
|
};
|
||||||
|
|
||||||
static const struct cqspi_driver_platdata cdns_qspi = {
|
static const struct cqspi_driver_platdata cdns_qspi = {
|
||||||
.quirks = CQSPI_DISABLE_DAC_MODE,
|
.quirks = CQSPI_DISABLE_DAC_MODE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user