gpu midgard : add pd_gpu support
[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 *clk_mali;
23         struct clk *mali_pd;
24 #if 1
25         struct clk * mali_pd_node;
26         struct dvfs_node * mali_clk_node;
27 #endif
28 #ifdef CONFIG_MALI_MIDGARD_DVFS
29         /*To calculate utilization for x sec */
30         int time_tick;
31         int utilisation;
32         u32 time_busy;
33         u32 time_idle;
34         bool dvfs_enabled;
35 #endif
36 };
37 int mali_dvfs_clk_set(struct dvfs_node * node,unsigned long rate);
38
39 /* All things that are needed for the Linux port. */
40 int kbase_platform_cmu_pmu_control(struct kbase_device *kbdev, int control);
41 int kbase_platform_create_sysfs_file(struct device *dev);
42 void kbase_platform_remove_sysfs_file(struct device *dev);
43 int kbase_platform_is_power_on(void);
44 mali_error kbase_platform_init(struct kbase_device *kbdev);
45 void kbase_platform_term(kbase_device *kbdev);
46
47 int kbase_platform_clock_on(struct kbase_device *kbdev);
48 int kbase_platform_clock_off(struct kbase_device *kbdev);
49 int kbase_platform_power_off(struct kbase_device *kbdev);
50 int kbase_platform_power_on(struct kbase_device *kbdev);
51
52 #endif                          /* _KBASE_PLATFORM_H_ */