lcd_power_mgr.h
9.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2001-2007
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* lcd_power_ctrl.h
*
* Project:
* --------
* Maui
*
* Description:
* ------------
* LCD Power Control Interface.
*
* Author:
* -------
* -------
*
*------------------------------------------------------------------------------
* $Log$
*
* 08 02 2011 bin.han
* removed!
* .
*
* 06 23 2011 bin.han
* removed!
* .
*
* 03 30 2011 chelun.tsai
* removed!
* lcd_if_hw.h move to HAL.
*
* 02 10 2011 chelun.tsai
* removed!
* modify drv_features.h include.
*
* 12 06 2010 sophie.chen
* removed!
* .
*
* 12 03 2010 chelun.tsai
* removed!
* move kcd if & power manager headers to mcu\interface.
*
* 11 23 2010 sophie.chen
* removed!
* .
*
* 11 15 2010 sophie.chen
* removed!
* .
*
*******************************************************************************/
#ifndef __LCD_PWR_CTRL_H__
#define __LCD_PWR_CTRL_H__
#include "kal_release.h"
/*! \mainpage LCD Power Control Interface
* @author Sophie Chen
* @version 1.0
* @date 2010/08/03
*
* \section Introduction
*
* This document is an introduction of LCD Power Control Interface. \n
* For MT6268/MT6236, WIFI and TD will use LCD HW to generate NFI waveforms to
* access external modules, meaning WIFI/TD/LCD will share LCD power/clock and data bus. \n
* We create this module to control LCD power for LCD/TD/WIFI SW driver to avoid fatal race condition.\n
* Arbitration of data bus will be handled by LCD HW.\n
*
* This module takes only power on/off request into considerations.\n
* No control state of LCD/TD/WIFI is concerned in this module, which
* shall be handled in relative module driver.\n
* EX: If moduleA turns on LCD power on Task level, and then power off in ISR level.\n
* Then module A shall handle the race condition by itself.\n\n
*
*
* Turn_on Power (Task) --> Turn_off Power (ISR) --> Access Register\n\n\n
*
*
*
*
* Before calling API to request turning on/off LCD power, You SHALL
* register your module to LCD Power Control first.\n
* Each module registers itself ONLY ONCE.\n
* No deregister API is supported, thus the caller shall keep the Handle value in its driver
* when registering.\n
*
*
* The header file is in \\mcu\\drv\\include\\lcd_power_ctrl.h\n\n
*
* The API is supported after W10.33 for ASTRO36E2_DEV branch. \n\n\n\n\n
*
*
*
*
*
* \section History
*
*
* @date 2010/08/04\n
* 1. Remove IOCTRL ID: LCD_POWER_IOCTRL__QRY_INIT_STATUS\n
* 2. Modify LCD_POWER_CTRL__IF_TIMING_STRUCT: add more necessary feilds to set IF timing.\n
* 3. Add an example to illustracte how to use LCD_POWER_IOCTRL__SET_IF_TIMING_VAL to set HW IF register.\n\n\n
*
*
*
*
*
*
*
*
*/
/// The enum LCD_POWER_IOCTRL_ID_ENUM defines io-control ID for user when calling IOCTRL
typedef enum
{
LCD_POWER_IOCTRL__QRY_INIT_STATUS = 0,
/*!< LCD_POWER_IOCTRL__QRY_INIT_STATUS: Query if LCD Power control layer has been initialized\n
* param in_val: NA\n
* param out_val: NA\n
* return: TRUE if LCD Power control layer has been initialized\n\n\n
*/
LCD_POWER_IOCTRL__QRY_CLK_STATUS,
/*!< LCD_POWER_IOCTRL__QRY_CLK_STATUS: Query if LCD clock has been turn on\n
* param in_val: NA\n
* param out_val: NA\n
* return: TRUE if LCD clock has been on\n\n\n
*/
LCD_POWER_IOCTRL__SET_IF_TIMING_VAL,
/*!< LCD_POWER_IOCTRL__SET_IF_TIMING_VAL: Set LCD parellel/serial numberN interface timing\n
* param in_val: LCD_POWER_CTRL__IF_TIMING_STRUCT*\n
* param out_val: NA\n
* return: NA\n\n\n
*/
LCD_POWER_IOCTRL__QRY_IF_TIMING_VAL,
/*!< LCD_POWER_IOCTRL__QRY_IF_TIMING_VAL: Query LCD parellel/serial numberN interface timing\n
* param in_val: LCD_POWER_CTRL__IF_TIMING_STRUCT* \n
* param out_val: kal_uint32*: interface timing will store in this pointer \n
* return: NA\n\n\n
*/
LCD_POWER_IOCTRL__SET_ROI_CTRL,
/*!< LCD_POWER_IOCTRL__SET_ROI_CTRL: Set LCD interface ROI control register (only for LCD driver)\n
* param in_val: kal_uint32*: parameter\n
* param out_val: NA\n
* return: NA\n\n\n
*/
LCD_POWER_IOCTRL__SET_PERIOD,
/*!< LCD_POWER_IOCTRL__SET_PERIOD: Set LCD interface period value\n
* param in_val: NA\n
* param out_val: NA\n
* return: TRUE If the period is accepted by LCD Power control layer.\n\n\n
*/
LCD_POWER_IOCTRL__QRY_PERIOD,
/*!< LCD_POWER_IOCTRL__QRY_PERIOD: Query LCD interface period value\n
* param in_val: NA\n
* param out_val: kal_uint32*: interface period will store in this pointer\n
* return: NA\n\n\n
*/
LCD_POWER_IOCTRL__SET_TE_CTRL,
/*!< LCD_POWER_IOCTRL__SET_TE_CTRL: Set LCD interface TE control register (only for LCD driver)\n
* param in_val: kal_uint32*: parameter\n
* param out_val: NA\n
* return: NA\n\n\n
*/
LCD_POWER_IOCTRL__SET_GMC_CTRL,
/*!< LCD_POWER_IOCTRL__SET_GMC_CTRL: Set LCD interface GMC control register (only for LCD driver)\n
* param in_val: kal_uint32*: parameter\n
* param out_val: NA\n
* return: NA\n\n\n
*/
LCD_POWER_IOCTRL__SET_DITHER_CTRL
/*!< LCD_POWER_IOCTRL__SET_DITHER_CTRL: Set LCD interface Dither control register (only for LCD driver)\n
* param in_val: kal_uint32*: parameter\n
* param out_val: NA\n
* return: NA\n\n\n
*/
}LCD_POWER_IOCTRL_ID_ENUM;
/** The structure LCD_POWER_CTRL__IF_TIMING_STRUCT defines needed information when calling IOCTRL with \n
ID: LCD_POWER_IOCTRL__SET_IF_TIMING_VAL \n
*/
typedef struct
{
kal_bool parallel_if;
kal_uint32 if_num;
kal_uint32 if_val;
kal_uint32 clock;
kal_uint32 bus_width;
kal_uint32 write_hold_time;
kal_uint32 write_setup_time;
kal_uint32 write_wait_time;
kal_uint32 read_hold_time;
kal_uint32 read_setup_time;
kal_uint32 read_latency_time;
}LCD_POWER_CTRL__IF_TIMING_STRUCT;
/******************************************************************************
* API functions
*****************************************************************************/
/** DESCRIPTION :
* Register to LCD_POWER_CTRL layer, and get the module_bit ID for the caller.
* The return value will be used as the input parameter
* in lcd_power_ctrl__enable() and lcd_power_ctrl__disable()
*
*
* @param module The definition of LCD Power module bit for the module to be
* turned on.
*
* @param return 0xFFFFFFFF means a invalidate value. The caller shall do error handler.
*
* @remark Please try prevent to call this function in ISR level...and
* please do not use i-bit to protect this function.
* This API shall be called once for each module. No deregister API is supported.
*/
kal_uint32 lcd_power_ctrl__register_module(void);
/** DESCRIPTION :
* Turn on LCD module clock. And rollback LCD Interface registers setting.
*
* @param module The definition of LCD Power module bit for the module to be
* turned on.
*
* @remark Please try prevent to call this function in ISR level...and
* please do not use i-bit to protect this function.
*/
extern void lcd_power_ctrl__enable(kal_uint32 module);
/** DESCRIPTION :
* Turn off LCD module clock.
*
* @param module The definition of LCD Power module bit for the module to be
* turned off.
*
* @remark Please try prevent to call this function in ISR level...and
* please do not use i-bit to protect this function.
*/
extern void lcd_power_ctrl__disable(kal_uint32 module);
#endif //__LCD_PWR_CTRL_H__