tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / mali / platform / redwood / exynos4_pmm.h
1 /* drivers/gpu/mali400/mali/platform/pegasus-m400/exynos4_pmm.h
2  *
3  * Copyright 2011 by S.LSI. Samsung Electronics Inc.
4  * San#24, Nongseo-Dong, Giheung-Gu, Yongin, Korea
5  *
6  * Samsung SoC Mali400 DVFS driver
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 exynos4_pmm.h
15  * Platform specific Mali driver functions for the exynos 4XXX based platforms
16  */
17
18 #ifndef __EXYNOS4_PMM_H__
19 #define __EXYNOS4_PMM_H__
20
21 #include "mali_osk.h"
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /** @brief description of power change reasons
28  */
29 typedef enum mali_power_mode_tag
30 {
31         MALI_POWER_MODE_ON,
32         MALI_POWER_MODE_LIGHT_SLEEP,
33         MALI_POWER_MODE_DEEP_SLEEP,
34 } mali_power_mode;
35
36 /** @brief Platform specific setup and initialisation of MALI
37  *
38  * This is called from the entrypoint of the driver to initialize the platform
39  *
40  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
41  */
42 _mali_osk_errcode_t mali_platform_init(void);
43
44 /** @brief Platform specific deinitialisation of MALI
45  *
46  * This is called on the exit of the driver to terminate the platform
47  *
48  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
49  */
50 _mali_osk_errcode_t mali_platform_deinit(void);
51
52 /** @brief Platform specific powerdown sequence of MALI
53  *
54  * Call as part of platform init if there is no PMM support, else the
55  * PMM will call it.
56  * There are three power modes defined:
57  *  1) MALI_POWER_MODE_ON
58  *  2) MALI_POWER_MODE_LIGHT_SLEEP
59  *  3) MALI_POWER_MODE_DEEP_SLEEP
60  * MALI power management module transitions to MALI_POWER_MODE_LIGHT_SLEEP mode when MALI is idle
61  * for idle timer (software timer defined in mali_pmm_policy_jobcontrol.h) duration, MALI transitions
62  * to MALI_POWER_MODE_LIGHT_SLEEP mode during timeout if there are no more jobs queued.
63  * MALI power management module transitions to MALI_POWER_MODE_DEEP_SLEEP mode when OS does system power
64  * off.
65  * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP
66  * mode.
67  * MALI_POWER_MODE_ON mode is entered when the MALI is to powered up. Some customers want to control voltage regulators during
68  * the whole system powers on/off. Customer can track in this function whether the MALI is powered up from
69  * MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP mode and manage the voltage regulators as well.
70  * @param power_mode defines the power modes
71  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
72  */
73 _mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode);
74
75
76 /** @brief Platform specific handling of GPU utilization data
77  *
78  * When GPU utilization data is enabled, this function will be
79  * periodically called.
80  *
81  * @param utilization The workload utilization of the Mali GPU. 0 = no utilization, 256 = full utilization.
82  */
83 void mali_gpu_utilization_handler(unsigned int utilization);
84
85 _mali_osk_errcode_t g3d_power_domain_control(int bpower_on);
86
87 #ifdef CONFIG_REGULATOR
88 void mali_regulator_disable(void);
89 void mali_regulator_enable(void);
90 void mali_regulator_set_voltage(int min_uV, int max_uV);
91 #endif
92
93 #ifdef __cplusplus
94 }
95 #endif
96 #endif