diff options
author | Qiang Yu <yuq825@gmail.com> | 2020-04-21 21:35:50 +0800 |
---|---|---|
committer | Qiang Yu <yuq825@gmail.com> | 2020-04-24 20:51:19 +0800 |
commit | 63945d51490f16aede6d635e785faf56521e5e4a (patch) | |
tree | e4bc1915f491fa4c7f8857c19d07efb0cdde7556 /drivers/gpu/drm/lima/lima_drv.c | |
parent | 7a475eb470ac482306c9281b2faadf2cbfb6b84c (diff) | |
download | lwn-63945d51490f16aede6d635e785faf56521e5e4a.tar.gz lwn-63945d51490f16aede6d635e785faf56521e5e4a.zip |
drm/lima: add pm resume/suspend ops
Add driver pm system and runtime hardware resume/suspend ops.
Note this won't enable runtime pm of the device yet.
v2:
Do clock and power gating when suspend/resume.
Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-10-yuq825@gmail.com
Diffstat (limited to 'drivers/gpu/drm/lima/lima_drv.c')
-rw-r--r-- | drivers/gpu/drm/lima/lima_drv.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c index 3d63d496cfc2..f3fe0a2f764b 100644 --- a/drivers/gpu/drm/lima/lima_drv.c +++ b/drivers/gpu/drm/lima/lima_drv.c @@ -5,6 +5,7 @@ #include <linux/of_platform.h> #include <linux/uaccess.h> #include <linux/slab.h> +#include <linux/pm_runtime.h> #include <drm/drm_ioctl.h> #include <drm/drm_drv.h> #include <drm/drm_prime.h> @@ -451,11 +452,17 @@ static const struct of_device_id dt_match[] = { }; MODULE_DEVICE_TABLE(of, dt_match); +static const struct dev_pm_ops lima_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + SET_RUNTIME_PM_OPS(lima_device_suspend, lima_device_resume, NULL) +}; + static struct platform_driver lima_platform_driver = { .probe = lima_pdev_probe, .remove = lima_pdev_remove, .driver = { .name = "lima", + .pm = &lima_pm_ops, .of_match_table = dt_match, }, }; |