aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/lima/lima_pmu.c
diff options
context:
space:
mode:
authorQiang Yu <[email protected]>2020-04-21 13:35:48 +0000
committerQiang Yu <[email protected]>2020-04-24 12:51:10 +0000
commit3446d7e9883d70882568b0f7b6549835d51a8bc7 (patch)
treebac87841e0e25d9ce56d4f8b5330d25f708c7f46 /drivers/gpu/drm/lima/lima_pmu.c
parentdrm/lima: power down ip blocks when pmu exit (diff)
downloadkernel-3446d7e9883d70882568b0f7b6549835d51a8bc7.tar.gz
kernel-3446d7e9883d70882568b0f7b6549835d51a8bc7.zip
drm/lima: add resume/suspend callback for each ip
For called when PM do resume/suspend. Tested-by: Bhushan Shah <[email protected]> Reviewed-by: Vasily Khoruzhick <[email protected]> Signed-off-by: Qiang Yu <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/lima/lima_pmu.c')
-rw-r--r--drivers/gpu/drm/lima/lima_pmu.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/gpu/drm/lima/lima_pmu.c b/drivers/gpu/drm/lima/lima_pmu.c
index d476569f2043..e397e1146e96 100644
--- a/drivers/gpu/drm/lima/lima_pmu.c
+++ b/drivers/gpu/drm/lima/lima_pmu.c
@@ -63,7 +63,7 @@ static u32 lima_pmu_get_ip_mask(struct lima_ip *ip)
return ret;
}
-int lima_pmu_init(struct lima_ip *ip)
+static int lima_pmu_hw_init(struct lima_ip *ip)
{
int err;
u32 stat;
@@ -88,7 +88,7 @@ int lima_pmu_init(struct lima_ip *ip)
return 0;
}
-void lima_pmu_fini(struct lima_ip *ip)
+static void lima_pmu_hw_fini(struct lima_ip *ip)
{
u32 stat;
@@ -109,3 +109,23 @@ void lima_pmu_fini(struct lima_ip *ip)
lima_pmu_wait_cmd(ip);
}
}
+
+int lima_pmu_resume(struct lima_ip *ip)
+{
+ return lima_pmu_hw_init(ip);
+}
+
+void lima_pmu_suspend(struct lima_ip *ip)
+{
+ lima_pmu_hw_fini(ip);
+}
+
+int lima_pmu_init(struct lima_ip *ip)
+{
+ return lima_pmu_hw_init(ip);
+}
+
+void lima_pmu_fini(struct lima_ip *ip)
+{
+ lima_pmu_hw_fini(ip);
+}