3

我已經從github(https://github.com/kergoth/tslib/commits/master)交叉編譯了tslib的最新提交。我的觸摸屏連接到我的嵌入式主板,並啓用了供應商提供的驅動程序。當我啓動並查看'cat/dev/input/touchscreen'的輸出時,我可以看到大量的輸出是通過在屏幕上移動我的手指而產生的。內核還向控制檯輸出針對「finger1」和「finger2」的格式良好的消息。已安裝觸摸屏和驅動程序,但tslib無法校準

但我無法校準。當我設置我的環境變量如下圖所示並運行ts_calibrate時,它會吐出消息'xres = 640,yres = 480 tslib:所選設備不是觸摸屏(必須支持ABS和KEY事件類型)',並且什麼都不做。

因此,Linux知道我的設備存在,我可以看到滾動輸出,但tslib無法校準。我做錯了什麼,我該如何解決這個問題?

# ls -rlt /dev/input/touchscreen 
lrwxrwxrwx 1 root  root    6 Jan 17 21:06 /dev/input/touchscreen -> event1 
# chmod 777 /dev/input/touchscreen 
# chmod 777 /dev/input/event1 

# cat /dev/input/touchscreen | hexdump 
0000000 9011 3883 565f 0001 0003 0030 0001 0000 
0000010 9011 3883 565f 0001 0003 0032 0001 0000 
0000020 9011 3883 565f 0001 0003 0035 04c9 0000 
0000030 9011 3883 565f 0001 0003 0036 0c3f 0000 
0000040 9011 3883 565f 0001 0000 0002 0000 0000 
0000050 9011 3883 565f 0001 0000 0000 0000 0000 
0000060 9011 3883 90a9 0001 0003 0030 0001 0000 
0000070 9011 3883 90a9 0001 0003 0032 0001 0000 

# cat /sys/devices/virtual/input/input1/uevent 
PRODUCT=0/0/0/0 
NAME="aura-touchscreen" 
PROP=0 
EV=9 
ABS=650000 0 
MODALIAS=input:b0000v0000p0000e0000-e0,3,kra30,32,35,36,mlsfw 

# cat /etc/ts.conf 
# Uncomment if you wish to use the linux input layer event interface 
module_raw input 
module pthres pmin=1 
module variance delta=30 
module dejitter delta=100 
module linear 

export TSLIB_TSEVENTTYPE=INPUT 
export TSLIB_TSDEVICE=/dev/input/touchscreen 
export TSLIB_CALIBFILE=/etc/pointercal 
export TSLIB_CONFFILE=/etc/ts.conf 
export TSLIB_PLUGINDIR=/usr/lib/ts 
export TSLIB_FBDEVICE=/dev/fb0 
export TSLIB_CONSOLEDEVICE=none 
export TSTS_INFO_FILE=/sys/devices/virtual/input/input1/uevent 
export QWS_MOUSE_PROTO=tslib:/dev/input/touchscreen 
export PATH=$PATH:/usr/bin 
ts_calibrate 
xres = 640, yres = 480 
tslib: Selected device is not a touchscreen (must support ABS and KEY event types) 

有趣的,如果我做「貓的/ proc /巴士/輸入/設備」,那麼我可以看到我的觸摸屏,但只有一個ABS項目(無鑰匙)tslib的說,我既需要。我可以以某種方式在這裏分配一個'KEY'條目嗎?

# cat /proc/bus/input/devices 
I: Bus=0019 Vendor=0001 Product=0001 Version=0003 
N: Name="TWL4030 Keypad" 
P: Phys=twl4030_keypad/input0 
S: Sysfs=/devices/platform/omap/omap_i2c.1/i2c-1/1-004a/twl4030_keypad/input/input0 
U: Uniq= 
H: Handlers=kbd event0 
B: PROP=0 
B: EV=100013 
B: KEY=ffc 
B: MSC=10 

I: Bus=0000 Vendor=0000 Product=0000 Version=0000 
N: Name="aura-touchscreen" 
P: Phys= 
S: Sysfs=/devices/virtual/input/input1 
U: Uniq= 
H: Handlers=event1 
B: PROP=0 
B: EV=9 
B: ABS=650000 0 

回答

2

嘗試添加

input_dev = input_allocate_device(); 
[..] 
set_bit(EV_ABS, input_dev->evbit); 
set_bit(EV_KEY, input_dev->evbit); 

從而使tslib的認爲該設備同時支持EV_ABS和EV_KEY事件(即使它實際上並沒有同時發送的那些)。

你知道如何到達我,如果你還有其他問題...;)

