pinctrl: imx8mq: Add suspend/resume ops
Subsystems (4)
PATCH v3 1/1 pinctrl: imx8mq: Add suspend/resume ops
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.
---
Changes since v2:
* removed the pinctrl-imx8mq with imx8mq in the subject
* added static and __maybe_unused to both suspend and resume
* removed the useless null checks
drivers/pinctrl/freescale/pinctrl-imx.c | 19 +++++++++++++++++++ drivers/pinctrl/freescale/pinctrl-imx.h | 1 + drivers/pinctrl/freescale/pinctrl-imx8mq.c | 1 + 3 files changed, 21 insertions(+)
drivers/pinctrl/freescale/pinctrl-imx.c +19 -0
@@ -887,3 +887,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) +};
drivers/pinctrl/freescale/pinctrl-imx.h +1 -0
@@ -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
drivers/pinctrl/freescale/pinctrl-imx8mq.c +1 -0
@@ -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,
Signature · 1 line
2.7.4
Quoted 10 lines
From: Abel Vesa
Sent: Tuesday, April 9, 2019 2:39 AMTo 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 <[email protected]>Signed-off-by Abel Vesa <[email protected]>
Regards
Dong Aisheng
Quoted 8 lines · Abel Vesa
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 <[email protected]>Signed-off-by Abel Vesa <[email protected]>
This v3 version applied with Dong's ACK.
Yours,
Linus Walleij