mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
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
This commit is contained in:
parent
4eb70cd3f2
commit
4836cf044d
2 changed files with 27 additions and 0 deletions
|
@ -231,3 +231,27 @@ void lima_devfreq_record_idle(struct lima_devfreq *devfreq)
|
||||||
|
|
||||||
spin_unlock_irqrestore(&devfreq->lock, irqflags);
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -38,4 +38,7 @@ void lima_devfreq_fini(struct lima_device *ldev);
|
||||||
void lima_devfreq_record_busy(struct lima_devfreq *devfreq);
|
void lima_devfreq_record_busy(struct lima_devfreq *devfreq);
|
||||||
void lima_devfreq_record_idle(struct lima_devfreq *devfreq);
|
void lima_devfreq_record_idle(struct lima_devfreq *devfreq);
|
||||||
|
|
||||||
|
int lima_devfreq_resume(struct lima_devfreq *devfreq);
|
||||||
|
int lima_devfreq_suspend(struct lima_devfreq *devfreq);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue