tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / mali / platform / exynos4 / exynos4.h
1 /*
2  * Mali400 platform glue for Samsung Exynos 4 SoCs
3  *
4  * Copyright 2013 by Samsung Electronics Co., Ltd.
5  * Author: Tomasz Figa <t.figa@samsung.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software FoundatIon.
10  */
11
12 #ifndef __EXYNOS4_H__
13 #define __EXYNOS4_H__
14
15 #include "mali_osk.h"
16
17 /** @brief description of power change reasons
18  */
19 typedef enum mali_power_mode_tag
20 {
21         MALI_POWER_MODE_ON,
22         MALI_POWER_MODE_LIGHT_SLEEP,
23         MALI_POWER_MODE_DEEP_SLEEP,
24 } mali_power_mode;
25
26 /** @brief Platform specific setup and initialisation of MALI
27  *
28  * This is called from the entrypoint of the driver to initialize the platform
29  *
30  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
31  */
32 _mali_osk_errcode_t mali_platform_init(void);
33
34 /** @brief Platform specific deinitialisation of MALI
35  *
36  * This is called on the exit of the driver to terminate the platform
37  *
38  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
39  */
40 _mali_osk_errcode_t mali_platform_deinit(void);
41
42 /** @brief Platform specific powerdown sequence of MALI
43  *
44  * Call as part of platform init if there is no PMM support, else the
45  * PMM will call it.
46  * There are three power modes defined:
47  *  1) MALI_POWER_MODE_ON
48  *  2) MALI_POWER_MODE_LIGHT_SLEEP
49  *  3) MALI_POWER_MODE_DEEP_SLEEP
50  * MALI power management module transitions to MALI_POWER_MODE_LIGHT_SLEEP mode when MALI is idle
51  * for idle timer (software timer defined in mali_pmm_policy_jobcontrol.h) duration, MALI transitions
52  * to MALI_POWER_MODE_LIGHT_SLEEP mode during timeout if there are no more jobs queued.
53  * MALI power management module transitions to MALI_POWER_MODE_DEEP_SLEEP mode when OS does system power
54  * off.
55  * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP
56  * mode.
57  * MALI_POWER_MODE_ON mode is entered when the MALI is to powered up. Some customers want to control voltage regulators during
58  * the whole system powers on/off. Customer can track in this function whether the MALI is powered up from
59  * MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP mode and manage the voltage regulators as well.
60  * @param power_mode defines the power modes
61  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
62  */
63 _mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode);
64
65 /** @brief Platform specific handling of GPU utilization data
66  *
67  * When GPU utilization data is enabled, this function will be
68  * periodically called.
69  *
70  * @param utilization The workload utilization of the Mali GPU. 0 = no utilization, 256 = full utilization.
71  */
72 void mali_gpu_utilization_handler(unsigned int utilization);
73
74 /** @brief Platform specific power management initialization
75  *
76  * Initializes platform-specific part of power management.
77  */
78 _mali_osk_errcode_t exynos_pmm_init(void);
79
80 /** @brief Platform specific power management deinitialization
81  *
82  * Deinitializes platform-specific part of power management.
83  */
84 _mali_osk_errcode_t exynos_pmm_deinit(void);
85
86 extern const struct of_device_id mali_of_matches[];
87
88 #endif