Merge tag 'exfat-for-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linki...
[linux-2.6-block.git] / drivers / gpu / drm / panfrost / panfrost_devfreq.h
CommitLineData
f3ba9122
RH
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright 2019 Collabora ltd. */
3
4#ifndef __PANFROST_DEVFREQ_H__
5#define __PANFROST_DEVFREQ_H__
6
ed85df3f 7#include <linux/spinlock.h>
9bfacfc8
CP
8#include <linux/ktime.h>
9
10struct devfreq;
fd587ff0 11struct opp_table;
9bfacfc8
CP
12struct thermal_cooling_device;
13
14struct panfrost_device;
15
16struct panfrost_devfreq {
17 struct devfreq *devfreq;
fd587ff0 18 struct opp_table *regulators_opp_table;
9bfacfc8 19 struct thermal_cooling_device *cooling;
81f2fbe6 20 bool opp_of_table_added;
ed85df3f 21
9bfacfc8
CP
22 ktime_t busy_time;
23 ktime_t idle_time;
24 ktime_t time_last_update;
ed85df3f
CP
25 int busy_count;
26 /*
27 * Protect busy_time, idle_time, time_last_update and busy_count
28 * because these can be updated concurrently between multiple jobs.
29 */
30 spinlock_t lock;
9bfacfc8
CP
31};
32
f3ba9122 33int panfrost_devfreq_init(struct panfrost_device *pfdev);
aa4fffec 34void panfrost_devfreq_fini(struct panfrost_device *pfdev);
f3ba9122
RH
35
36void panfrost_devfreq_resume(struct panfrost_device *pfdev);
37void panfrost_devfreq_suspend(struct panfrost_device *pfdev);
38
9bfacfc8
CP
39void panfrost_devfreq_record_busy(struct panfrost_devfreq *devfreq);
40void panfrost_devfreq_record_idle(struct panfrost_devfreq *devfreq);
f3ba9122
RH
41
42#endif /* __PANFROST_DEVFREQ_H__ */