Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm: sun4i: Add support for suspending the display driver

Shut down the display engine during suspend.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20191029112846.3604925-1-megous@megous.com

authored by

Ondrej Jirman and committed by
Maxime Ripard
624b4b48 42240c90

+22
+22
drivers/gpu/drm/sun4i/sun4i_drv.c
··· 346 346 return count; 347 347 } 348 348 349 + #ifdef CONFIG_PM_SLEEP 350 + static int sun4i_drv_drm_sys_suspend(struct device *dev) 351 + { 352 + struct drm_device *drm = dev_get_drvdata(dev); 353 + 354 + return drm_mode_config_helper_suspend(drm); 355 + } 356 + 357 + static int sun4i_drv_drm_sys_resume(struct device *dev) 358 + { 359 + struct drm_device *drm = dev_get_drvdata(dev); 360 + 361 + return drm_mode_config_helper_resume(drm); 362 + } 363 + #endif 364 + 365 + static const struct dev_pm_ops sun4i_drv_drm_pm_ops = { 366 + SET_SYSTEM_SLEEP_PM_OPS(sun4i_drv_drm_sys_suspend, 367 + sun4i_drv_drm_sys_resume) 368 + }; 369 + 349 370 static int sun4i_drv_probe(struct platform_device *pdev) 350 371 { 351 372 struct component_match *match = NULL; ··· 439 418 .driver = { 440 419 .name = "sun4i-drm", 441 420 .of_match_table = sun4i_drv_of_table, 421 + .pm = &sun4i_drv_drm_pm_ops, 442 422 }, 443 423 }; 444 424 module_platform_driver(sun4i_drv_platform_driver);