5f522971aa4c363ab93e64276edae62c56f06997
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard / platform / rk / mali_kbase_config_rk.c
1 /*
2  *
3  * (C) COPYRIGHT 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
11 #define ENABLE_DEBUG_LOG
12 #include "custom_log.h"
13
14 #include <mali_kbase.h>
15 #include <mali_kbase_defs.h>
16 #include <mali_kbase_config.h>
17
18 #include <linux/pm_runtime.h>
19 #include <linux/suspend.h>
20
21 /**
22  * @file mali_kbase_config_rk.c
23  * 对 platform_config_of_rk 的具体实现.
24  *
25  * mali_device_driver 包含两部分 :
26  *      .DP : platform_dependent_part_in_mdd :
27  *              依赖 platform 部分,
28  *              源码在 <mdd_src_dir>/platform/<platform_name>/
29  *              在 mali_device_driver 内部,
30  *                      记为 platform_dependent_part,
31  *                      也被记为 platform_specific_code.
32  *      .DP : common_parts_in_mdd :
33  *              arm 实现的通用的部分,
34  *              源码在 <mdd_src_dir>/ 下.
35  *              在 mali_device_driver 内部, 记为 common_parts.
36  */
37
38 /*---------------------------------------------------------------------------*/
39
40 int kbase_platform_rk_init(struct kbase_device *kbdev)
41 {
42         return 0;
43 }
44
45 void kbase_platform_rk_term(struct kbase_device *kbdev)
46 {
47 }
48
49 struct kbase_platform_funcs_conf platform_funcs = {
50         .platform_init_func = &kbase_platform_rk_init,
51         .platform_term_func = &kbase_platform_rk_term,
52 };
53
54 /*---------------------------------------------------------------------------*/
55
56 static int pm_callback_power_on(struct kbase_device *kbdev)
57 {
58         return 0;
59 }
60
61 static void pm_callback_power_off(struct kbase_device *kbdev)
62 {
63 }
64
65 int kbase_device_runtime_init(struct kbase_device *kbdev)
66 {
67         return 0;
68 }
69
70 void kbase_device_runtime_disable(struct kbase_device *kbdev)
71 {
72 }
73
74 static int pm_callback_runtime_on(struct kbase_device *kbdev)
75 {
76         return 0;
77 }
78
79 static void pm_callback_runtime_off(struct kbase_device *kbdev)
80 {
81 }
82
83 struct kbase_pm_callback_conf pm_callbacks = {
84         .power_on_callback =  pm_callback_power_on,
85         .power_off_callback = pm_callback_power_off,
86 #ifdef CONFIG_PM
87         .power_runtime_init_callback = kbase_device_runtime_init,
88         .power_runtime_term_callback = kbase_device_runtime_disable,
89         .power_runtime_on_callback = pm_callback_runtime_on,
90         .power_runtime_off_callback = pm_callback_runtime_off,
91 #else                           /* CONFIG_PM */
92         .power_runtime_init_callback = NULL,
93         .power_runtime_term_callback = NULL,
94         .power_runtime_on_callback = NULL,
95         .power_runtime_off_callback = NULL,
96
97 #endif                          /* CONFIG_PM */
98 };
99
100 int kbase_platform_early_init(void)
101 {
102         /* Nothing needed at this stage */
103         return 0;
104 }
105