Commit 624b4b48 authored by Ondrej Jirman's avatar Ondrej Jirman Committed by Maxime Ripard

drm: sun4i: Add support for suspending the display driver

Shut down the display engine during suspend.
Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20191029112846.3604925-1-megous@megous.com
parent 42240c90
...@@ -346,6 +346,27 @@ static int sun4i_drv_add_endpoints(struct device *dev, ...@@ -346,6 +346,27 @@ static int sun4i_drv_add_endpoints(struct device *dev,
return count; return count;
} }
#ifdef CONFIG_PM_SLEEP
static int sun4i_drv_drm_sys_suspend(struct device *dev)
{
struct drm_device *drm = dev_get_drvdata(dev);
return drm_mode_config_helper_suspend(drm);
}
static int sun4i_drv_drm_sys_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 sun4i_drv_drm_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(sun4i_drv_drm_sys_suspend,
sun4i_drv_drm_sys_resume)
};
static int sun4i_drv_probe(struct platform_device *pdev) static int sun4i_drv_probe(struct platform_device *pdev)
{ {
struct component_match *match = NULL; struct component_match *match = NULL;
...@@ -418,6 +439,7 @@ static struct platform_driver sun4i_drv_platform_driver = { ...@@ -418,6 +439,7 @@ static struct platform_driver sun4i_drv_platform_driver = {
.driver = { .driver = {
.name = "sun4i-drm", .name = "sun4i-drm",
.of_match_table = sun4i_drv_of_table, .of_match_table = sun4i_drv_of_table,
.pm = &sun4i_drv_drm_pm_ops,
}, },
}; };
module_platform_driver(sun4i_drv_platform_driver); module_platform_driver(sun4i_drv_platform_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment