欢迎来到天天文库
浏览记录
ID:14387164
大小:44.00 KB
页数:20页
时间:2018-07-28
《linux-2.6.30.4在2440上的移植之触摸屏驱动 博文》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Linux-2.6.30.4在2440上的移植之触摸屏驱动博文http://blog.chinaunix.net/u3/101649/showart_2085414.html嵌入式Linux之我行——Linux-2.6.30.4在2440上的移植之触摸屏驱动嵌入式Linux之我行,主要讲述和总结了本人在学习嵌入式linux中的每个步骤。一为总结经验,二希望能给想入门嵌入式Linux的朋友提供方便。如有错误之处,谢请指正。共享资源,欢迎转载:http://hbhuanggang.cublog.cn一、移植环境主机:VMWare--Fedora9开发板:Mini2440--64MBNand编译器:
2、arm-linux-gcc-4.3.2二、移植步骤1.准备驱动源码。因为linux-2.6.30.4内核中没有提供合适的ADC驱动和触摸屏驱动,所以这里就直接用友善提供的驱动s3c24xx-adc.h#ifndef_S3C2410_ADC_H_#define_S3C2410_ADC_H_#defineADC_WRITE(ch,prescale)((ch)<<16
3、(prescale))#defineADC_WRITE_GETCH(data)(((data)>>16)&0x7)#defineADC_WRITE_GETPRE(data)((data)&0xff)#endif/*_S3C2410_A
4、DC_H_*/mini2440_adc.c#include#include#include#include#include#include#include#include#include#include#include#include#include5、regs-clock.h>#include#include#include#include#include#include"s3c24xx-adc.h"#undefDEBUG//#defineDEBUG#ifdefDEBUG#defineDPRINTK(x...){printk(__FUNCTION__"(%d):",__LINE__);printk(##x);}#else#defineDPRINTK(x...)(voi6、d)(0)#endif#defineDEVICE_NAME"adc"staticvoid__iomem*base_addr;typedefstruct{wait_queue_head_twait;intchannel;intprescale;}ADC_DEV;DECLARE_MUTEX(ADC_LOCK);staticintOwnADC=0;staticADC_DEVadcdev;staticvolatileintev_adc=0;staticintadc_data;staticstructclk*adc_clock;#defineADCCON(*(volatileunsignedlong*)7、(base_addr+S3C2410_ADCCON))//ADCcontrol#defineADCTSC(*(volatileunsignedlong*)(base_addr+S3C2410_ADCTSC))//ADCtouchscreencontrol#defineADCDLY(*(volatileunsignedlong*)(base_addr+S3C2410_ADCDLY))//ADCstartorIntervalDelay#defineADCDAT0(*(volatileunsignedlong*)(base_addr+S3C2410_ADCDAT0))//ADCconversiond8、ata0#defineADCDAT1(*(volatileunsignedlong*)(base_addr+S3C2410_ADCDAT1))//ADCconversiondata1#defineADCUPDN(*(volatileunsignedlong*)(base_addr+0x14))//StylusUp/Downinterruptstatus#definePRESCALE_DIS(0<<
5、regs-clock.h>#include#include#include#include#include#include"s3c24xx-adc.h"#undefDEBUG//#defineDEBUG#ifdefDEBUG#defineDPRINTK(x...){printk(__FUNCTION__"(%d):",__LINE__);printk(##x);}#else#defineDPRINTK(x...)(voi
6、d)(0)#endif#defineDEVICE_NAME"adc"staticvoid__iomem*base_addr;typedefstruct{wait_queue_head_twait;intchannel;intprescale;}ADC_DEV;DECLARE_MUTEX(ADC_LOCK);staticintOwnADC=0;staticADC_DEVadcdev;staticvolatileintev_adc=0;staticintadc_data;staticstructclk*adc_clock;#defineADCCON(*(volatileunsignedlong*)
7、(base_addr+S3C2410_ADCCON))//ADCcontrol#defineADCTSC(*(volatileunsignedlong*)(base_addr+S3C2410_ADCTSC))//ADCtouchscreencontrol#defineADCDLY(*(volatileunsignedlong*)(base_addr+S3C2410_ADCDLY))//ADCstartorIntervalDelay#defineADCDAT0(*(volatileunsignedlong*)(base_addr+S3C2410_ADCDAT0))//ADCconversiond
8、ata0#defineADCDAT1(*(volatileunsignedlong*)(base_addr+S3C2410_ADCDAT1))//ADCconversiondata1#defineADCUPDN(*(volatileunsignedlong*)(base_addr+0x14))//StylusUp/Downinterruptstatus#definePRESCALE_DIS(0<<
此文档下载收益归作者所有