]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pinctrl: imx8mq: Add suspend/resume ops
authorAbel Vesa <abel.vesa@nxp.com>
Mon, 8 Apr 2019 18:38:31 +0000 (18:38 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 11 Apr 2019 13:41:43 +0000 (15:41 +0200)
To support pinctl hog restore after LPSR resume back,
add the generic suspend/resume in pinctrl-imx along with the
generic pm ops to be used by platform specific drivers. Then
make use of the newly added ops in i.MX8MQ platform specific
driver.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/freescale/pinctrl-imx.c
drivers/pinctrl/freescale/pinctrl-imx.h
drivers/pinctrl/freescale/pinctrl-imx8mq.c

index 9635a2e93c72841b8655110ab363a2140e0a3edf..83ff9532bae640fcf61ec264f39588a695ddabd0 100644 (file)
@@ -885,3 +885,22 @@ int imx_pinctrl_probe(struct platform_device *pdev,
 
        return ret;
 }
+
+static int __maybe_unused imx_pinctrl_suspend(struct device *dev)
+{
+       struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+       return pinctrl_force_sleep(ipctl->pctl);
+}
+
+static int __maybe_unused imx_pinctrl_resume(struct device *dev)
+{
+       struct imx_pinctrl *ipctl = dev_get_drvdata(dev);
+
+       return pinctrl_force_default(ipctl->pctl);
+}
+
+const struct dev_pm_ops imx_pinctrl_pm_ops = {
+       SET_LATE_SYSTEM_SLEEP_PM_OPS(imx_pinctrl_suspend,
+                                       imx_pinctrl_resume)
+};
index 98a4889af4ef18408064d789376fba05dd7c5665..333d32b947b15a1bc2b2b83f0c3c4e4796317ae7 100644 (file)
@@ -17,6 +17,7 @@
 struct platform_device;
 
 extern struct pinmux_ops imx_pmx_ops;
+extern const struct dev_pm_ops imx_pinctrl_pm_ops;
 
 /**
  * struct imx_pin_mmio - MMIO pin configurations
index 8d39af541d5f1401000a7bf1c6209f539e6efb9f..50aa1c00c4b234ca0654bf355d0040725adc425a 100644 (file)
@@ -339,6 +339,7 @@ static struct platform_driver imx8mq_pinctrl_driver = {
        .driver = {
                .name = "imx8mq-pinctrl",
                .of_match_table = of_match_ptr(imx8mq_pinctrl_of_match),
+               .pm = &imx_pinctrl_pm_ops,
                .suppress_bind_attrs = true,
        },
        .probe = imx8mq_pinctrl_probe,