blob: 0254248babd864303ed4bca6b9283b8e08dcc5d0 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2005
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * dcl_f32k_clk.h
41 *
42 * Project:
43 * --------
44 * Maui_sw
45 *
46 * Description:
47 * ------------
48 * This file defines the DCL common definitions for f32k_clk dcl interface.
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 * removed!
60 * removed!
61 *
62 * removed!
63 * removed!
64 * removed!
65 *
66 * removed!
67 * removed!
68 * removed!
69 *
70 * removed!
71 * removed!
72 * removed!
73 *
74 * removed!
75 * removed!
76 * removed!
77 *
78 * removed!
79 * removed!
80 * removed!
81 *
82 * removed!
83 * removed!
84 * removed!
85 *
86 * removed!
87 * removed!
88 * removed!
89 *
90 *------------------------------------------------------------------------------
91 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
92 *============================================================================
93 ****************************************************************************/
94
95#ifdef DCL_DEFINITION_STRUCT
96#ifndef __DCL_F32K_CLK_H_STRUCT__
97#define __DCL_F32K_CLK_H_STRUCT__
98
99#include "dcl.h"
100
101/*******************************************************************************
102 * DCL_OPTIONS for F32K_CLK
103 *******************************************************************************/
104#define F32K_CLK_OPTIONS
105
106 /*******************************************************************************
107 * DCL_CONFIGURE_T for F32K_CLK
108 *******************************************************************************/
109#define F32K_CLK_CONFIGS
110
111/*******************************************************************************
112 * DCL_EVENT for F32K_CLK
113 *******************************************************************************/
114#define F32K_CLK_EVENTS
115
116/*******************************************************************************
117 * DCL_CTRL_DATA_T: Define the Control data structure for each module's command
118 *******************************************************************************/
119
120typedef struct
121{
122 DCL_BOOLEAN f32k_is_xosc32;
123}F32K_CLK_CTRL_F32K_IS_XOSC32_T;
124
125typedef struct
126{
127 DCL_UINT16 eosc32_cali_val;
128}F32K_CLK_CTRL_EOSC32_CALI_VAL_T;
129
130#ifdef __BUILD_DOM__
131/* The F32K_CLK Command Parameter Data Structure for Each Command in DCL_CTRL_DATA_T Enum of dcl.h */
132typedef struct
133{
134 F32K_CLK_CTRL_F32K_IS_XOSC32_T rF32kIsXOSC32; /* Data structure for F32K_CLK_CTRL_F32K_IS_XOSC32 */
135 F32K_CLK_CTRL_EOSC32_CALI_VAL_T rEosc32CaliVal;
136}DCL_CTRL_F32K_CLK_DATA_T;
137#else /* __BUILD_DOM__ */
138#define F32K_CLK_CTRLS \
139 F32K_CLK_CTRL_F32K_IS_XOSC32_T rF32kIsXOSC32; \
140 F32K_CLK_CTRL_EOSC32_CALI_VAL_T rEosc32CaliVal;
141#endif /* __BUILD_DOM__ */
142
143/*******************************************************************************
144 * DCL_CTRL_CMD for F32K_CLK
145 *******************************************************************************/
146#ifdef __BUILD_DOM__
147/* The F32K_CLK Command Values in DCL_CTRL_CMD_T Enum of dcl.h */
148typedef enum {
149 F32K_CLK_CMD_QUERY_IS_XOSC32K, /* To query F32K is XOSC32K or not */
150 F32K_CLK_CMD_EOSC32_TRIMMING, /* To trimming EOSC32 and get ideal cali value */
151 F32K_CLK_CMD_HW_INIT, /* To init 32K HW setting */
152} DCL_CTRL_F32K_CLK_CMD_T;
153#else /* __BUILD_DOM__ */
154#define F32K_CLK_CMDS \
155 F32K_CLK_CMD_QUERY_IS_XOSC32K, \
156 F32K_CLK_CMD_EOSC32_TRIMMING, \
157 F32K_CLK_CMD_HW_INIT,
158#endif /* __BUILD_DOM__ */
159
160
161#endif // #ifndef __DCL_F32K_CLK_H_STRUCT__
162#endif // #ifdef DCL_DEFINITION_STRUCT
163
164#ifdef DCL_DEFINITION_PROTOTYPE
165#ifndef __DCL_F32K_CLK_H_PROTOTYPE__
166#define __DCL_F32K_CLK_H_PROTOTYPE__
167/*************************************************************************
168* FUNCTION
169* DclF32K_Initialize
170*
171* DESCRIPTION
172* This function is to initialize F32K_CLK module
173*
174* PARAMETERS
175* None
176*
177* RETURNS
178* Return the status of DclF32K_Initialize
179*
180* RETURN VALUES
181* STATUS_OK: Initialize Finished
182*
183*************************************************************************/
184extern DCL_STATUS DclF32K_Initialize(void);
185/*************************************************************************
186* FUNCTION
187* DclF32K_Open
188*
189* DESCRIPTION
190* This function is to open the F32K_CLK module and return a handle
191*
192* PARAMETERS
193* dev: [IN] Only valid for DCL_F32K_CLK
194* flags: [IN] No sepcial flags is needed. Please use FLAGS_NONE
195*
196* RETURNS
197* Return DCL_HANDLE of F32K_CLK
198*
199* RETURN VALUES
200* DCL_HANDLE_INVALID : Open failed
201* Other value : A valid handle
202*
203*************************************************************************/
204extern DCL_HANDLE DclF32K_Open(DCL_DEV dev, DCL_FLAGS flags);
205/*************************************************************************
206* FUNCTION
207* DclF32K_Control
208*
209* DESCRIPTION
210* This function is to send command to control the F32K_CLK module.
211*
212* PARAMETERS
213* handle: [IN] The handle value returned from DclF32K_Open
214* cmd: [IN] A control command for RTC module
215* 1. F32K_CLK_CMD_QUERY_IS_XOSC32K: To query clock source F32K is XOSC32K or not
216*
217* data: The data of the control command
218* 1. F32K_CLK_CMD_QUERY_IS_XOSC32K: pointer to a F32K_CLK_CTRL_F32K_IS_XOSC32_T structure
219*
220* RETURNS
221* Return the status of DclF32K_Control
222*
223* RETURN VALUES
224* STATUS_OK: Command is executed successfully.
225* STATUS_FAIL: Command is failed.
226* STATUS_INVALID_CMD: It's a invalid command.
227*
228*************************************************************************/
229extern DCL_STATUS DclF32K_Control(DCL_HANDLE handle, DCL_CTRL_CMD cmd, DCL_CTRL_DATA_T *data);
230/*************************************************************************
231* FUNCTION
232* DclF32K_Close
233*
234* DESCRIPTION
235* This function is to close the F32K_CLK module.
236*
237* PARAMETERS
238* handle: [IN] The returned handle value of DclF32K_Open
239*
240* RETURNS
241* Return the status of DclF32K_Close
242*
243* RETURN VALUES
244* STATUS_OK
245*
246*************************************************************************/
247extern DCL_STATUS DclF32K_Close(DCL_HANDLE handle);
248
249#endif // #ifndef __DCL_F32K_CLK_H_PROTOTYPE__
250#endif // #ifdef DCL_DEFINITION_PROTOTYPE
251