文档介绍:驱动程序:
#include <linux/>
#include <linux/>
#include <linux/>
#include <linux/>
#include <linux/>
#include <linux/>
#include <linux/>
#include <linux/>
#include <asm/>
#include <asm/>
#include <asm/>
#include <mach/regs->
#include <plat/regs->
#include <plat/regs->
#include <mach/regs->
#include <linux/>
#include <linux/>
#include ""
#include <linux/>
#include <linux/>
MODULE_LICENSE("GPL");
#undef DEBUG
//#define DEBUG
#ifdef DEBUG
#define DPRINTK(x...) {printk(KERN_DEBUG "EmbedSky_adc: " x);}
#else
#define DPRINTK(x...) (void)(0)
#endif
#define DEVICE_NAME "adc"
static void __iomem *base_addr;
typedef struct
{
wait_queue_head_t wait;
int channel;
int prescale;
}ADC_DEV;
DECLARE_MUTEX(ADC_LOCK);
static int ADC_enable = 0;
static ADC_DEV adcdev;
static volatile int ev_adc = 0;
static int adc_data;
static struct clk *adc_clock;
#define ON (*(volatile unsigned long *)(base_addr + ON)) //ADC control
#define ADCTSC (*(volatile unsigned long *)(base_addr + S3C2410_ADCTSC)) //ADC touch screen control
#define ADCDLY (*(volatile unsigned long *)(base_addr + S3C2410_ADCDLY)) //ADC start or Interval Delay
#define ADCDAT0 (*(volatile unsigned long *)(base_addr + S3C2410_ADCDAT0)) //ADC conversion data 0