diff options
author | Douglas Anderson <dianders@chromium.org> | 2023-03-23 20:30:09 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-28 03:26:10 +0300 |
commit | 0098c52745112c4387942a37559ababeaf072f0c (patch) | |
tree | 2cc590aab4550bf7668bfdcd819c6d63be7c9095 /drivers/spi/spi-qcom-qspi.c | |
parent | 5936e77c202add2cc20c21cd4486ace1a362bd43 (diff) | |
download | linux-0098c52745112c4387942a37559ababeaf072f0c.tar.xz |
spi: spi-qcom-qspi: Support pinctrl sleep states
It's fairly common practice for drivers to switch to a "sleep" pinctrl
state at the end of its runtime_suspend function and then back to
"default" at the beginning of runtime_resume. Let's do that for
spi-qcom-qspi.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230323102605.5.I79544b9486033bd7b27f2be55adda6d36f62a366@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-qcom-qspi.c')
-rw-r--r-- | drivers/spi/spi-qcom-qspi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index aa91a6c9ab55..fab155389999 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -8,6 +8,7 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> +#include <linux/pinctrl/consumer.h> #include <linux/pm_runtime.h> #include <linux/pm_opp.h> #include <linux/spi/spi.h> @@ -579,6 +580,8 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev) return ret; } + pinctrl_pm_select_sleep_state(dev); + return 0; } @@ -588,6 +591,8 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev) struct qcom_qspi *ctrl = spi_master_get_devdata(master); int ret; + pinctrl_pm_select_default_state(dev); + ret = icc_enable(ctrl->icc_path_cpu_to_qspi); if (ret) { dev_err_ratelimited(ctrl->dev, "%s: ICC enable failed for cpu: %d\n", |