rockchip:midgard:1,update gpu version to r4p1-00rel0 2,add input handler when runtim...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard / platform / rk / mali_kbase_platform.h
1 /* drivers/gpu/t6xx/kbase/src/platform/rk/mali_kbase_platform.h
2  * Rockchip SoC Mali-T764 platform-dependent codes
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software FoundatIon.
7  */
8
9 /**
10  * @file mali_kbase_platform.h
11  * Platform-dependent init
12  */
13
14 #ifndef _KBASE_PLATFORM_H_
15 #define _KBASE_PLATFORM_H_
16
17 struct rk_context {
18         /** Indicator if system clock to mail-t604 is active */
19         int cmu_pmu_status;
20         /** cmd & pmu lock */
21         spinlock_t cmu_pmu_lock;
22         struct clk *mali_pd;
23         struct dvfs_node * mali_clk_node;
24 #ifdef CONFIG_MALI_MIDGARD_DVFS
25         /*To calculate utilization for x sec */
26         int time_tick;
27         int utilisation;
28         u32 time_busy;
29         u32 time_idle;
30         bool dvfs_enabled;
31         bool gpu_in_touch;
32         spinlock_t gpu_in_touch_lock;
33 #endif
34 };
35 int mali_dvfs_clk_set(struct dvfs_node * node,unsigned long rate);
36
37 /* All things that are needed for the Linux port. */
38 int kbase_platform_cmu_pmu_control(struct kbase_device *kbdev, int control);
39 int kbase_platform_create_sysfs_file(struct device *dev);
40 void kbase_platform_remove_sysfs_file(struct device *dev);
41 int kbase_platform_is_power_on(void);
42 mali_error kbase_platform_init(struct kbase_device *kbdev);
43 void kbase_platform_term(kbase_device *kbdev);
44
45 int kbase_platform_clock_on(struct kbase_device *kbdev);
46 int kbase_platform_clock_off(struct kbase_device *kbdev);
47 int kbase_platform_power_off(struct kbase_device *kbdev);
48 int kbase_platform_power_on(struct kbase_device *kbdev);
49
50 #endif                          /* _KBASE_PLATFORM_H_ */