Commit 0098c527 authored by Douglas Anderson's avatar Douglas Anderson Committed by Mark Brown

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: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230323102605.5.I79544b9486033bd7b27f2be55adda6d36f62a366@changeidSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5936e77c
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/pm_opp.h> #include <linux/pm_opp.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
...@@ -579,6 +580,8 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev) ...@@ -579,6 +580,8 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev)
return ret; return ret;
} }
pinctrl_pm_select_sleep_state(dev);
return 0; return 0;
} }
...@@ -588,6 +591,8 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev) ...@@ -588,6 +591,8 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev)
struct qcom_qspi *ctrl = spi_master_get_devdata(master); struct qcom_qspi *ctrl = spi_master_get_devdata(master);
int ret; int ret;
pinctrl_pm_select_default_state(dev);
ret = icc_enable(ctrl->icc_path_cpu_to_qspi); ret = icc_enable(ctrl->icc_path_cpu_to_qspi);
if (ret) { if (ret) {
dev_err_ratelimited(ctrl->dev, "%s: ICC enable failed for cpu: %d\n", dev_err_ratelimited(ctrl->dev, "%s: ICC enable failed for cpu: %d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment