Merge tag 'v3.10.92'
[firefly-linux-kernel-4.4.55.git] / drivers / adc / plat / rk28_adc.h
1 /* drivers/adc/chips/rk28_adc.h
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation.
6  *
7 */
8
9 #ifndef __ASM_RK29_ADC_H
10 #define __ASM_RK29_ADC_H
11
12 #define ADC_DATA                        0x00
13 #define ADC_DATA_MASK           0x3ff
14
15 #define ADC_STAS                        0x04
16 #define ADC_STAS_BUSY           (1<<0)
17
18 #define ADC_CTRL                        0x08
19 #define ADC_CTRL_CH(ch)         (ch >> SARADC_CHN_SHIFT)
20 #define ADC_CTRL_POWER_UP       (1<<3)
21 #define ADC_CTRL_START          (1<<4)
22 #define ADC_CTRL_IRQ_ENABLE     (1<<5)
23 #define ADC_CTRL_IRQ_STATUS     (1<<6)
24
25 #define ADC_CLK_RATE            1  //1M
26 /* maximum conversion rate of 100KSPS with 1MHZ ADC converter clock.
27  * SET: real conversion rate is half of maximum conversion rate
28  */
29 #define SAMPLE_RATE                     ((1000/100) * 2 /(ADC_CLK_RATE))
30
31
32 #endif /* __ASM_RK29_ADC_H */