tizen 2.4 release
[kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-tiger / adc_drvapi.h
1 /******************************************************************************
2  ** File Name:      adc_drvapi.h                                                  *
3  ** Author:         hao.liu                                             *
4  ** DATE:           06/12/2010                                                *
5  ** Copyright:      2002 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:    This file defines the basic input and output operations   *
7  **                 on hardware, it can be treated as a hardware abstract     *
8  **                 layer interface.                                          *
9  ******************************************************************************
10
11  ******************************************************************************
12  **                        Edit History                                       *
13  ** ------------------------------------------------------------------------- *
14  ** DATE           NAME             DESCRIPTION                               * ** 06/12/2010     hao.liu    Create.                                   *
15  ******************************************************************************/
16
17 #ifndef _ADC_DRVAPI_H_
18 #define _ADC_DRVAPI_H_
19
20 #define ADC_SCALE_3V       0 
21 #define ADC_SCALE_1V2   1
22
23 typedef enum
24 {
25     ADIN_0 = 0,
26     ADIN_1,
27     ADIN_2,
28     ADIN_3,
29     ADIN_4,
30     ADIN_5,
31     ADIN_6,
32     ADIN_7,
33     ADIN_8,
34     ADIN_9,
35     ADIN_10,
36     ADIN_11,
37     ADIN_12,
38     ADIN_13,
39     ADIN_14,
40     ADIN_15,
41     ADC_MAX
42 } adc_channel;
43 typedef enum{false, true} bool;
44
45 #ifdef CONFIG_MACH_SP6810A
46 #define ADC_CHANNEL_TEMP 0
47 #else
48 #define ADC_CHANNEL_TEMP 1
49 #endif
50 #define ADC_CHANNEL_VBAT 5
51 #define ADC_CHANNEL_PROG 4
52 #define ADC_CHANNEL_VCHG 6
53
54 #ifdef __cplusplus
55 extern   "C"
56 {
57 #endif
58
59 void ADC_Init (void);
60 int32_t ADC_GetValue(adc_channel adcSource, bool scale);
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif  // _ADC_DRVAPI_H_
67