tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / r4p0_rel0 / platform / exynos4415 / exynos4_pmm.h
1 /* drivers/gpu/mali400/mali/platform/exynos4415/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_utgard.h"
22 #include "mali_osk.h"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /** @brief description of power change reasons
29  */
30 typedef enum mali_power_mode_tag
31 {
32         MALI_POWER_MODE_ON,
33         MALI_POWER_MODE_LIGHT_SLEEP,
34         MALI_POWER_MODE_DEEP_SLEEP,
35 } mali_power_mode;
36
37 /** @brief Platform specific setup and initialisation of MALI
38  *
39  * This is called from the entrypoint of the driver to initialize the platform
40  *
41  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
42  */
43 _mali_osk_errcode_t mali_platform_init(struct device *dev);
44
45 /** @brief Platform specific deinitialisation of MALI
46  *
47  * This is called on the exit of the driver to terminate the platform
48  *
49  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
50  */
51 _mali_osk_errcode_t mali_platform_deinit(struct device *dev);
52
53 /** @brief Platform specific powerdown sequence of MALI
54  *
55  * Call as part of platform init if there is no PMM support, else the
56  * PMM will call it.
57  * There are three power modes defined:
58  *  1) MALI_POWER_MODE_ON
59  *  2) MALI_POWER_MODE_LIGHT_SLEEP
60  *  3) MALI_POWER_MODE_DEEP_SLEEP
61  * MALI power management module transitions to MALI_POWER_MODE_LIGHT_SLEEP mode when MALI is idle
62  * for idle timer (software timer defined in mali_pmm_policy_jobcontrol.h) duration, MALI transitions
63  * to MALI_POWER_MODE_LIGHT_SLEEP mode during timeout if there are no more jobs queued.
64  * MALI power management module transitions to MALI_POWER_MODE_DEEP_SLEEP mode when OS does system power
65  * off.
66  * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP
67  * mode.
68  * MALI_POWER_MODE_ON mode is entered when the MALI is to powered up. Some customers want to control voltage regulators during
69  * the whole system powers on/off. Customer can track in this function whether the MALI is powered up from
70  * MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP mode and manage the voltage regulators as well.
71  * @param power_mode defines the power modes
72  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
73  */
74 _mali_osk_errcode_t mali_platform_power_mode_change(struct device *dev, mali_power_mode power_mode);
75
76
77 /** @brief Platform specific handling of GPU utilization data
78  *
79  * When GPU utilization data is enabled, this function will be
80  * periodically called.
81  *
82  * @param utilization The workload utilization of the Mali GPU. 0 = no utilization, 256 = full utilization.
83  */
84 void mali_gpu_utilization_handler(struct mali_gpu_utilization_data *data);
85
86 #ifdef CONFIG_MALI_DVFS
87 ssize_t show_time_in_state(struct device *dev, struct device_attribute *attr, char *buf);
88 ssize_t set_time_in_state(struct device *dev, struct device_attribute *attr, const char *buf, size_t count);
89 #endif
90 #ifdef __cplusplus
91 }
92 #endif
93 #endif