1 /* drivers/adc/chips/rk28_adc.h
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.
9 #ifndef __ASM_RK29_ADC_H
10 #define __ASM_RK29_ADC_H
13 #define ADC_DATA_MASK 0x3ff
16 #define ADC_STAS_BUSY (1<<0)
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)
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
29 #define SAMPLE_RATE ((1000/100) * 2 /(ADC_CLK_RATE))
32 #endif /* __ASM_RK29_ADC_H */