From mboxrd@z Thu Jan 1 00:00:00 1970 From: Abel Vesa Subject: [PATCH v2 2/2] pinctrl: pinctrl-imx8mq: Add support PM operations Date: Mon, 25 Mar 2019 13:59:30 +0000 Message-ID: <1553522352-20214-2-git-send-email-abel.vesa@nxp.com> References: <1553522352-20214-1-git-send-email-abel.vesa@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1553522352-20214-1-git-send-email-abel.vesa@nxp.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Robin Gong , Aisheng Dong , Fabio Estevam , Shawn Guo , Stefan Agner , Linus Walleij , Sascha Hauer Cc: dl-linux-imx , "linux-gpio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , Abel Vesa List-Id: linux-gpio@vger.kernel.org Add suspend/resume pm ops to the pinctrl i.MX8MQ driver. Make the suspend late and the resume early since some of the pins might be needed active very late. These call the pinctrl-imx generic handlers. Signed-off-by: Abel Vesa --- drivers/pinctrl/freescale/pinctrl-imx8mq.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pinctrl/freescale/pinctrl-imx8mq.c b/drivers/pinctrl/f= reescale/pinctrl-imx8mq.c index 8d39af5..2a212bc 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx8mq.c +++ b/drivers/pinctrl/freescale/pinctrl-imx8mq.c @@ -335,10 +335,26 @@ static int imx8mq_pinctrl_probe(struct platform_devic= e *pdev) return imx_pinctrl_probe(pdev, &imx8mq_pinctrl_info); } =20 +static int imx8mq_pinctrl_suspend(struct device *dev) +{ + return imx_pinctrl_suspend(dev); +} + +static int imx8mq_pinctrl_resume(struct device *dev) +{ + return imx_pinctrl_resume(dev); +} + +static const struct dev_pm_ops imx8mq_pinctrl_pm_ops =3D { + SET_LATE_SYSTEM_SLEEP_PM_OPS(imx8mq_pinctrl_suspend, + imx8mq_pinctrl_resume) +}; + static struct platform_driver imx8mq_pinctrl_driver =3D { .driver =3D { .name =3D "imx8mq-pinctrl", .of_match_table =3D of_match_ptr(imx8mq_pinctrl_of_match), + .pm =3D &imx8mq_pinctrl_pm_ops, .suppress_bind_attrs =3D true, }, .probe =3D imx8mq_pinctrl_probe, --=20 2.7.4