change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc9630 / 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     ADIN_16,
42     ADIN_17,
43     ADIN_18,
44     ADIN_19,
45     ADIN_20,
46     ADIN_21,
47     ADIN_22,
48     ADIN_23,
49     ADIN_24,
50     ADIN_25,
51     ADIN_26,
52     ADIN_27,
53     ADIN_28,
54     ADIN_29,
55     ADIN_30,
56     ADIN_31,
57     ADC_MAX
58 } adc_channel;
59 typedef enum{false, true} bool;
60
61 #ifdef CONFIG_MACH_SP6810A
62 #define ADC_CHANNEL_TEMP 0
63 #else
64 #define ADC_CHANNEL_TEMP 1
65 #endif
66 #define ADC_CHANNEL_VBAT 5
67 #define ADC_CHANNEL_PROG 4
68 #define ADC_CHANNEL_VCHG 6
69
70 #ifdef __cplusplus
71 extern   "C"
72 {
73 #endif
74
75 void ADC_Init (void);
76 int32_t ADC_GetValues(adc_channel id, bool scale, uint8_t num, int32_t *p_buf);
77 int32_t ADC_GetValue(adc_channel adcSource, bool scale);
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif  // _ADC_DRVAPI_H_
84