Linux?μ??????????
???????????? ???????[ 2013/1/10 10:03:12 ] ????????
????????????????????
?????????????????????????????????????????????????ò??????????潲???????Mini2440??????????????????????????????豸?????????????????豸??????????豸??????????????????linu2.6.32.2???汾?е???????????????н??豸?????????????????????????????????????????????????????????????????????????о??????????????LED?????????????????豸??????д???????????£????????豸????????????????????????????????????????з????豸???????????????????豸?????????з???
??????????′???????????????????????????????′???????????????????????????????????????????????????????????仯?????????INT_TC?ж????????????????????CPU????????£????????????????????????????????????????????AD?????????????X??Y???????????????????????????????????????????INT_ADC?ж?????????????????????????????????′????λ?á?
??????????????????????
????????????????????????????????????????????????????????????????д??????????е??????????α????????????????????????η?????????????????????????????????????????????
????????????/driver/input/touchscreen/s3c2410_ts.c
static int __init s3c2410ts_init(void)
{
struct input_dev *input_dev;
adc_clock = clk_get(NULL?? "adc"); //??????
if (!adc_clock) {
printk(KERN_ERR "failed to get adc clock source
");
return -ENOENT;
}
clk_enable(adc_clock); //??????
base_addr=ioremap(S3C2410_PA_ADC??0x20); //??????????????
if (base_addr == NULL) {
printk(KERN_ERR "Failed to remap register block
");
return -ENOMEM;
}
s3c2410_ts_connect(); //?????????????
//????????????????0xff
iowrite32(S3C2410_ADCCON_PRSCEN| S3C2410_ADCCON_PRSCVL(0xFF)??base_addr+S3C2410_ADCCON);
iowrite32(0xffff?? base_addr+S3C2410_ADCDLY); //???
//????????ж?????????ж?
iowrite32(WAIT4INT(0)?? base_addr+S3C2410_ADCTSC);
input_dev = input_allocate_device(); //????input?豸
if (!input_dev) {
printk(KERN_ERR "Unable to allocate the input device !!
");
return -ENOMEM;
}
dev = input_dev;
//??????????????????
dev->evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS);
dev->keybit[BITS_TO_LONGS(BTN_TOUCH)] = BIT(BTN_TOUCH);
//????X??Χ??0-ox3ff???????????0?????????λ????0
input_set_abs_params(dev?? ABS_X?? 0?? 0x3FF?? 0?? 0);
input_set_abs_params(dev?? ABS_Y?? 0?? 0x3FF?? 0?? 0);
input_set_abs_params(dev?? ABS_PRESSURE?? 0?? 1?? 0?? 0);
dev->name = s3c2410ts_name;
dev->id.bustype = BUS_RS232;
dev->id.vendor = 0xDEAD;
dev->id.product = 0xBEEF;
dev->id.version = S3C2410TSVERSION;
//????AD????ж?
if(request_irq(IRQ_ADC??stylus_action??IRQF_SHARED|IRQF_SAMPLE_RANDOM??"s3c2410_action"?? dev)) {
printk(KERN_ERR "s3c2410_ts.c: Could not allocate ts IRQ_ADC !
");
iounmap(base_addr);
return -EIO;
}
//???????ж?
if (request_irq(IRQ_TC?? stylus_updown?? IRQF_SAMPLE_RANDOM??
"s3c2410_action"?? dev)) {
printk(KERN_ERR "s3c2410_ts.c: Could not allocate ts IRQ_TC !
");
iounmap(base_addr);
return -EIO;
}
printk(KERN_INFO "%s successfully loaded
"?? s3c2410ts_name);
input_register_device(dev);
return 0;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11