summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHal Feng <hal.feng@starfivetech.com>2023-01-06 16:15:21 +0800
committerHal Feng <hal.feng@starfivetech.com>2023-01-09 10:36:56 +0800
commit3c22d345773f1211c8651f3ef590a037d2cb2e58 (patch)
treee9bb45d65d0e5278f3c11656fc85402c682c3cfd
parent9d16d3753da57c29d8744a11b66ec7f106b0f807 (diff)
downloadlinux-starfive-3c22d345773f1211c8651f3ef590a037d2cb2e58.tar.gz
linux-starfive-3c22d345773f1211c8651f3ef590a037d2cb2e58.tar.bz2
linux-starfive-3c22d345773f1211c8651f3ef590a037d2cb2e58.zip
pinctrl: starfive: Move pm ops to pinctrl-starfive-jh7110.c
Because different SoCs have their own registers. We want to save all registers in the pm suspend function and restore them in the pm resume function. Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
-rwxr-xr-xdrivers/pinctrl/starfive/pinctrl-starfive-jh7110.c19
-rw-r--r--drivers/pinctrl/starfive/pinctrl-starfive.c19
-rw-r--r--drivers/pinctrl/starfive/pinctrl-starfive.h1
3 files changed, 19 insertions, 20 deletions
diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
index d7adf8b3332d..e4a804224421 100755
--- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
+++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
@@ -1663,6 +1663,25 @@ static int starfive_jh7110_pinctrl_probe(struct platform_device *pdev)
return starfive_pinctrl_probe(pdev, pinctrl_info);
}
+static int __maybe_unused starfive_pinctrl_suspend(struct device *dev)
+{
+ struct starfive_pinctrl *pctl = dev_get_drvdata(dev);
+
+ return pinctrl_force_sleep(pctl->pctl_dev);
+}
+
+static int __maybe_unused starfive_pinctrl_resume(struct device *dev)
+{
+ struct starfive_pinctrl *pctl = dev_get_drvdata(dev);
+
+ return pinctrl_force_default(pctl->pctl_dev);
+}
+
+const struct dev_pm_ops starfive_pinctrl_pm_ops = {
+ SET_LATE_SYSTEM_SLEEP_PM_OPS(starfive_pinctrl_suspend,
+ starfive_pinctrl_resume)
+};
+
static struct platform_driver starfive_jh7110_pinctrl_driver = {
.driver = {
.name = "starfive_jh7110-pinctrl",
diff --git a/drivers/pinctrl/starfive/pinctrl-starfive.c b/drivers/pinctrl/starfive/pinctrl-starfive.c
index 262f573bc370..127053fe096b 100644
--- a/drivers/pinctrl/starfive/pinctrl-starfive.c
+++ b/drivers/pinctrl/starfive/pinctrl-starfive.c
@@ -474,25 +474,6 @@ int starfive_pinctrl_probe(struct platform_device *pdev,
}
EXPORT_SYMBOL_GPL(starfive_pinctrl_probe);
-static int __maybe_unused starfive_pinctrl_suspend(struct device *dev)
-{
- struct starfive_pinctrl *pctl = dev_get_drvdata(dev);
-
- return pinctrl_force_sleep(pctl->pctl_dev);
-}
-
-static int __maybe_unused starfive_pinctrl_resume(struct device *dev)
-{
- struct starfive_pinctrl *pctl = dev_get_drvdata(dev);
-
- return pinctrl_force_default(pctl->pctl_dev);
-}
-
-const struct dev_pm_ops starfive_pinctrl_pm_ops = {
- SET_LATE_SYSTEM_SLEEP_PM_OPS(starfive_pinctrl_suspend,
- starfive_pinctrl_resume)
-};
-EXPORT_SYMBOL_GPL(starfive_pinctrl_pm_ops);
MODULE_DESCRIPTION("Pinctrl driver for StarFive JH7110 SoC");
MODULE_AUTHOR("jenny.zhang <jenny.zhang@starfivetech.com>");
MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/starfive/pinctrl-starfive.h b/drivers/pinctrl/starfive/pinctrl-starfive.h
index 2db9df9550af..a319720b8d82 100644
--- a/drivers/pinctrl/starfive/pinctrl-starfive.h
+++ b/drivers/pinctrl/starfive/pinctrl-starfive.h
@@ -20,7 +20,6 @@
struct platform_device;
extern const struct pinmux_ops starfive_pmx_ops;
-extern const struct dev_pm_ops starfive_pinctrl_pm_ops;
struct starfive_pin_config {
unsigned long io_config;