资源简介

GEC210-Linux驱动源码,GEC210-Linux驱动源码,GEC210-Linux驱动源码,GEC210-Linux驱动源码,GEC210-Linux驱动源码,培训拿到的资料,很不错哦、、

资源截图

代码片段和文件信息

/* linux/arch/arm/mach-s5pv210/adc.c
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not write to the Free Software
 * Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
 *
 * Copyright (c) 2004 Arnaud Patard 
 * iPAQ H1940 touchscreen support
 *
 * ChangeLog
 *
 * 2004-09-05: Herbert Pötzl 
 * - added clock (de-)allocation code
 *
 * 2005-03-06: Arnaud Patard 
 *      - h1940_ -> s3c24xx (this driver is now also used on the n30
 *        machines :P)
 *      - Debug messages are now enabled with the config option
 *        TOUCHSCREEN_S3C_DEBUG
 *      - Changed the way the value are read
 *      - Input subsystem should now work
 *      - Use ioremap and readl/writel
 *
 * 2005-03-23: Arnaud Patard 
 *      - Make use of some undocumented features of the touchscreen
 *        controller
 *
 */


#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 

#include 
#include 
#include 

#define ADC_MINOR 131
#define ADC_INPUT_PIN _IOW(‘S‘ 0x0c unsigned long)

#define ADC_WITH_TOUCHSCREEN

static struct clk *adc_clock;

static void __iomem *base_addr;
static int adc_port;
struct s3c_adc_mach_info *plat_data;

#ifdef ADC_WITH_TOUCHSCREEN
static DEFINE_MUTEX(adc_mutex);

static unsigned long data_for_ADCCON;
static unsigned long data_for_ADCTSC;

static void s3c_adc_save_SFR_on_ADC(void)
{
data_for_ADCCON = readl(base_addr + S3C_ADCCON);
data_for_ADCTSC = readl(base_addr + S3C_ADCTSC);
}

static void s3c_adc_restore_SFR_on_ADC(void)
{
writel(data_for_ADCCON base_addr + S3C_ADCCON);
writel(data_for_ADCTSC base_addr + S3C_ADCTSC);
}
#else
static struct resource *adc_mem;
#endif

static int s3c_adc_open(struct inode *inode struct file *file)
{
return 0;
}

static unsigned int s3c_adc_convert(void)
{
unsigned int adc_return = 0;
unsigned long data0;
unsig

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       9607  2012-09-12 18:44  adc\adc_drv\adc_drv.c

     文件     103762  2012-09-12 18:43  adc\adc_drv\adc_drv.ko

     文件        279  2012-08-16 16:06  adc\adc_drv\Makefile

     文件       6399  2012-11-06 16:48  adc\adc_test\adc_test

     文件        518  2012-08-16 15:20  adc\adc_test\adc_test.c

     文件       1772  2012-11-06 16:48  adc\adc_test\adc_test.o

     文件        294  2012-08-16 14:53  adc\adc_test\Makefile

     目录          0  2013-01-13 20:16  adc\adc_drv

     目录          0  2013-01-13 20:16  adc\adc_test

     目录          0  2013-01-13 20:16  adc

----------- ---------  ---------- -----  ----

               122631                    10


评论

共有 条评论