tizen 2.4 release
[kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8825 / 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         ADC_CHANNEL_0 = 0,
26         ADC_CHANNEL_1 = 1,
27         ADC_CHANNEL_2 = 2,
28         ADC_CHANNEL_3 = 3,
29         ADC_CHANNEL_PROG = 4,
30         ADC_CHANNEL_VBAT = 5,
31         ADC_CHANNEL_VCHGSEN = 6,
32         ADC_CHANNEL_VCHGBG = 7,
33         ADC_CHANNEL_ISENSE = 8,
34         ADC_CHANNEL_TPYD = 9,
35         ADC_CHANNEL_TPYU = 10,
36         ADC_CHANNEL_TPXR = 11,
37         ADC_CHANNEL_TPXL = 12,
38         ADC_CHANNEL_DCDCCORE = 13,
39         ADC_CHANNEL_DCDCARM = 14,
40         ADC_CHANNEL_DCDCMEM = 15,
41         ADC_CHANNEL_DCDCLDO = 16,
42         ADC_CHANNEL_VBATBK = 17,
43         ADC_CHANNEL_HEADMIC = 18,
44         ADC_CHANNEL_LDO0 = 19,  /* ldo rf/abb/cama */
45         ADC_CHANNEL_LDO1 = 20,  /* ldo v3v/v28/vsim0/vsim1/cammot/sd0/usb/dvdd18/v25 */
46         ADC_CHANNEL_LDO2 = 21,  /* ldo camio/camcore/cmmb1v2/cmmb1v8/v18/sd1/sd3/ */
47         ADC_MAX = 22
48 } adc_channel;
49 typedef enum{false, true} bool;
50
51 #ifdef CONFIG_MACH_SP6810A
52 #define ADC_CHANNEL_TEMP 0
53 #else
54 #define ADC_CHANNEL_TEMP 1
55 #endif
56
57 #ifdef __cplusplus
58 extern   "C"
59 {
60 #endif
61
62 void ADC_Init (void);
63 int32_t ADC_GetValues(adc_channel id, bool scale, uint8_t num, int32_t * p_buf);
64 int32_t ADC_GetValue(adc_channel adcSource, bool scale);
65
66 #ifdef __cplusplus
67 }
68 #endif
69
70 #endif  // _ADC_DRVAPI_H_
71