summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panfrost/panfrost_devfreq.h
blob: 0697f8d5aa34d21c0b5d870111382a01f9f1a780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright 2019 Collabora ltd. */

#ifndef __PANFROST_DEVFREQ_H__
#define __PANFROST_DEVFREQ_H__

#include <linux/ktime.h>

struct devfreq;
struct thermal_cooling_device;

struct panfrost_device;

struct panfrost_devfreq {
	struct devfreq *devfreq;
	struct thermal_cooling_device *cooling;
	ktime_t busy_time;
	ktime_t idle_time;
	ktime_t time_last_update;
	atomic_t busy_count;
};

int panfrost_devfreq_init(struct panfrost_device *pfdev);
void panfrost_devfreq_fini(struct panfrost_device *pfdev);

void panfrost_devfreq_resume(struct panfrost_device *pfdev);
void panfrost_devfreq_suspend(struct panfrost_device *pfdev);

void panfrost_devfreq_record_busy(struct panfrost_devfreq *devfreq);
void panfrost_devfreq_record_idle(struct panfrost_devfreq *devfreq);

#endif /* __PANFROST_DEVFREQ_H__ */