Linux Audio

Check our new training course

Loading...
v5.9
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright 2020 Martin Blumenstingl <martin.blumenstingl@googlemail.com> */
 3
 4#ifndef __LIMA_DEVFREQ_H__
 5#define __LIMA_DEVFREQ_H__
 6
 
 7#include <linux/spinlock.h>
 8#include <linux/ktime.h>
 9
10struct devfreq;
11struct opp_table;
12struct thermal_cooling_device;
13
14struct lima_device;
15
16struct lima_devfreq {
17	struct devfreq *devfreq;
18	struct opp_table *clkname_opp_table;
19	struct opp_table *regulators_opp_table;
20	struct thermal_cooling_device *cooling;
21	bool opp_of_table_added;
22
23	ktime_t busy_time;
24	ktime_t idle_time;
25	ktime_t time_last_update;
26	int busy_count;
27	/*
28	 * Protect busy_time, idle_time, time_last_update and busy_count
29	 * because these can be updated concurrently, for example by the GP
30	 * and PP interrupts.
31	 */
32	spinlock_t lock;
33};
34
35int lima_devfreq_init(struct lima_device *ldev);
36void lima_devfreq_fini(struct lima_device *ldev);
37
38void lima_devfreq_record_busy(struct lima_devfreq *devfreq);
39void lima_devfreq_record_idle(struct lima_devfreq *devfreq);
40
41int lima_devfreq_resume(struct lima_devfreq *devfreq);
42int lima_devfreq_suspend(struct lima_devfreq *devfreq);
43
44#endif
v6.2
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright 2020 Martin Blumenstingl <martin.blumenstingl@googlemail.com> */
 3
 4#ifndef __LIMA_DEVFREQ_H__
 5#define __LIMA_DEVFREQ_H__
 6
 7#include <linux/devfreq.h>
 8#include <linux/spinlock.h>
 9#include <linux/ktime.h>
10
11struct devfreq;
 
12struct thermal_cooling_device;
13
14struct lima_device;
15
16struct lima_devfreq {
17	struct devfreq *devfreq;
 
 
18	struct thermal_cooling_device *cooling;
19	struct devfreq_simple_ondemand_data gov_data;
20
21	ktime_t busy_time;
22	ktime_t idle_time;
23	ktime_t time_last_update;
24	int busy_count;
25	/*
26	 * Protect busy_time, idle_time, time_last_update and busy_count
27	 * because these can be updated concurrently, for example by the GP
28	 * and PP interrupts.
29	 */
30	spinlock_t lock;
31};
32
33int lima_devfreq_init(struct lima_device *ldev);
34void lima_devfreq_fini(struct lima_device *ldev);
35
36void lima_devfreq_record_busy(struct lima_devfreq *devfreq);
37void lima_devfreq_record_idle(struct lima_devfreq *devfreq);
38
39int lima_devfreq_resume(struct lima_devfreq *devfreq);
40int lima_devfreq_suspend(struct lima_devfreq *devfreq);
41
42#endif