Add TouchScreen driver to kernel

Discuss Android on the Wandboard, as well as app development for or on the Wandboard.

Add TouchScreen driver to kernel

Postby mazze420 » Tue May 19, 2015 12:41 pm

Hi,
i want to add ARM eGalax-TouchScreen driver to WB's Android image based in 4.4.2 .. The driver is included in the WB Android 5.0 image.. i cant find some instructions in how to port the drivers into Android. I think i have to rebuild the kernel and add the driver.. But i cant find any descriptions on how to include external drivers to Android.

I hope someone can help me :roll:
mazze420
 
Posts: 6
Joined: Sun May 17, 2015 8:22 am

Re: Add TouchScreen driver to kernel

Postby Richard » Wed May 20, 2015 3:26 am

Hi, mazze420:

As I know, there are two ways to add support for eGalax TouchScreen:
1. Get kernel patches from eGalax FAE.
2. If your eGalax touch is usb interface and multi-touch.
You can try hid-multitouch driver in kernel.

Check which kernel configuration used for android:
vim wandboard-4.4.2_1-pre-source/wand-4.4.2_1/device/fsl/wandboard/BoardConfig.mk
Code: Select all
TARGET_KERNEL_DEFCONF := wandboard_android_wandcam_defconfig

Here, the kernel configuration used in android is "wandboard_android_wandcam_defconfig".

Configure and rebuild the kernel:
Code: Select all
export ARCH=arm
export CROSS_COMPILE=${PATH_of_your_android_source_code}/wandboard-4.4.2_1-pre-source/wand-4.4.2_1/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
cd ${PATH_of_your_android_source_code}/wandboard-4.4.2_1-pre-source/wand-4.4.2_1/kernel_imx
make wandboard_android_wandcam_defconfig

Enable HID-multitouch driver for eGalax touch panel in kernel:
(1)
      Device Drivers ---> HID Devices ---> Special HID Drivers  -> HID Multitouch panels  (*)
 
(2)
      Device Drivers ---> Input device support ---> Event interface    (*)find
make savedefconfig

Overwrite the old kernel configuration with new one:
cp defconfig arch/arm/configs/wandboard_android_wandcam_defconfig


If the model of eGalax touch panel you use isn't in the support list of HID-multitouch driver:
Please add it manually as following link:
[PATCH] HID: multitouch: add support for eGalax 0x7200
http://www.spinics.net/lists/linux-usb/msg63676.html


And android requires the .idc file for touch panel:
https://source.android.com/devices/inpu ... files.html
This is defined in wandboard-4.4.2_1-pre-source/wand-4.4.2_1/device/fsl/imx6/wandboard.mk
Code: Select all
# Touch panel idc files
PRODUCT_COPY_FILES +=   \
   device/fsl/common/input/eGalax_Touch_Screen.idc:system/usr/idc/prism.idc \


BR,

Richard
Richard
Site Admin
 
Posts: 137
Joined: Tue Dec 17, 2013 6:57 am

Re: Add TouchScreen driver to kernel

Postby mazze420 » Thu May 28, 2015 9:30 am

Hi Richard,
isn't the HID-Multitouch-Driver already activated in the prebuilded WB All Kitkat 4.4.2?
I'm trying to rebuild the kernel with your instructions. I'm now "making" the kernel again and wanted to swap u-boot.img on boot partition with my new generated u-boot.img .. While i was activating the drivers in the menuconfig, i was wondering why they are already chosen..
I hope i get it done..

What do you mean with the PATCH if it actually not works ? I will report soon!
mazze420
 
Posts: 6
Joined: Sun May 17, 2015 8:22 am

Re: Add TouchScreen driver to kernel

Postby mazze420 » Fri May 29, 2015 9:38 am

mazze420 wrote:Hi Richard,
isn't the HID-Multitouch-Driver already activated in the prebuilded WB All Kitkat 4.4.2?
I'm trying to rebuild the kernel with your instructions. I'm now "making" the kernel again and wanted to swap u-boot.img on boot partition with my new generated u-boot.img .. While i was activating the drivers in the menuconfig, i was wondering why they are already chosen..
I hope i get it done..

What do you mean with the PATCH if it actually not works ? I will report soon!


It does not work.. I'm trying to include drivers for the RockTouch excalibur HiD-Multitouch, Support gave me this eGalax drivers (http://www.eeti.com.tw/drivers_Linux.html)

I build successfully Android 4.4.2 with your instructions, i also rebuild the kernel with enabled hid-multitouch drivers... Any idea?
@Richard: what do you mean with patching the drivers, if they are not supported?
mazze420
 
