|
楼主 |
发表于 2009-4-16 15:44:55
|
显示全部楼层
谢谢你,我修改之后还有如下错误,ts 还是不能用,
ts: Compaq touchscreen protocol output
Entering s3c2410ts_init
got and enabled clock
ERROR: s3c2410x_io_write_word(0x58000000) = 0x00004c40
ERROR: s3c2410x_io_write_word(0x5800000 = 0x00002710
ERROR: s3c2410x_io_write_word(0x58000004) = 0x000000d3
s3c2410 TouchScreen successfully loaded
input: s3c2410 TouchScreen as /class/input/input0
另外: 我用的skyeye 1.2.6,
armlinux 2.6.18
模拟 s3c2410
s3c2410ts_probe()如下
static int __init s3c2410ts_probe(struct device *dev)
{
struct s3c2410_ts_mach_info *info;
info = ( struct s3c2410_ts_mach_info *)dev->platform_data;
if (!info)
{
printk(KERN_ERR "Hm... too bad : no platform data for ts\n");
return -EINVAL;
}
#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG
printk(DEBUG_LVL "Entering s3c2410ts_init\n");
#endif
memset(&ts, 0, sizeof(struct s3c2410ts));
ts.dev = *(input_allocate_device());
if (!&ts.dev)
{
printk(KERN_ERR "%s:%s allocate_device\n", __FUNCTION__, __FILE__);
return -ENOMEM;
}
adc_clock = clk_get(NULL, "adc");
if (!adc_clock)
{
printk(KERN_ERR "failed to get adc clock source\n");
return -ENOENT;
}
//clk_use(adc_clock);
clk_enable(adc_clock);
#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG
printk(DEBUG_LVL "got and enabled clock\n");
#endif
base_addr=ioremap(S3C2410_PA_ADC,0x20); //映射触摸屏的控制寄存器
if (base_addr == NULL)
{
printk(KERN_ERR "Failed to remap register block\n");
return -ENOMEM;
}
/* Configure GPIOs */
s3c2410_ts_connect();
if ((info->presc&0xff) > 0)
writel(S3C2410_ADCCON_PRSCEN | S3C2410_ADCCON_PRSCVL(info->presc&0xFF),base_addr+S3C2410_ADCCON);
else
writel(0,base_addr+S3C2410_ADCCON);
/* Initialise registers */
if ((info->delay&0xffff) > 0)
writel(info->delay & 0xffff, base_addr+S3C2410_ADCDLY);
writel(WAIT4INT(0), base_addr+S3C2410_ADCTSC);
/* Initialise input stuff */
//memset(&ts, 0, sizeof(struct s3c2410ts));
//init_input_dev(&ts.dev);
ts.dev.evbit[0] = ts.dev.evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS);
ts.dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
input_set_abs_params(&ts.dev, ABS_X, 0, 0x3FF, 0, 0);
input_set_abs_params(&ts.dev, ABS_Y, 0, 0x3FF, 0, 0);
input_set_abs_params(&ts.dev, ABS_PRESSURE, 0, 1, 0, 0);
sprintf(ts.phys, "ts0");
ts.dev.private = &ts;
ts.dev.name = s3c2410ts_name;
ts.dev.phys = ts.phys;
ts.dev.id.bustype = BUS_RS232;
ts.dev.id.vendor = 0xDEAD;
ts.dev.id.product = 0xBEEF;
ts.dev.id.version = S3C2410TSVERSION;
ts.shift = info->oversampling_shift;
/* Get irqs */
if (request_irq(IRQ_ADC, stylus_action, SA_SAMPLE_RANDOM,"s3c2410_action", &ts.dev))
{
printk(KERN_ERR "s3c2410_ts.c: Could not allocate ts IRQ_ADC !\n");
iounmap(base_addr);
return -EIO;
}
if (request_irq(IRQ_TC, stylus_updown, SA_SAMPLE_RANDOM,"s3c2410_updown", &ts.dev))
{
printk(KERN_ERR "s3c2410_ts.c: Could not allocate ts IRQ_TC !\n");
iounmap(base_addr);
return -EIO;
}
printk(KERN_INFO "%s successfully loaded\n", s3c2410ts_name);
/* All went ok, so register to the input system */
input_register_device(&ts.dev);
return 0;
} |
|