1 /* drivers/gpu/mali400/mali/platform/exynos3470/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__
21 #include "mali_utgard.h"
28 /** @brief description of power change reasons
30 typedef enum mali_power_mode_tag
33 MALI_POWER_MODE_LIGHT_SLEEP,
34 MALI_POWER_MODE_DEEP_SLEEP,
37 /** @brief Platform specific setup and initialisation of MALI
39 * This is called from the entrypoint of the driver to initialize the platform
41 * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
43 _mali_osk_errcode_t mali_platform_init(struct device *dev);
45 /** @brief Platform specific deinitialisation of MALI
47 * This is called on the exit of the driver to terminate the platform
49 * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
51 _mali_osk_errcode_t mali_platform_deinit(struct device *dev);
53 /** @brief Platform specific powerdown sequence of MALI
55 * Call as part of platform init if there is no PMM support, else the
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
66 * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP
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.
74 _mali_osk_errcode_t mali_platform_power_mode_change(struct device *dev, mali_power_mode power_mode);
77 /** @brief Platform specific handling of GPU utilization data
79 * When GPU utilization data is enabled, this function will be
80 * periodically called.
82 * @param utilization The workload utilization of the Mali GPU. 0 = no utilization, 256 = full utilization.
84 void mali_gpu_utilization_handler(struct mali_gpu_utilization_data *data);
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 extern int mali_dvfs_level_lock(void);
90 extern int mali_dvfs_level_unlock(void);