Posts: 6
Joined: Sun May 17, 2015 8:22 am

Re: Add TouchScreen driver to kernel

Postby Richard » Mon Jun 01, 2015 3:53 am

Hello, mazze420:

The answer is in two parts: HID-multitouch and eGalax propritory userspace touch driver.

(1) For HID-multitouch driver in kernel:
Use "getenvent" command to check the event under android terminal.
And press touch panel to see if there are events generated by your eGalax touch panel.
Code: Select all
root@wandboard:/ # getevent
could not get driver version for /dev/input/mice, Not a typewriter
add device 1: /dev/input/event2
  name:     "eGalax Inc. eGalaxTouch EXC7200-75CBv1.000          "
could not get driver version for /dev/input/mouse2, Not a typewriter
add device 2: /dev/input/event1
  name:     "DELL DELL USB Laser Mouse"
could not get driver version for /dev/input/mouse1, Not a typewriter
add device 3: /dev/input/event0
  name:     "ADS7846 Touchscreen"
could not get driver version for /dev/input/mouse0, Not a typewriter
/dev/input/event2: 0003 0039 00000009
/dev/input/event2: 0003 0035 00004950
/dev/input/event2: 0003 0036 00004130
/dev/input/event2: 0001 014a 00000001
/dev/input/event2: 0003 0000 00004950
/dev/input/event2: 0003 0001 00004130

If no touch event generated by touch panel, there are some possible reasons:
1. This eGalax panel isn't in multi-touch support list, you can try to add the product id of this touch panel as following:
You can use "usbview.exe" on windows PC or "lsusb" on linux PC to get product id.
[PATCH] HID: multitouch: add support for eGalax 0x7200
http://www.spinics.net/lists/linux-usb/msg63676.html
2. Maybe this panel is just not supported by HID multi-touch driver.
I have tried two different types of eGalax touch panel so far, they are all supported by HID multi-touch.
But it still can't guarantee all kinds of eGalax touch panel can be support by HID multi-touch.

It you can get touch event by "getevent", but there is no action in android:
1. Maybe there is no .idc file.
https://source.android.com/devices/inpu ... files.html
2. You need to ensure the display output is used the same display panel as touch panel.
e.g.
The display is ouput to HDMI 21" LCD monitor, but the USB touch panel is 7".
It will cause the display coordinate doesn't match the touch coordinate.

I have a 7"inch eGalax touch panel with product id 0x7200, it can work in wandboard android 4.4.2 prebuilt image:
I just need to replace the /boot/uEnv.txt with /settings/uEnv_fairy_lvds_wsvga.txt to apply LCD settings to 7" LVDS.
Then the touch panel can work well without kernel modification.

(2) eGalax propritory userspace touch driver:
First, I remember android requires the different version of user space touch driver than general linux.
I'm not sure it this is because that android uses "bionic C" library rather than standard C library.
So, it you wand to contact eGalax FAE, you need to ask for "Android" version user space touch driver.
Although eGalax propritory driver is user space driver, it gets coordinate from /hidraw.
To prevent the usb touch panel being recognized as mouse, joystick to generate event to disturb the behavior of touch.
eGalax provides a kernel patch to add eGalax touch panel into blacklist.
That's why the touch driver is user space driver, but still needs kernel patch.
The eGalax user space touch driver will run as a service under android.
So you also need to tweak android a little bit to add this service into init.rc to let it run at boot up.

BR,

Richard
Richard
Site Admin
 
Posts: 137
Joined: Tue Dec 17, 2013 6:57 am

Re: Add TouchScreen driver to kernel

Postby mazze420 » Mon Jun 01, 2015 10:45 am

Hi Richard,
the touchscreen does not get recognized by my linux-vm, mac or windows pc. I does not have a serial-port-cable so i tested "getevent" directly on my rooted wandboard kitkat with BusyBox.
lsusb give me the following id for my touchpanel: "ID 0eef:c000"
Testing the touchpanel with getevent.c was successfull, when i'm touching the touch gets recognized and the terminal shows collumns of touch event (containing touchposition i think), like in your last post shown.

When i'm checking connected devices with getevent, this is the following output:
add device 1: /dev/input/event2
name: „eGalax Inc. eGalaxTouch EXC3000-0337-44.00.00“
add device 2: /dev/input/event0
name: „ADS7846 Touchscreen"

