change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8830 / lcd_controller.h
1 /******************************************************************************
2  ** File Name:       lcd.h                                                    *
3  ** Author:          Jim zhang                                                *
4  ** DATE:            08/21/2003                                               *
5  ** Copyright:      2003 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:                                                              *
7  ******************************************************************************
8
9  ******************************************************************************
10  **                        Edit History                                       *
11  ** ------------------------------------------------------------------------- *
12  ** DATE              NAME             DESCRIPTION                            *
13  ** 08/21/2003     Jim zhang        Create.                                   *
14  ******************************************************************************/
15
16
17 #ifndef _LCD_CONTROLLER_H_
18 #define _LCD_CONTROLLER_H_
19
20 /**---------------------------------------------------------------------------*
21  **                         Dependencies                                      *
22  **---------------------------------------------------------------------------*/
23 #include "sci_types.h"
24 #include "lcdc_data_type.h"
25
26
27
28 /**---------------------------------------------------------------------------*
29  **                         Compiler Flag                                     *
30  **---------------------------------------------------------------------------*/
31 #ifdef __cplusplus
32 extern   "C"
33 {
34 #endif
35
36 /**---------------------------------------------------------------------------*
37  **                         Macro defines.
38  **---------------------------------------------------------------------------*/
39
40 //TV mode
41 typedef enum
42 {
43     TV_PAL_LINE_BY_LINE = 0  ,
44     TV_PAL_INTERLEAVING_LINE ,
45     TV_NTSC_LINE_BY_LINE     ,
46     TV_NTSC_INTERLEAVING_LINE
47 }
48 TV_MODE_E;
49
50 /*
51  * Funtion pointer struct
52  */
53
54
55 /**---------------------------------------------------------------------------*
56  **                         Constant Variables
57  **---------------------------------------------------------------------------*/
58
59
60 /**---------------------------------------------------------------------------*
61  **                         Function Prototypes
62  **---------------------------------------------------------------------------*/
63
64
65 /******************************************************************************/
66 /*            LCDC Controller Driver Interfaces                               */
67 /******************************************************************************/
68 /**********************************************************************************************************/
69 // Description: set LCDC work mode and lcd infomation
70 // Global resource dependence: g_lcdc_type
71 // Author: Jianping.wang
72 // Note:
73 //      p_lcdc - pointer to info structure
74 /**********************************************************************************************************/
75 PUBLIC void LCDC_SetLcdType (LCDC_TYPE_T *lcdc_ptr, uint32 lcd_cs);
76 /**********************************************************************************************************/
77 // Description: set lcd display block information
78 // Global resource dependence:
79 // Author: Jianping.wang
80 // Note:
81 //      operation successes,provided use correct access mask
82 //      input:
83 //          p_blk - pointer to display block information
84 //          p_mask - pointer to block access mask
85 //      return:
86 //          LCD_OK,if success
87 //          other,if fail
88 /**********************************************************************************************************/
89 PUBLIC int32 LCDC_SetLcdBlock (LCD_BLOCK_T *blk_ptr,uint32 *mask_ptr);
90 /**********************************************************************************************************/
91 // Description: initialize LCDC
92 // Global resource dependence: g_lcdc_mode
93 // Author: Jianping.wang
94 // Note:
95 /**********************************************************************************************************/
96 PUBLIC int32 LCDC_Init (void);
97 /**********************************************************************************************************/
98 // Description: configure LCDC
99 // Global resource dependence: g_lcdc_mode
100 // Author: Jianping.wang
101 // Note:
102 //      input:
103 //          spec_ptr - pointer to LCD information struction
104 //      return:
105 //          LCD_OK,if success
106 //          other,if fail
107 /**********************************************************************************************************/
108 PUBLIC int32 LCDC_Configure (LCDC_SPEC_T *spec_ptr);
109 /**********************************************************************************************************/
110 // Description: get LCDC configure information that is related with LCD
111 // Global resource dependence: g_lcdc_mode
112 // Author: Jianping.wang
113 // Note:
114 //      input:
115 //          none
116 //      output:
117 //          p_spec - pointer to information structure
118 //      return:
119 //          LCD_OK,if success
120 //          other,if fail
121 /**********************************************************************************************************/
122 PUBLIC int32 LCDC_GetInfo (LCDC_INFO_T *info_ptr);
123 /**********************************************************************************************************/
124 // Description: send the command and data to LCD
125 // Global resource dependence: g_lcdc_mode
126 // Author: Jianping.wang
127 // Note:
128 //      input:
129 //          cmd - lcd command
130 //          lcd_data - lcd command data
131 //          lcd_id - only is used for lcdc mcu mode
132 //      return:
133 //          LCD_OK,if success
134 //          other,if fail
135 /**********************************************************************************************************/
136 PUBLIC int32 LCDC_SendCmdData (uint32 cmd,uint32 lcd_data,uint32 lcd_id);
137 /**********************************************************************************************************/
138 // Description: send command to lcd
139 // Global resource dependence: g_lcdc_mode
140 // Author: Jianping.wang
141 // Note:
142 //      lcd_id parameter is used when lcdc mcu mode
143 //      input:
144 //          cmd - lcd command
145 //          lcd_id - LCD ID
146 //      return:
147 //          LCD_OK,if success
148 //          other,if fail
149 /**********************************************************************************************************/
150 PUBLIC int32 LCDC_SendCmd (uint32 cmd,uint32 lcd_id);
151 /**********************************************************************************************************/
152 // Description: send display data to LCD
153 // Global resource dependence: g_lcdc_mode
154 // Author: Jianping.wang
155 // Note:
156 //      this interface is used in lcdc mcu mode
157 //      input:
158 //          lcd_data - display data
159 //          lcd_id - LCD ID
160 //      return:
161 //          LCD_OK,if success
162 //          other,if fail
163 /**********************************************************************************************************/
164 PUBLIC int32 LCDC_SendData (uint32 lcd_data,uint32 lcd_id);
165 /**********************************************************************************************************/
166 // Description: get LCD index register value
167 // Global resource dependence: g_lcdc_mode
168 // Author: Jianping.wang
169 // Note:
170 //      lcd_id parameter is used when lcdc mcu mode
171 //      input:
172 //          cmd - LCD command
173 //          lcd_id - LCD ID
174 //      output:
175 //          data_ptr - pointer to data that is LCD index register value
176 //      return:
177 //          LCD_OK,if success
178 //          other,if fail
179 /**********************************************************************************************************/
180 PUBLIC int32 LCDC_ReadLcdIndex (uint32 *data_ptr,uint32 cmd,uint32 lcd_id);
181 /**********************************************************************************************************/
182 // Description: start LCDC to write display data to LCD or TV
183 // Global resource dependence: g_lcdc_mode
184 // Author: Jianping
185 // Note:
186 //      lcd_id parameter is used when lcdc mcu mode
187 //      input:
188 //          lcd_width - lcd width
189 //          lcd_height - lcd height
190 //          lcd_id - LCD ID
191 //      return:
192 //          LCD_OK,if success
193 //          other,if fail
194 /**********************************************************************************************************/
195 PUBLIC int32 LCDC_TransCmd (uint16 lcd_width,uint16 lcd_height,uint32 lcd_cs);
196 /**********************************************************************************************************/
197 // Description:
198 // Global resource dependence:
199 // Author: Jianping.wang
200 // Note:
201 /**********************************************************************************************************/
202 PUBLIC void LCDC_GetConfigInfo (LCDC_CONFIG_T *cfg_ptr);
203 /**********************************************************************************************************/
204 // Description:
205 // Global resource dependence:
206 // Author: Jianping.wang
207 // Note:
208 /**********************************************************************************************************/
209 PUBLIC void LCDC_SetConfig (LCDC_CONFIG_T *cfg_ptr);
210 /**********************************************************************************************************/
211 // Description: initialize LCDC TV mode
212 // Global resource dependence: g_lcd_background
213 // Author: Jianping.wang
214 // Note:
215 //      lcdc tv mode is prior to mcu mode and rgb mode
216 /**********************************************************************************************************/
217 PUBLIC int32 LCDC_StartTv (uint32 tv_mode);
218 /**********************************************************************************************************/
219 // Description: close LCDC TV mode,resume to LCDC rgb mode or mcu mode
220 // Global resource dependence: g_lcdc_mode
221 // Author: Jianping.wang
222 // Note:
223 /**********************************************************************************************************/
224 PUBLIC void LCDC_CloseTv (void);
225 /**********************************************************************************************************/
226 // Description: reset LCD
227 // Global resource dependence: g_lcdc_mode
228 // Author: Jianping.wang
229 // Note:
230 //      delay_ms parameter is used in lcdc mcu mode
231 //      input:
232 //          delay_ms - delay time(ms)
233 //      return:
234 //          LCD_OK,if success
235 //          other,if fail
236 /**********************************************************************************************************/
237 PUBLIC int32 LCDC_ResetLcd (uint32 delay_ms);
238 /**********************************************************************************************************/
239 // Description: select lcdc output data flow
240 // Global resource dependence:
241 // Author: Jianping.wang
242 // Note:
243 //      this function is used in lcdc rgb mode
244 //      feed_back - 1:LCDC output data to ISP module
245 //                 0:LCDC don't output data to ISP
246 //      disable_lcdout - 1:disable lcdc output to lcd
247 //                       0:enable lcdc output to lcd
248 /**********************************************************************************************************/
249 PUBLIC void LCDC_ConfigDataFlow (uint32 feed_back,uint32 disable_lcdout);
250 /**********************************************************************************************************/
251 // Description: adjust transfer timing
252 // Global resource dependence:
253 // Author: Jianping.wang
254 // Note:
255 //
256 /**********************************************************************************************************/
257 PUBLIC int32 LCDC_ChangePulseWidth (LCD_MODE_T mode, uint32 cs_id, LCD_TIMING_U timing_para);
258 /**********************************************************************************************************/
259 // Description: close LCDC
260 // Global resource dependence:
261 // Author: jianping.wang
262 // Note:
263 //      flag - 1:disable lcdc;0:enable lcdc
264 //---------------------------------------------------------------------------------------------------------
265 PUBLIC void LCDC_Close (uint32 flag);
266 /**********************************************************************************************************/
267 // Description: set color correction matrix in rgb mode and mcu mode;
268 //              or set rgb to yuv conversion matrix in tv mode
269 // Global resource dependence:
270 // Author: Jianping.wang
271 // Note:
272 //      matrix_ptr - pointer to the matrix that is color correct matrix,or rgb to yuv conversion matrix
273 /**********************************************************************************************************/
274 PUBLIC void LCDC_SetColorMatrix (COLORMATRIX_T *matrix_ptr);
275 /**********************************************************************************************************/
276 // Description: updata tv display
277 // Global resource dependence:
278 // Author: Jianping.wang
279 // Note:
280 /**********************************************************************************************************/
281 PUBLIC void LCDC_RefreshTv (void);
282 /**********************************************************************************************************/
283 // Description: start LCDC,use background refresh LCD
284 // Global resource dependence:
285 // Author: Jianping.wang
286 // Note:
287 /**********************************************************************************************************/
288 PUBLIC void LCDC_Start (void);
289 /**********************************************************************************************************/
290 // Description: Update LCDC Register setting
291 // Global resource dependence:
292 // Author: Jianping.wang
293 // Note:
294 /**********************************************************************************************************/
295 PUBLIC void LCDC_UpdateRegisters (void);
296 /**********************************************************************************************************/
297 // Description: set LCD background color
298 // Global resource dependence:
299 // Author: Jianping.wang
300 // Note:
301 /**********************************************************************************************************/
302 PUBLIC void LCDC_SetBackground (uint32 color);
303 /**********************************************************************************************************/
304 // Description: disable use display block
305 // Global resource dependence:  g_lcd_blk
306 // Author: Jianping.wang
307 // Note:
308 /**********************************************************************************************************/
309 PUBLIC void LCDC_DisableLcdBlock (void);
310 /**********************************************************************************************************/
311 // Description: software reset LCDC and TV Encoder
312 // Global resource dependence:
313 // Author: Jianping.wang
314 // Note:wirte 1-0
315 /**********************************************************************************************************/
316 PUBLIC void LCDC_Reset (void);
317 /**********************************************************************************************************/
318 // Description: Check if LCDC finish one brush LCD operation or not
319 // Global resource dependence:
320 // Author: Jianping.wang
321 // Note:
322 //     input  - none
323 //     output - none
324 //     return - 1:finish brush operation
325 //              0:don't finish brush operation
326 /**********************************************************************************************************/
327 PUBLIC BOOLEAN LCDC_CheckBrushLcdStatue (void);
328 /**********************************************************************************************************/
329 // Description:
330 // Global resource dependence:
331 // Author: Jianping.wang
332 // Note:
333 /**********************************************************************************************************/
334 PUBLIC void LCDC_ClearStatus (void);
335 /**********************************************************************************************************/
336 // Description:
337 // Global resource dependence:
338 // Author: Jianping.wang
339 // Note:
340 //      input:
341 //          is_open_rst - 1:open rst pin of lcd
342 //                        0:close rst pin of lcd
343 /**********************************************************************************************************/
344 PUBLIC void LCDC_SelectRstFuc (BOOLEAN is_open_rst);
345 /**********************************************************************************************************/
346 // Description: LCDC module handle interrupt
347 // Global resource dependence: g_lcdc_mode
348 // Author: Jianping.wang
349 // Note:
350 /**********************************************************************************************************/
351 PUBLIC void LCDC_irq (uint32 param);
352 /**********************************************************************************************************/
353 // Description: register handle function
354 // Global resource dependence: g_lcdc_int_list
355 // Author: Jianping.wang
356 // Note:
357 /**********************************************************************************************************/
358 PUBLIC BOOLEAN LCDC_RegisterInterrupt (uint32 int_num, lcdc_func_t func);
359 /**********************************************************************************************************/
360 // Description: provide lcdc interrupt
361 // Global resource dependence: g_lcdc_mode
362 // Author: Jianping.wang
363 // Note:
364 //      input :
365 //          int_ptr - pointer to interrupt structure
366 //      return:
367 //          LCD_OK,if success
368 //          other,if fail
369 /**********************************************************************************************************/
370 PUBLIC int32 LCDC_SpecialMode (LCD_INT_ENA_T *int_ptr);
371 /**********************************************************************************************************/
372 // Description: close LCDC TV DAC
373 // Global resource dependence:
374 // Author: Jianping.wang
375 // Note:
376 /**********************************************************************************************************/
377 PUBLIC void LCDC_CloseTvDAC (void);
378
379
380
381
382
383 /**---------------------------------------------------------------------------*
384  **                         Compiler Flag                                     *
385  **---------------------------------------------------------------------------*/
386 #ifdef __cplusplus
387 }
388 #endif
389
390 #endif // _LCDC_H