1 /* SPDX-License-Identifier: GPL-2.0 */
4 #ifndef __LIMA_DEVFREQ_H__
5 #define __LIMA_DEVFREQ_H__
7 #include <linux/devfreq.h>
8 #include <linux/spinlock.h>
9 #include <linux/ktime.h>
12 struct thermal_cooling_device;
17 struct devfreq *devfreq;
18 struct thermal_cooling_device *cooling;
19 struct devfreq_simple_ondemand_data gov_data;
23 ktime_t time_last_update;
26 * Protect busy_time, idle_time, time_last_update and busy_count
27 * because these can be updated concurrently, for example by the GP
33 int lima_devfreq_init(struct lima_device *ldev);
34 void lima_devfreq_fini(struct lima_device *ldev);
36 void lima_devfreq_record_busy(struct lima_devfreq *devfreq);
37 void lima_devfreq_record_idle(struct lima_devfreq *devfreq);
39 int lima_devfreq_resume(struct lima_devfreq *devfreq);
40 int lima_devfreq_suspend(struct lima_devfreq *devfreq);