4-wire TS interface on mini6410

genpix
For about a week, I'm trying (without success) to make 4-wire touchscreen
work with mini6410. 
Looks like kernel does have a support for 4-wire interface
(CONFIG_TOUCHSCREEN_MINI6410):
Menuconfig:
     Device Drivers --->
            Input device support  ---> 
                 [*]   Touchscreens  ---> 
                       <*>   S3C touchscreen driver for Mini6410 

And I do see that touchscreen event data are received by this driver, when
I touch a screen, and wait for fraction of a second (the console is flooded
with "buffer full" messages):
mini6410-ts: touch event buffer full

and they are streaming as long as I have touchscreen touched.
When I remove my finger, messages stop.

But for the life of me, I can not find a way how to redirect these data
(events?) to the driver which can interpret them.

I tried tslib library and plugins which come with FriendlyArm toolchain
(arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz), and I tried to install them with
"apt-get install tslib libts-bin".

Nothing seems to work so far.
Is this 4-wire touch-screen driver actually working?

Juergen Beisert
tslib uses the environment variable TSLIB_TSDEVICE to get an "idea" what
the input device node is. It should point to an event device node (like
"/dev/input/event0" for example).
And its "/etc/ts.conf" which should have in its first line "module_raw
input" to define it should read "events" provided by the kernel driver.

genpix
obviously, I started from that configuration (as this tslib configuration
is used with all normal kernel drivers). 

here is my /etc/ts.conf :

module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=10000
module linear

And here are my environmental variables (in .bashrc):

export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_PLUGINDIR=/usr/lib/ts

(I guess, since last three are using the default tslib values, thy are not
necessary; I have them just in case).

And this is what happening after I try to execute "ts_calibrate"

root@genpix:~# ts_calibrate
xres = 800, yres = 480
tslib: Selected device is not a Linux input event device

and when I touch the screen I see the endless flood of these lines (until I
remove my finger from the touchscreen)

mini6410-ts: touch event buffer full
mini6410-ts: touch event buffer full
mini6410-ts: touch event buffer full
.....

I tried to use /dev/touchscreen (since /dev/touchscreen was created by
mini64-ts module) instead of /dev/input/event0. Absolutely the same error
(tslib: Selected device is not a Linux input event device).

Keep in mind, this was done using tslib (library and plugins) copied from
FriendlyArm's toolschain (arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz), the
very same toolschain which I used to compile the kernel.

genpix
then I run "sudo apt-get install tslib libts-bin" to install precompiled
library, plugins and tools.
Since, installer put the library files in the new folder, I had to edit my
variable accordingly:

export TSLIB_PLUGINDIR=/usr/lib/ts0

This is what happening after I execute "ts_calibrate":

root@genpix:~# ts_calibrate
xres = 800, yres = 480
selected device is not a touchscreen I understand
Took 4 samples...
Top left : X =    0 Y = 537009771
Took 4 samples...
Top right : X =    0 Y = 537009771
Took 4 samples...
Bot right : X =    0 Y = 537009771
Took 4 samples...
Bot left : X =    0 Y = 537009771
Took 4 samples...
Center : X =    0 Y = 537009771
ts_calibrate: determinant is too small -- 0.000000
Calibration failed.

btw, plugins provided by FriendlyArm toolschain are incompatible with
downloaded tslib.
I get a segmentation fault if I use the old plugins (if I use "export
TSLIB_PLUGINDIR=/usr/lib/ts" instead of "export
TSLIB_PLUGINDIR=/usr/lib/ts0").

And yeah, I still have the endless lines (when I keep poking the
touchscreen):
mini6410-ts: touch event buffer full
mini6410-ts: touch event buffer full
.....

genpix
looking at the older kernel versions provided by FriendlyArm on their DVD
(or FTP site), I see 2.6.28.
And looks like that version did not even had 1-wire TS driver yet (only
standard 4-wire interface, S3C TS was used).
Also, there is a custom library friendlyarm-ts-input.so sitting in the same
folder as all other tslib plugins (/usr/local/lib/ts/).

I assume that custom driver is dealing with proper redirection of touch
screen events to the normal block devices of running kernel.

But NOWHERE I can find a source for that friendlyarm-ts-input. Why
FriendlyArm keeps it as a close source?

PS: I compiled that old kernel (2.6.28), burned it into the flash, created
SD with ext3 and copied FriendlyArm's rootfs (rtm) to it. But I can not
boot to it (kernel panic when kernel tries to mount this SD card as /).

probably, some different kernel command-line parameters should be used with
2.8.28. But I can not find FriendlyArm's instructions for that.

And Friendly Arm does not answer any of my questions. We planned to use
mini6410 in our design, but Friendly Arm is not interested in our company
as a customer. We may need to toss mini6410 and find some alternative :(

genpix
one more iteration:
if I install only a public tslib, and use friendlyarm's closed source
ts_calibrate (that is, I use only "sudo apt-get install tslib", and I do
not install libts-bin):

root@genpix:~# ts_calibrate
xres = 800, yres = 480
tslib: Selected device uses a different version of the event protocol than
tslib was compiled for

Tolun ARDAHANLI
Hi genpix;

My calibration output is as shown below. it is working on self
compiled/created uboot + kernel + rootFS. 

How can we use this result on X server?

# ts_calibrate
xres = 800, yres = 480
selected device is not a touchscreen I understand
Took 2 samples...
Top left : X = -548038600 Y = -548038485
Took 2 samples...
Top right : X = -548038600 Y = -548038485
Took 2 samples...
Bot right : X = -548038600 Y = -548038485
Took 2 samples...
Bot left : X = -548038600 Y = -548038485
Took 2 samples...
Center : X = -548038600 Y = -548038485
0.314015 0.000010 -0.000011
0.188409 0.000006 -0.000007
Calibration constants: 20579 0 0 12347 0 0 65536

Juergen Beisert
For X you need the tslib evdev-input-device for the X-Server