xref: /utopia/UTPA2-700.0.x/modules/xc/drv/xc/include/drvXC_ADC_Internal.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 ///
97 /// @file   drvTEMP.h
98 /// @brief  TEMP Driver Interface
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 #ifndef _DRV_ADC_INTERNAL_H_
103 #define _DRV_ADC_INTERNAL_H_
104 #include "mvideo_context.h"
105 
106 //-------------------------------------------------------------------------------------------------
107 //  Driver Capability
108 //-------------------------------------------------------------------------------------------------
109 
110 //-------------------------------------------------------------------------------------------------
111 //  Macro and Define
112 //-------------------------------------------------------------------------------------------------
113 
114 //-------------------------------------------------------------------------------------------------
115 //  Type and Structure
116 //-------------------------------------------------------------------------------------------------
117 /// ADC setting
118 typedef struct
119 {
120     MS_U16 u16RedGain;      ///< ADC red gain
121     MS_U16 u16GreenGain;    ///< ADC green gain
122     MS_U16 u16BlueGain;     ///< ADC blue gain
123     MS_U16 u16RedOffset;    ///< ADC red offset
124     MS_U16 u16GreenOffset;  ///< ADC green offset
125     MS_U16 u16BlueOffset;   ///< ADC blue offset
126 } XC_AdcGainOffsetSetting;
127 
128 typedef struct __attribute__((packed))
129 {
130     MS_U8  u8L_BkAtop_00;
131     MS_U8  u8L_BkAtop_01;
132     MS_U8  u8L_BkAtop_03;
133     MS_U8  u8L_BkAtop_0C;
134     MS_U8  u8L_BkAtop_2C;
135     MS_U8  u8L_BkAtop_1F;
136     MS_U8  u8H_BkAtop_2D;
137     MS_U8  u8L_BkDtop_06;
138     MS_U8  u8H_BkChipTop_1F;
139     MS_U8  u8L_BkChipTop_55;
140     MS_U8  u8L_BkIpMux_1;
141     MS_U16  u16SC_BK1_21;
142     MS_U16  u16SC_BK10_19;
143     MS_U16 u16L_BkAtop_05;
144     MS_U16 u16L_BkAtop_5E;
145     MS_U16 u16BkAtop_1C;
146     MS_U16 u16BkAtop_04;
147     MS_U16 u16BkAtop_05;
148     MS_U16 u16BkAtop_06;
149     MS_U16 u16BkDtop_01;
150     MS_U16 u16BkDtop_02;
151 
152     MS_U16 R_UserOffset;
153     MS_U16 G_UserOffset;
154     MS_U16 B_UserOffset;
155 
156     MS_U16 R_BlankLevel;
157     MS_U16 G_BlankLevel;
158     MS_U16 B_BlankLevel;
159 
160     MS_U16 u16SC_BK1_02;
161     MS_U16 u16SC_BK1_03;
162     MS_U16 u16SC_BK1_04;
163     MS_U16 u16SC_BK1_05;
164     MS_U16 u16SC_BK1_06;
165     MS_U16 u16SC_BK1_07;
166     MS_U16 u16SC_BK1_0E;
167     MS_U16 u16SC_BK12_01;
168     MS_U16 u16SC_BK12_03;
169     MS_U16 u16SC_BK12_04;
170     MS_U16 u16SC_BK12_0E;
171     MS_U16 u16SC_BK12_0F;
172     MS_U16 u16SC_BK12_16;
173     MS_U16 u16SC_BK12_17;
174     MS_U32 u32SC_BK12_10;
175     MS_U32 u32SC_BK12_12;
176     MS_U32 u32SC_BK12_14;
177     MS_U16 u16SC_BK12_07;
178     MS_U32 u32SC_BK12_08;
179     MS_U32 u32SC_BK12_0A;
180     MS_U32 u32SC_BK12_0C;
181     MS_U16 u16SC_BK02_04;
182     MS_U16 u16SC_BK02_05;
183     MS_U16 u16SC_BK02_08;
184     MS_U16 u16SC_BK02_09;
185     MS_U16 u16SC_BK23_07;
186     MS_U16 u16SC_BK23_08;
187     MS_U16 u16SC_BK23_09;
188     MS_U16 u16SC_BK23_0A;
189     MS_U16 u16SC_BK12_1A;
190     MS_U16 u16SC_BK12_1B;
191     MS_U16 u16SC_BK06_01;
192     MS_U16 u16SC_BK06_21;
193     MS_U16 u16SC_BK12_44;
194     MS_U16 u16SC_BK12_47;
195     MS_U16 u16SC_BK02_2B;
196 #if (FRC_INSIDE && (HW_DESIGN_4K2K_VER == 6))
197     MS_U16 u16SC_BKCB_17;
198 #endif
199 } XC_Adc_BackupSetting;
200 
201 
202 typedef enum
203 {
204     En_ADC_A    =  0x01,
205     En_ADC_B    =  0x02,
206     En_DVI      =  0x04,
207     En_VD       =  0x08,
208     En_VD_YC    =  0x10,
209     En_FB_RGB   =  0x20,
210     En_ADC_AMUX =  0x40,
211     EN_ADC_FB   =  0x80,
212     Mask_VD_En  =  En_VD|En_VD_YC|En_FB_RGB,
213 } E_ADC_FUNC_ENABLE;
214 
215 /*
216     ADC multiple inputsource enum.
217     Common interface for Hal and Api
218  */
219 
220 typedef enum
221 {
222     // Unknow
223     ADC_INPUTSOURCE_UNKNOW = 0x00,
224 
225     // Single source
226     ADC_INPUTSOURCE_ONLY_RGB    = 0x01,
227     ADC_INPUTSOURCE_ONLY_YPBPR  = 0x02,
228     ADC_INPUTSOURCE_ONLY_MVOP   = 0x04,
229     ADC_INPUTSOURCE_ONLY_DVI    = 0x08,
230     ADC_INPUTSOURCE_ONLY_ATV    = 0x10,
231     ADC_INPUTSOURCE_ONLY_SVIDEO = 0x20,
232     ADC_INPUTSOURCE_ONLY_SCART  = 0x40,
233     ADC_INPUTSOURCE_ONLY_CVBS   = 0x80,
234 
235 
236     ADC_INPUTSOURCE_MULTI_RGB_MVOP   = (ADC_INPUTSOURCE_ONLY_RGB | ADC_INPUTSOURCE_ONLY_MVOP),
237     ADC_INPUTSOURCE_MULTI_RGB_DVI    = (ADC_INPUTSOURCE_ONLY_RGB | ADC_INPUTSOURCE_ONLY_DVI),
238     ADC_INPUTSOURCE_MULTI_RGB_ATV    = (ADC_INPUTSOURCE_ONLY_RGB | ADC_INPUTSOURCE_ONLY_ATV),
239     ADC_INPUTSOURCE_MULTI_RGB_SVIDEO = (ADC_INPUTSOURCE_ONLY_RGB | ADC_INPUTSOURCE_ONLY_SVIDEO),
240     ADC_INPUTSOURCE_MULTI_RGB_SCART  = (ADC_INPUTSOURCE_ONLY_RGB | ADC_INPUTSOURCE_ONLY_SCART),
241     ADC_INPUTSOURCE_MULTI_RGB_CVBS   = (ADC_INPUTSOURCE_ONLY_RGB | ADC_INPUTSOURCE_ONLY_CVBS),
242 
243     ADC_INPUTSOURCE_MULTI_YPBPR_MVOP   = (ADC_INPUTSOURCE_ONLY_YPBPR | ADC_INPUTSOURCE_ONLY_MVOP),
244     ADC_INPUTSOURCE_MULTI_YPBPR_DVI    = (ADC_INPUTSOURCE_ONLY_YPBPR | ADC_INPUTSOURCE_ONLY_DVI),
245     ADC_INPUTSOURCE_MULTI_YPBPR_ATV    = (ADC_INPUTSOURCE_ONLY_YPBPR | ADC_INPUTSOURCE_ONLY_ATV),
246     ADC_INPUTSOURCE_MULTI_YPBPR_SVIDEO = (ADC_INPUTSOURCE_ONLY_YPBPR | ADC_INPUTSOURCE_ONLY_SVIDEO),
247     ADC_INPUTSOURCE_MULTI_YPBPR_SCART  = (ADC_INPUTSOURCE_ONLY_YPBPR | ADC_INPUTSOURCE_ONLY_SCART),
248     ADC_INPUTSOURCE_MULTI_YPBPR_CVBS   = (ADC_INPUTSOURCE_ONLY_YPBPR | ADC_INPUTSOURCE_ONLY_CVBS),
249 
250     ADC_INPUTSOURCE_MULTI_MVOP_DVI    = (ADC_INPUTSOURCE_ONLY_MVOP | ADC_INPUTSOURCE_ONLY_DVI),
251     ADC_INPUTSOURCE_MULTI_MVOP_SVIDEO = (ADC_INPUTSOURCE_ONLY_MVOP | ADC_INPUTSOURCE_ONLY_SVIDEO),
252     ADC_INPUTSOURCE_MULTI_MVOP_SCART  = (ADC_INPUTSOURCE_ONLY_MVOP | ADC_INPUTSOURCE_ONLY_SCART),
253     ADC_INPUTSOURCE_MULTI_MVOP_CVBS   = (ADC_INPUTSOURCE_ONLY_MVOP | ADC_INPUTSOURCE_ONLY_CVBS),
254 
255     ADC_INPUTSOURCE_MULTI_DVI_ATV    = (ADC_INPUTSOURCE_ONLY_DVI | ADC_INPUTSOURCE_ONLY_ATV),
256     ADC_INPUTSOURCE_MULTI_DVI_SVIDEO = (ADC_INPUTSOURCE_ONLY_DVI | ADC_INPUTSOURCE_ONLY_SVIDEO),
257     ADC_INPUTSOURCE_MULTI_DVI_SCART  = (ADC_INPUTSOURCE_ONLY_DVI | ADC_INPUTSOURCE_ONLY_SCART),
258     ADC_INPUTSOURCE_MULTI_DVI_CVBS   = (ADC_INPUTSOURCE_ONLY_DVI | ADC_INPUTSOURCE_ONLY_CVBS),
259 }ADC_INPUTSOURCE_TYPE;
260 
261 /*
262     ADC CVBS out enum.
263     Common interface for Hal and Api
264  */
265 typedef enum
266 {
267     // ch1 out, source select
268     ADC_CVBSOUT_DISABLE_1,
269     ADC_CVBSOUT_SV_ON_1,
270     ADC_CVBSOUT_SV_OFF_1,
271     ADC_CVBSOUT_CVBS_ON_1,
272     ADC_CVBSOUT_CVBS_OFF_1,
273     ADC_CVBSOUT_VIF_VE_1,
274     ADC_CVBSOUT_VIF_VIF_1,
275 
276     // ch2 out, source select
277     ADC_CVBSOUT_DISABLE_2,
278     ADC_CVBSOUT_SV_ON_2,
279     ADC_CVBSOUT_SV_OFF_2,
280     ADC_CVBSOUT_CVBS_ON_2,
281     ADC_CVBSOUT_CVBS_OFF_2,
282     ADC_CVBSOUT_VIF_VE_2,
283     ADC_CVBSOUT_VIF_VIF_2,
284 }E_ADC_CVBSOUT_TYPE;
285 
286 
287 typedef enum
288 {
289     MS_ADC_A_POWER_ON,
290     MS_ADC_B_POWER_ON,
291     MS_VDB_CVBS_POWER_ON,
292     MS_VDB_SV_POWER_ON,
293     MS_VDB_FBLANK_POWER_ON,
294     MS_VDA_ATV_POWER_ON,
295     MS_VDA_CVBS_POWER_ON,
296     MS_VDA_SV_POWER_ON,
297     MS_VDA_FBLANK_POWER_ON,
298     MS_DVI_POWER_ON,
299     MS_ADC_VD_BLEND_POWER_ON,
300     MS_ADC_POWER_ALL_OFF,
301     MS_VDB_DTV_POWER_ON,
302 } MS_ADC_POWER_ON_TYPE;
303 
304 typedef struct
305 {
306     MS_U8 *pTable;
307     MS_U8 u8TabCols;
308     MS_U8 u8TabRows;
309     MS_U8 u8TabIdx;
310 } TAB_Info;
311 
312 typedef enum
313 {
314     E_ADC_CVBSO_PORT_1,
315     E_ADC_CVBSO_PORT_2,
316     E_ADC_CVBSO_PORT_MAX,
317 } ADC_CVBSOPortNumber;
318 
319 typedef enum
320 {
321     E_ADC_ISOG_NORMAL_MODE,
322     E_ADC_ISOG_STANDBY_MODE,
323     E_ADC_ISOG_MODE_MAX,
324 } ADC_iSogDetectMode;
325 
326 //-------------------------------------------------------------------------------------------------
327 //  Function and Variable
328 //-------------------------------------------------------------------------------------------------
329 
330 void Hal_ADC_init(void *pInstance, MS_U16 u16XTAL_CLK,MS_BOOL IsShareGrd,  MS_U16 eScartIDPortSelection);
331 #define MDrv_ADC_init  Hal_ADC_init
332 
333 void MDrv_XC_ADC_hpolarity_setting(void *pInstance, MS_BOOL bHightActive);
334 void MDrv_XC_ADC_Set_Freerun(void *pInstance, MS_BOOL bEnable);
335 void MDrv_XC_ADC_Reload(void *pInstance, INPUT_SOURCE_TYPE_t enSourceType, MS_U16 u16PixelClockPerSecond, MS_U16 u16HorizontalTotal, MS_U16 u16SamplingRatio);
336 void MDrv_ADC_SourceSwitch(void *pInstance, MS_BOOL bSwitch);
337 // reset
338 void MDrv_XC_ADC_reset(void *pInstance, MS_U16 u16Reset);
339 void MDrv_XC_ADC_clamp_placement_setting(void *pInstance, MS_U16 u16InputClockMHz);
340 void MDrv_XC_ADC_vco_ctrl (void *pInstance, MS_BOOL bIsDVIPort, MS_U16 u16InputClock);
341 
342 void MDrv_XC_ADC_SetOffsetSetting(void *pInstance, APIXC_AdcGainOffsetSetting *pstADCSetting);
343 void MDrv_XC_ADC_SetGainSetting(void *pInstance, APIXC_AdcGainOffsetSetting *pstADCSetting);
344 //get adc setting from HW
345 MS_BOOL MDrv_XC_ADC_GetOffsetSetting(void *pInstance, APIXC_AdcGainOffsetSetting *pstADCSetting);
346 MS_BOOL MDrv_XC_ADC_GetGainSetting(void *pInstance, APIXC_AdcGainOffsetSetting *pstADCSetting);
347 
348 // Main functions for ADC.
349 void MDrv_XC_ADC_poweron_source(void *pInstance, ADC_INPUTSOURCE_TYPE enADC_SourceType);
350 // ADC cvbs out
351 void MDrv_XC_ADC_set_cvbs_out(void *pInstance, E_ADC_CVBSOUT_TYPE e_cvbs_out_type);
352 MS_BOOL MDrv_XC_ADC_Is_cvbs_out_enabled(void *pInstance, E_DEST_TYPE enOutputType);
353 // src & mode setting
354 void MDrv_XC_ADC_Set_Source(void *pInstance, ADC_INPUTSOURCE_TYPE enADC_SourceType, E_MUX_INPUTPORT* enInputPortType, MS_U8 u8PortCount);
355 void MDrv_XC_ADC_SetPcClock(void *pInstance, MS_U16 u16Value);
356 // backup setting before auto-adc
357 void MDrv_XC_ADC_BackupAdcReg(void *pInstance, SCALER_WIN eWindow);
358 // restore setting after auto-adc
359 void MDrv_XC_ADC_RestoreAdcReg(void *pInstance, SCALER_WIN eWindow);
360 // set SOG BW
361 void MDrv_XC_ADC_Set_SOGBW(void *pInstance, MS_U16 u16value);
362 
363 ADC_INPUTSOURCE_TYPE MDrv_XC_ADC_ConvertSrcToADCSrc(void *pInstance, INPUT_SOURCE_TYPE_t enInputSourceType);
364 void MDrv_XC_ADC_SetClampDuration(void *pInstance, MS_U16 u16Value);
365 void MDrv_XC_Mux_GetPort(void *pInstance, INPUT_SOURCE_TYPE_t src, E_MUX_INPUTPORT* port_ids , MS_U8* u8port_count );
366 void MApi_XC_AutoGainEnable(void *pInstance, MS_U8 u8Enable , SCALER_WIN eWindow);
367 MS_BOOL MApi_XC_IsAutoGainResultReady(void *pInstance, SCALER_WIN eWindow);
368 MS_U32 MApi_XC_GetPhaseValue(void *pInstance, SCALER_WIN eWindow);
369 
370 void    MApi_XC_ADC_Source_Calibrate(INPUT_SOURCE_TYPE_t enInputSourceType); //NO_NEED  for API use
371 void    MDrv_XC_ADC_SetInputSource(void *pInstance, INPUT_SOURCE_TYPE_t*  enInputSource, MS_U8 u8InputSourceCount);
372 
373 // ADC calibration
374 void MDrv_XC_ADC_Source_Calibrate(void *pInstance, ADC_INPUTSOURCE_TYPE enADCInput);
375 MS_BOOL MDrv_XC_ADC_InitExternalCalibration(void *pInstance, INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstInitialGainOffset);
376 MS_BOOL MDrv_XC_ADC_InitExternalCalibrationWithFixedOffset(void *pInstance, INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstInitialGainOffset);
377 MS_BOOL MDrv_XC_ADC_InitInternalCalibration(void *pInstance, INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstInitialGainOffset);
378 MS_BOOL MDrv_XC_ADC_InitInternalCalibrationWithFixedOffset(void *pInstance, INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstInitialGainOffset, SCALER_WIN eWindow);
379 MS_BOOL MDrv_ADC_GetInitCalibrationGain(void *pInstance, INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstInitialGain);
380 MS_BOOL MDrv_ADC_GetInitCalibrationOffset(void *pInstance, INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstInitialOffset);
381 void MApi_XC_ADC_ExitExternalCalibration(void *pInstance, INPUT_SOURCE_TYPE_t eSource, APIXC_AdcGainOffsetSetting* InitialGainOffset);
382 void MApi_XC_ADC_GenClock(void *pInstance, ADC_Gen_Clock_Type clocktype);
383 void MApi_XC_ADC_SetInternalVoltage(void *pInstance, ADC_Internal_Voltage InternalVoltage);
384 void MDrv_XC_ADC_GetDefaultGainOffset(void *pInstance, INPUT_SOURCE_TYPE_t eSource , APIXC_AdcGainOffsetSetting* pstADCSetting);
385 MS_U16 MDrv_XC_ADC_GetCenterGain(void *pInstance);
386 MS_U16 MDrv_XC_ADC_GetCenterOffset(void *pInstance);
387 MS_U16 MDrv_XC_ADC_GetMaximalOffsetValue(void *pInstance);
388 MS_U16 MDrv_XC_ADC_GetMaximalGainValue(void *pInstance);
389 void MDrv_XC_ADC_SetGain(void *pInstance, MS_U8 u8Color, MS_U16 u16Value);
390 void MDrv_XC_ADC_SetOffset(void *pInstance, MS_U8 u8Color, MS_U16 u16Value);
391 MS_BOOL MDrv_XC_ADC_use_hardware_auto_offset(void *pInstance, INPUT_SOURCE_TYPE_t eSource);
392 void MApi_XC_ADC_AutoSetting(void *pInstance, MS_BOOL bEnable, MS_BOOL bIsYPbPrFlag, MS_BOOL bIsAutoSWMode);
393 void MApi_XC_ADC_SetVClampLevel(void *pInstance, ADC_VClamp_Level_Type type);
394 
395 void MDrv_XC_ADC_SetPhaseWithVSync(void *pInstance, MS_U16 u16Value);
396 void MDrv_XC_ADC_SetPhaseEx(void *pInstance, MS_U16 u16Value );
397 MS_U16 MDrv_XC_ADC_GetPhaseRange(void *pInstance);
398 void MDrv_XC_ADC_GetSoGLevelRange(void *pInstance, MS_U32 *u32Min, MS_U32 *u32Max, MS_U32 *u32Recommend_value);
399 void MDrv_XC_ADC_SetSoGLevel(void *pInstance, MS_U32 u32Value);
400 void MDrv_XC_ADC_SetSoGCal(void *pInstance);
401 MS_U8 MDrv_XC_ADC_GetPhase(void *pInstance);
402 MS_U16 MDrv_XC_ADC_GetPhaseEx(void *pInstance);
403 void MDrv_XC_ADC_PowerOff(void *pInstance);
404 MS_BOOL MDrv_XC_ADC_IsScartRGB(void *pInstance);
405 MS_U16 MDrv_XC_ADC_GetPcClock(void *pInstance);
406 void MDrv_XC_ADC_SetRGB_PIPE_Delay(void *pInstance, MS_U8 u8Value);
407 void MDrv_XC_ADC_ScartRGB_SOG_ClampDelay(void *pInstance, MS_U16 u16Clpdly, MS_U16 u16Caldur);
408 void MDrv_XC_ADC_Set_YPbPrLooseLPF(void *pInstance, MS_BOOL bEnable);
409 void MDrv_XC_ADC_SetMode(void *pInstance, INPUT_SOURCE_TYPE_t enSourceType, XC_InternalStatus *pSrcInfo, PQ_ADC_SAMPLING_INFO *pstPQADCSamplingInfo, SCALER_WIN eWindow);
410 void MDrv_XC_ADC_GetPQADCSamplingInfo(void *pInstance, INPUT_SOURCE_TYPE_t enSourceType, XC_InternalStatus *pSrcInfo, PQ_ADC_SAMPLING_INFO *pstPQADCSamplingInfo, SCALER_WIN eWindow);
411 void MApi_XC_ADC_SwitchSource(void *pInstance, MS_BOOL bUpdateStatus);
412 void MDrv_XC_ADC_EnableHWCalibration(void *pInstance, MS_BOOL bEnable);
413 MS_BOOL MDrv_XC_ADC_CheckHWCalibrationSupport(void *pInstance);
414 void MDrv_ADC_ISOG_Enable(void *pInstance, MS_BOOL bEnable);
415 void MDrv_ADC_ISOG_SetDetectMode(void *pInstance, ADC_iSogDetectMode stMode);
416 MS_BOOL MDrv_XC_ADC_GetFixedGain(void *pInstance, const INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstAdcFixedGain);
417 MS_BOOL MDrv_ADC_GetFixedOffset(void *pInstance, const INPUT_SOURCE_TYPE_t enInputSrc, APIXC_AdcGainOffsetSetting* pstInitialOffset);
418 MS_BOOL MDrv_XC_Auto_GetHWFixedGainOffset(void *pInstance, XC_Auto_TuneType enAutoTuneType, APIXC_AdcGainOffsetSetting *pstADCSetting);
419 MS_BOOL MDrv_XC_Auto_Geometry_Ex(void *pInstance, XC_Auto_TuneType enAutoTuneType, XC_Auto_Signal_Info_Ex *ActiveInfo, XC_Auto_Signal_Info_Ex *StandardInfo , SCALER_WIN eWindow);
420 MS_BOOL MDrv_XC_ADC_SetIdacCurrentMode(void *pInstance, ADC_DacCurrentMode_t eMode);
421 ADC_DacCurrentMode_t MDrv_XC_ADC_GetIdacCurrentMode(void *pInstance);
422 void MDrv_XC_ADC_SCART_RGB_setMode(void *pInstance, MS_BOOL bEnable);
423 
424 #endif // _DRV_ADC_INTERNAL_H_
425 
426