1 /* drivers/gpu/mali400/mali/platform/pegasus-m400/exynos4_pmm.h
3 * Copyright 2011 by S.LSI. Samsung Electronics Inc.
4 * San#24, Nongseo-Dong, Giheung-Gu, Yongin, Korea
6 * Samsung SoC Mali400 DVFS driver
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.
15 * Platform specific Mali driver functions for the exynos 4XXX based platforms
18 #ifndef __EXYNOS4_PMM_H__
19 #define __EXYNOS4_PMM_H__
27 /** @brief description of power change reasons
29 typedef enum mali_power_mode_tag
32 MALI_POWER_MODE_LIGHT_SLEEP,
33 MALI_POWER_MODE_DEEP_SLEEP,
36 /** @brief Platform specific setup and initialisation of MALI
38 * This is called from the entrypoint of the driver to initialize the platform
40 * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
42 _mali_osk_errcode_t mali_platform_init(void);
44 /** @brief Platform specific deinitialisation of MALI
46 * This is called on the exit of the driver to terminate the platform
48 * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
50 _mali_osk_errcode_t mali_platform_deinit(void);
52 /** @brief Platform specific powerdown sequence of MALI
54 * Call as part of platform init if there is no PMM support, else the
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
65 * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP
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.
73 _mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode);
76 /** @brief Platform specific handling of GPU utilization data
78 * When GPU utilization data is enabled, this function will be
79 * periodically called.
81 * @param utilization The workload utilization of the Mali GPU. 0 = no utilization, 256 = full utilization.
83 void mali_gpu_utilization_handler(unsigned int utilization);
85 _mali_osk_errcode_t g3d_power_domain_control(int bpower_on);
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);