diff options
| author | Qiang Yu <[email protected]> | 2020-04-21 13:35:46 +0000 |
|---|---|---|
| committer | Qiang Yu <[email protected]> | 2020-04-24 12:50:57 +0000 |
| commit | 4836cf044d74eb70bb28d3460d8c82e4aaf56d65 (patch) | |
| tree | 8d6a5e9edc33972fc7bfd5647c5f2a548437a4eb /drivers/gpu/drm/lima/lima_devfreq.c | |
| parent | drm/lima: always set page directory when switch vm (diff) | |
| download | kernel-4836cf044d74eb70bb28d3460d8c82e4aaf56d65.tar.gz kernel-4836cf044d74eb70bb28d3460d8c82e4aaf56d65.zip | |
drm/lima: add lima_devfreq_resume/suspend
Used for device resume/suspend in the following commits.
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_devfreq.c')
| -rw-r--r-- | drivers/gpu/drm/lima/lima_devfreq.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c index 1d479b5924fe..bbe02817721b 100644 --- a/drivers/gpu/drm/lima/lima_devfreq.c +++ b/drivers/gpu/drm/lima/lima_devfreq.c @@ -231,3 +231,27 @@ void lima_devfreq_record_idle(struct lima_devfreq *devfreq) spin_unlock_irqrestore(&devfreq->lock, irqflags); } + +int lima_devfreq_resume(struct lima_devfreq *devfreq) +{ + unsigned long irqflags; + + if (!devfreq->devfreq) + return 0; + + spin_lock_irqsave(&devfreq->lock, irqflags); + + lima_devfreq_reset(devfreq); + + spin_unlock_irqrestore(&devfreq->lock, irqflags); + + return devfreq_resume_device(devfreq->devfreq); +} + +int lima_devfreq_suspend(struct lima_devfreq *devfreq) +{ + if (!devfreq->devfreq) + return 0; + + return devfreq_suspend_device(devfreq->devfreq); +} |
