import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / gpu / mt8127 / mali / mali / linux / mali_pmu_power_up_down.c
1 /**
2 * This confidential and proprietary software may be used only as
3 * authorised by a licensing agreement from ARM Limited
4 * (C) COPYRIGHT 2010, 2012-2013 ARM Limited
5 * ALL RIGHTS RESERVED
6 * The entire notice above must be reproduced on all authorised
7 * copies and copies may only be made to the extent permitted
8 * by a licensing agreement from ARM Limited.
9 */
10
11 /**
12 * @file mali_pmu_power_up_down.c
13 */
14
15 #include <linux/version.h>
16 #include <linux/sched.h>
17 #include <linux/module.h>
18 #include "mali_osk.h"
19 #include "mali_kernel_common.h"
20 #include "mali_pmu.h"
21 #include "mali_pp_scheduler.h"
22 #include "linux/mali/mali_utgard.h"
23
24 /* Mali PMU power up/down APIs */
25
26 int mali_pmu_powerup(void)
27 {
28 struct mali_pmu_core *pmu = mali_pmu_get_global_pmu_core();
29
30 MALI_DEBUG_PRINT(5, ("Mali PMU: Power up\n"));
31
32 MALI_DEBUG_ASSERT_POINTER(pmu);
33 if (NULL == pmu) {
34 return -ENXIO;
35 }
36
37 if (_MALI_OSK_ERR_OK != mali_pmu_power_up_all(pmu)) {
38 return -EFAULT;
39 }
40
41 return 0;
42 }
43
44 EXPORT_SYMBOL(mali_pmu_powerup);
45
46 int mali_pmu_powerdown(void)
47 {
48 struct mali_pmu_core *pmu = mali_pmu_get_global_pmu_core();
49
50 MALI_DEBUG_PRINT(5, ("Mali PMU: Power down\n"));
51
52 MALI_DEBUG_ASSERT_POINTER(pmu);
53 if (NULL == pmu) {
54 return -ENXIO;
55 }
56
57 if (_MALI_OSK_ERR_OK != mali_pmu_power_down_all(pmu)) {
58 return -EFAULT;
59 }
60
61 return 0;
62 }
63
64 EXPORT_SYMBOL(mali_pmu_powerdown);
65
66 int mali_perf_set_num_pp_cores(unsigned int num_cores)
67 {
68 return mali_pp_scheduler_set_perf_level(num_cores, MALI_FALSE);
69 }
70
71 EXPORT_SYMBOL(mali_perf_set_num_pp_cores);