17eede4d917c0a72e1c800daa8da0e61d8393cb5
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard_for_linux / backend / gpu / mali_kbase_power_model_simple.h
1 /*
2  *
3  * (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15
16
17
18 #ifndef _BASE_POWER_MODEL_SIMPLE_H_
19 #define _BASE_POWER_MODEL_SIMPLE_H_
20
21 /**
22  * kbase_power_model_simple_init - Initialise the simple power model
23  * @kbdev: Device pointer
24  *
25  * The simple power model estimates power based on current voltage, temperature,
26  * and coefficients read from device tree. It does not take utilization into
27  * account.
28  *
29  * The power model requires coefficients from the power_model node in device
30  * tree. The absence of this node will prevent the model from functioning, but
31  * should not prevent the rest of the driver from running.
32  *
33  * Return: 0 on success
34  *         -ENOSYS if the power_model node is not present in device tree
35  *         -EPROBE_DEFER if the thermal zone specified in device tree is not
36  *         currently available
37  *         Any other negative value on failure
38  */
39 int kbase_power_model_simple_init(struct kbase_device *kbdev);
40
41 extern struct devfreq_cooling_power power_model_simple_ops;
42
43 #endif /* _BASE_POWER_MODEL_SIMPLE_H_ */