1 From 9d058ec3839e19637efc1957cdbbdafd69878acb Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Mon, 14 Jan 2019 14:47:57 -0800
4 Subject: [PATCH] drm/v3d: Hook up the runtime PM ops.
6 In translating the runtime PM code from vc4, I missed the ".pm"
7 assignment to actually connect them up. Fixes missing MMU setup if
10 Signed-off-by: Eric Anholt <eric@anholt.net>
11 (cherry picked from commit ca197699af29baa8236c74c53d4904ca8957ee06)
13 drivers/gpu/drm/v3d/v3d_drv.c | 37 +++++++++++++++++++++++++++++++++++
14 1 file changed, 37 insertions(+)
16 --- a/drivers/gpu/drm/v3d/v3d_drv.c
17 +++ b/drivers/gpu/drm/v3d/v3d_drv.c
19 #define DRIVER_MINOR 0
20 #define DRIVER_PATCHLEVEL 0
23 +static int v3d_runtime_suspend(struct device *dev)
25 + struct drm_device *drm = dev_get_drvdata(dev);
26 + struct v3d_dev *v3d = to_v3d_dev(drm);
28 + v3d_irq_disable(v3d);
30 + clk_disable_unprepare(v3d->clk);
35 +static int v3d_runtime_resume(struct device *dev)
37 + struct drm_device *drm = dev_get_drvdata(dev);
38 + struct v3d_dev *v3d = to_v3d_dev(drm);
41 + ret = clk_prepare_enable(v3d->clk);
47 + v3d_mmu_set_page_table(v3d);
48 + v3d_irq_enable(v3d);
54 +static const struct dev_pm_ops v3d_pm_ops = {
55 + SET_RUNTIME_PM_OPS(v3d_runtime_suspend, v3d_runtime_resume, NULL)
58 static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
59 struct drm_file *file_priv)
61 @@ -332,6 +368,7 @@ static struct platform_driver v3d_platfo
64 .of_match_table = v3d_of_match,