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