Skip to content

Commit 4836cf0

Browse files
committed
drm/lima: add lima_devfreq_resume/suspend
Used for device resume/suspend in the following commits. 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-6-yuq825@gmail.com
1 parent 4eb70cd commit 4836cf0

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

‎drivers/gpu/drm/lima/lima_devfreq.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,27 @@ void lima_devfreq_record_idle(struct lima_devfreq *devfreq)
231231

232232
spin_unlock_irqrestore(&devfreq->lock, irqflags);
233233
}
234+
235+
int lima_devfreq_resume(struct lima_devfreq *devfreq)
236+
{
237+
unsigned long irqflags;
238+
239+
if (!devfreq->devfreq)
240+
return 0;
241+
242+
spin_lock_irqsave(&devfreq->lock, irqflags);
243+
244+
lima_devfreq_reset(devfreq);
245+
246+
spin_unlock_irqrestore(&devfreq->lock, irqflags);
247+
248+
return devfreq_resume_device(devfreq->devfreq);
249+
}
250+
251+
int lima_devfreq_suspend(struct lima_devfreq *devfreq)
252+
{
253+
if (!devfreq->devfreq)
254+
return 0;
255+
256+
return devfreq_suspend_device(devfreq->devfreq);
257+
}

‎drivers/gpu/drm/lima/lima_devfreq.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@ void lima_devfreq_fini(struct lima_device *ldev);
3838
void lima_devfreq_record_busy(struct lima_devfreq *devfreq);
3939
void lima_devfreq_record_idle(struct lima_devfreq *devfreq);
4040

41+
int lima_devfreq_resume(struct lima_devfreq *devfreq);
42+
int lima_devfreq_suspend(struct lima_devfreq *devfreq);
43+
4144
#endif

0 commit comments

Comments
 (0)