RK3288 USB觸摸屏(hid設備)沒法使用,須要添加PID和VID

 RK3288  Android5.1git

 

現象:USB 接口觸摸屏插到板子上,觸摸屏沒法使用,有可能出現更奇葩的,同一套代碼,有的板子能夠用,有的板子不能用。數組

 

一、打開串口調試,插上觸摸屏,讀取觸摸屏的 PID(idVendor) 和 VID(idProduct)。spa

[   37.456833] usb 3-1.1.1: new full-speed USB device number 4 using usb20_host [ 37.558583] usb 3-1.1.1: New USB device found, idVendor=1ff7, idProduct=0013 [ 37.558785] usb 3-1.1.1: New USB device strings: Mfr=1, Product=0, SerialNumber=0 [ 37.558915] usb 3-1.1.1: Manufacturer: CVTouch [ 37.588785] input: CVTouch as /devices/ff540000.usb/usb3/3-1/3-1.1/3-1.1.1/3-1.1.1:1.0/input/input4 [ 37.593900] hid-multitouch 0003:1FF7:0013.0001: input,hiddev0,hidraw0: USB HID v1.11 Pointer [CVTouch] on usb-ff540000.usb-1.1.1/input0

 

二、在 hid-ids.h 文件中定義此觸摸屏的 PID 和 VID。3d

diff --git a/kernel/drivers/hid/hid-ids.h b/kernel/drivers/hid/hid-ids.h index 45c593d..fe49ad2 100755
--- a/kernel/drivers/hid/hid-ids.h +++ b/kernel/drivers/hid/hid-ids.h @@ -235,9 +235,6 @@ #define USB_VENDOR_ID_CREATIVELABS     0x041e
 #define USB_DEVICE_ID_PRODIKEYS_PCMIDI 0x2801
+ 
+#define USB_VENDOR_ID_CVTOUCH          0x1ff7
+#define USB_DEVICE_ID_CVTOUCH_SCREEN   0x0013

 #define USB_VENDOR_ID_CYGNAL           0x10c4
 #define USB_DEVICE_ID_CYGNAL_RADIO_SI470X      0x818a

 

三、將定義的 PID 和 VID 添加到 HID 特殊設備數組中。調試

diff --git a/kernel/drivers/hid/hid-core.c b/kernel/drivers/hid/hid-core.c index 2bd798a..250fc52 100755
--- a/kernel/drivers/hid/hid-core.c +++ b/kernel/drivers/hid/hid-core.c @@ -2223,6 +2223,7 @@ static const struct hid_device_id hid_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CVTOUCH, USB_DEVICE_ID_CVTOUCH_SCREEN) }, { } };

 

四、在多點觸摸模塊的 mt_devices 數組中加入 id,便可支持此觸摸屏code

diff --git a/kernel/drivers/hid/hid-multitouch.c b/kernel/drivers/hid/hid-multitouch.c old mode 100755
new mode 100644 index fb9ac12..52ef0ba --- a/kernel/drivers/hid/hid-multitouch.c +++ b/kernel/drivers/hid/hid-multitouch.c @@ -1414,6 +1414,11 @@ static const struct hid_device_id mt_devices[] = { MT_USB_DEVICE(USB_VENDOR_ID_ZYTRONIC, USB_DEVICE_ID_ZYTRONIC_ZXY100) }, +       /* TOUCH panels */
+       { .driver_data = MT_CLS_DEFAULT, + MT_USB_DEVICE(USB_VENDOR_ID_CVTOUCH, + USB_DEVICE_ID_CVTOUCH_SCREEN) }, +
        /* Generic MT device */ { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) }, { }
相關文章
相關標籤/搜索