2 * Mali400 platform glue for Samsung Exynos 4 SoCs
4 * Copyright 2013 by Samsung Electronics Co., Ltd.
5 * Author: Tomasz Figa <t.figa@samsung.com>
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.
17 /** @brief description of power change reasons
19 typedef enum mali_power_mode_tag
22 MALI_POWER_MODE_LIGHT_SLEEP,
23 MALI_POWER_MODE_DEEP_SLEEP,
26 /** @brief Platform specific setup and initialisation of MALI
28 * This is called from the entrypoint of the driver to initialize the platform
30 * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
32 _mali_osk_errcode_t mali_platform_init(void);
34 /** @brief Platform specific deinitialisation of MALI
36 * This is called on the exit of the driver to terminate the platform
38 * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
40 _mali_osk_errcode_t mali_platform_deinit(void);
42 /** @brief Platform specific powerdown sequence of MALI
44 * Call as part of platform init if there is no PMM support, else the
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
55 * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP
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.
63 _mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode);
65 /** @brief Platform specific handling of GPU utilization data
67 * When GPU utilization data is enabled, this function will be
68 * periodically called.
70 * @param utilization The workload utilization of the Mali GPU. 0 = no utilization, 256 = full utilization.
72 void mali_gpu_utilization_handler(unsigned int utilization);
74 /** @brief Platform specific power management initialization
76 * Initializes platform-specific part of power management.
78 _mali_osk_errcode_t exynos_pmm_init(void);
80 /** @brief Platform specific power management deinitialization
82 * Deinitializes platform-specific part of power management.
84 _mali_osk_errcode_t exynos_pmm_deinit(void);
86 extern const struct of_device_id mali_of_matches[];