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