diff options
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx.c | 19 | ||||
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx.h | 1 | ||||
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx8mq.c | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 9635a2e93c72..83ff9532bae6 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -885,3 +885,22 @@ free: 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) +}; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index 98a4889af4ef..333d32b947b1 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.h +++ b/drivers/pinctrl/freescale/pinctrl-imx.h @@ -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 diff --git a/drivers/pinctrl/freescale/pinctrl-imx8mq.c b/drivers/pinctrl/freescale/pinctrl-imx8mq.c index 8d39af541d5f..50aa1c00c4b2 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx8mq.c +++ b/drivers/pinctrl/freescale/pinctrl-imx8mq.c @@ -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, |