+0

謝謝 - 我添加了以下內容,以獲得ts_calibrate不抱怨設備不是觸摸屏:set_bit(EV_KEY,aura.input_dev-> evbit); set_bit(ABS_X,aura.input_dev-> absbit); set_bit(ABS_Y,aura.input_dev-> absbit); set_bit(BTN_TOUCH,aura.input_dev-> keybit); 我仍在努力讓ts_calibrate接受輸入。 – PhilBot 2012-08-14 14:25:04

0

tslib: Selected device is not a touchscreen (must support ABS and KEY event types) 

我在觸摸屏添加

set_bit(EV_SYN, aura.input_dev->evbit); 
set_bit(EV_ABS, aura.input_dev->evbit); 
set_bit(EV_KEY, aura.input_dev->evbit); 
# I had to add this line so that tslib was happy 

完全一樣的問題司機但仍然有同樣的問題。我無法校準觸摸屏。請給出建議。

static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id *id) 
{ 
    s32 ret = -1; 
    struct goodix_ts_data *ts; 
    u16 version_info; 

    GTP_DEBUG_FUNC(); 
    set_bit(EV_SYN, aura.input_dev->evbit); 
set_bit(EV_ABS, aura.input_dev->evbit); 
set_bit(EV_KEY, aura.input_dev->evbit); # I had to add this line so that tslib was happy 
    //do NOT remove these output log 
    GTP_INFO("GTP Driver Version:%s",GTP_DRIVER_VERSION); 
    GTP_INFO("GTP Driver [email protected]%s,%s", __TIME__,__DATE__); 
    GTP_INFO("GTP I2C Address:0x%02x", client->addr); 

    i2c_connect_client = client; 
    if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 
    { 
     GTP_ERROR("I2C check functionality failed."); 
     return -ENODEV; 
    } 
    ts = kzalloc(sizeof(*ts), GFP_KERNEL); 
    if (ts == NULL) 
    { 
     GTP_ERROR("Alloc GFP_KERNEL memory failed."); 
     return -ENOMEM; 
    } 

    memset(ts, 0, sizeof(*ts)); 
    INIT_WORK(&ts->work, goodix_ts_work_func); 
    ts->client = client; 
    i2c_set_clientdata(client, ts); 
    ts->irq_lock = SPIN_LOCK_UNLOCKED; 
    ts->gtp_rawdiff_mode = 0; 

    ret = gtp_request_io_port(ts); 
    if (ret < 0) 
    { 
     GTP_ERROR("GTP request IO port failed."); 
     kfree(ts); 
     return ret; 
    } 

    ret = gtp_i2c_test(client); 
    if (ret < 0) 
    { 
     GTP_ERROR("I2C communication ERROR!"); 
    } 

#if GTP_AUTO_UPDATE 
    //ret = gup_init_update_proc(ts); 
    //if (ret < 0) 
    //{ 
     //GTP_ERROR("Create update thread error."); 
    //} 
#endif 

    ret = gtp_init_panel(ts); 
    if (ret < 0) 
    { 
     GTP_ERROR("GTP init panel failed."); 
    } 

    ret = gtp_request_input_dev(ts); 
    if (ret < 0) 
    { 
     GTP_ERROR("GTP request input dev failed"); 
    } 

    ret = gtp_request_irq(ts); 
    if (ret < 0) 
    { 
     GTP_INFO("GTP works in polling mode."); 
    } 
    else 
    { 
     GTP_INFO("GTP works in interrupt mode."); 
    } 

    ret = gtp_read_version(client, &version_info); 
    if (ret < 0) 
    { 
     GTP_ERROR("Read version failed."); 
    } 
    spin_lock_init(&ts->irq_lock); 
    ts->irq_lock = SPIN_LOCK_UNLOCKED; 

    gtp_irq_enable(ts); 

#if GTP_CREATE_WR_NODE 
    //init_wr_node(client); 
#endif 

#if GTP_ESD_PROTECT 
    INIT_DELAYED_WORK(&gtp_esd_check_work, gtp_esd_check_func); 
    gtp_esd_check_workqueue = create_workqueue("gtp_esd_check"); 
    queue_delayed_work(gtp_esd_check_workqueue, &gtp_esd_check_work, GTP_ESD_CHECK_CIRCLE); 
#endif 

    return 0; 
} 
0

這基本上是舊版tslib中的一個bug。最近的版本應該沒有問題。

相關問題