MT2523 API Reference  LinkIt SDK v4
hal_dvfs.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __HAL_DVFS_H__
36 #define __HAL_DVFS_H__
37 
38 #include "hal_platform.h"
39 
40 #ifdef HAL_DVFS_MODULE_ENABLED
41 
84 /*****************************************************************************
85 * Enum
86 *****************************************************************************/
91 typedef enum {
99 
101 typedef enum {
105 
110 /*****************************************************************************
111 * extern global function
112 *****************************************************************************/
119 
137 
142 uint32_t hal_dvfs_get_cpu_frequency(void);
143 
151 hal_dvfs_status_t hal_dvfs_get_cpu_frequency_list(const uint32_t **list, uint32_t *list_num);
152 
158 #endif /* HAL_DVFS_MODULE_ENABLED */
159 
160 #endif /* __HAL_DVFS_H__ */
The DVFS function executed successfully.
Definition: hal_dvfs.h:97
hal_dvfs_freq_relation_t
This enum defines the relationship between the target frequency and the final frequency.
Definition: hal_dvfs.h:101
hal_dvfs_status_t hal_dvfs_target_cpu_frequency(uint32_t target_freq, hal_dvfs_freq_relation_t relation)
This function adjusts the CPU frequency to a suitable target frequency according to the passed-in rel...
Non-initialized.
Definition: hal_dvfs.h:94
The operation is not permitted.
Definition: hal_dvfs.h:92
Device or resource is busy.
Definition: hal_dvfs.h:93
hal_dvfs_status_t hal_dvfs_init(void)
The function initializes the DVFS framework.
The DVFS function detected a common error.
Definition: hal_dvfs.h:96
The lowest frequency at or above the target level.
Definition: hal_dvfs.h:102
hal_dvfs_status_t
This enum defines return status of certain DVFS HAL APIs.
Definition: hal_dvfs.h:91
uint32_t hal_dvfs_get_cpu_frequency(void)
This function gets the current CPU frequency.
The highest frequency below or at the target level.
Definition: hal_dvfs.h:103
hal_dvfs_status_t hal_dvfs_get_cpu_frequency_list(const uint32_t **list, uint32_t *list_num)
This function gets all adjustable CPU frequencies listed in the OPP table.
Invalid parameter value.
Definition: hal_dvfs.h:95