[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9cb6d504595a642c2010bddc0d4f35ef@agner.ch>
Date: Tue, 07 Aug 2018 20:41:02 +0200
From: Stefan Agner <stefan@...er.ch>
To: Leonard Crestez <leonard.crestez@....com>
Cc: Philipp Zabel <p.zabel@...gutronix.de>,
Marek Vasut <marex@...x.de>, Shawn Guo <shawnguo@...nel.org>,
Fabio Estevam <fabio.estevam@....com>,
Robert Chiras <robert.chiras@....com>,
Mirela Rabulea <mirela.rabulea@....com>,
Anson Huang <Anson.Huang@....com>,
dri-devel@...ts.freedesktop.org,
Dong Aisheng <aisheng.dong@....com>, linux-imx@....com,
kernel@...gutronix.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/4] drm/mxsfb: Add PM_SLEEP support
On 06.08.2018 21:31, Leonard Crestez wrote:
> Since power to the lcdif block can be lost on suspend implement
> PM_SLEEP_OPS using drm_mode_config_helper_suspend/resume to save/restore
> the current mode.
>
> Signed-off-by: Leonard Crestez <leonard.crestez@....com>
Reviewed-by: Stefan Agner <stefan@...er.ch>
> ---
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 68d79f5dc0d3..d797dfd40d98 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -416,17 +416,38 @@ static int mxsfb_remove(struct platform_device *pdev)
> drm_dev_unref(drm);
>
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int mxsfb_suspend(struct device *dev)
> +{
> + struct drm_device *drm = dev_get_drvdata(dev);
> +
> + return drm_mode_config_helper_suspend(drm);
> +}
> +
> +static int mxsfb_resume(struct device *dev)
> +{
> + struct drm_device *drm = dev_get_drvdata(dev);
> +
> + return drm_mode_config_helper_resume(drm);
> +}
> +#endif
> +
> +static const struct dev_pm_ops mxsfb_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(mxsfb_suspend, mxsfb_resume)
> +};
> +
> static struct platform_driver mxsfb_platform_driver = {
> .probe = mxsfb_probe,
> .remove = mxsfb_remove,
> .id_table = mxsfb_devtype,
> .driver = {
> .name = "mxsfb",
> .of_match_table = mxsfb_dt_ids,
> + .pm = &mxsfb_pm_ops,
> },
> };
>
> module_platform_driver(mxsfb_platform_driver);
Powered by blists - more mailing lists