..when i am reconnecting the touch-panel, only add device 1 with the specific information is displayed
Conclusion: My panel gets definetly recognized by the wandboard and the linux kernel, only android does not recognize it or does not know how to handle the movements.. How to create a specific .idc for this panel? Do i need some more drivers?
My Panel and Screen are compatible. I have a 10.1" RockTouch xcalibur touchpanel and a IPS 10.1" Display.

I do not understand your instructionpart (2) with the egalax touch driver userspace for android... I don't know how to handle this or get the userspace for android :/

I also can not explain, why the hack the panel works like charm with your WB ALL Lollipop Image.. May the image contain the correct .idc file? Can i maybe export the hid drivers from the lollipop image to the kitkat image?
mazze420
 
Posts: 6
Joined: Sun May 17, 2015 8:22 am

Re: Add TouchScreen driver to kernel

Postby Richard » Wed Jun 03, 2015 7:49 am

Hello, mazze420:

I think you are right.
I have two eGalax touch panel(0x7200 and 0xc000). (0xc000 is the same as yours.)
After reading your post, I did some experiments.
I use yocto as rootfs and evtest to get the event from touch panel in linux 3.0.35 and 3.10.53.
The kernels are modified to add PID(0x7200 and 0xc000) in hid multitouch driver.(pls check attachment)


Conclusion:
In linux 3.10.53: Both 0x7200 and 0xc000 work and get correct event.
In linux 3.0.35: only 0x7200 works, and 0xc000 gets no events.

It seems that there is problem for 0xc000 in linux 3.0.35.
In android 4.4.2, I use "getevent" and get no events from 0xc000 touch panel.

I guess 0xc000 touch panel has compatibility issue in linux 3.0.35 and maybe it requires more patches to get it work.

If it's true. As I describe in previous post in instructionpart (2), I would suggest to contact eGalax FAE to get their proprietary user space touch driver.
Use the driver they provide may make things easier...
Attachments
egalax_3160.patch
(1.92 KiB) Downloaded 126 times
Richard
Site Admin
 
Posts: 137
Joined: Tue Dec 17, 2013 6:57 am

Re: Add TouchScreen driver to kernel

Postby mazze420 » Wed Jun 03, 2015 9:42 am

Hi Richard,
thank you very much for taking time and help me so much ... it is still not working, but i believe that the kernel version is the current problem.. after rebuilding again, no input shown in getevent, also not the name: "eGalax TouchScreen EXC-300" ...
Can i rebuild Kitkat on a linux kernel with version 3.10 upwards? or the newest 3.10.17 kernel?

I also patched the hid-files by myself, i did the same thing , but not defined the constant in hid-ish.h.. Relating to my VID:PID i write the ID's directly as parameters in the hid-core and hid-multitouch .. Rebuilded and still no luck:( .. So i think its relating to the kernel version, why the driver still not works..

I have already contact eGalax, they send me drivers but there is also the hint, "KERNEL VERSION 3.8 upwards" or KERNEL VERSION 2.9 downwards" ... so maybe the panel is not compatible with the linux kernel.

It would be great, if i could rebuild the kernel with same approach on newer kernel version...

mazze420
mazze420
 
Posts: 6
Joined: Sun May 17, 2015 8:22 am

Re: Add TouchScreen driver to kernel

Postby Richard » Thu Jun 04, 2015 2:55 am

mazze420 wrote:Can i rebuild Kitkat on a linux kernel with version 3.10 upwards? or the newest 3.10.17 kernel?

Hello, mazze420:

For freescale android, It is highly tied with GPU driver.
https://community.freescale.com/docs/DOC-93612
The surfaceflinger utilizes GPU to render to accelerate android UI.

For existing GA release of linux kernel and android from freescale, the corresponding GPU version is as following:
1.Android 4.3, 4.4.2 -> linux 3.0.35 -> GPU 4.6.9 p12
2.Android 4.4.3, Android 5 -> linux 3.10.53 -> GPU v5.0.11p4.1

If the version of GPU driver doesn't match the GPU library used in android, it may cause the surfaceflinger fail.

BR,

Richard
Richard
Site Admin
 
Posts: 137
Joined: Tue Dec 17, 2013 6:57 am

Re: Add TouchScreen driver to kernel

Postby Karrahahu1 » Sat Feb 06, 2016 12:05 pm

it is still not working, but i believe that the kernel version is the current problem.. after rebuilding again, no input shown in getevent, also not the name: "eGalax TouchScreen EXC-300" ... ???
Karrahahu1
 
Posts: 1
Joined: Sat Feb 06, 2016 11:15 am

Next

Return to Software - Android

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests