SDL1.2 misinterpreting events from tslib via /dev/input/event0

Hello Group,

i am runnig SDL 1.2 on an embedded linux system (arm), and have problems with
the input system.
I am using the tslib for generating mouseevents.
In my SDL application i get a lot of mouse events , (MOUSEMOTION, MOUSEDOWN and
MOUSEUP)
which results in a enormous flicker of the cursor. Alot of the events SDL
delivers are
wrong. Using the tool evtest, reading out /dev/input/event0 gives reasonable
values:

evtest output for a quick tip on the touchscreen:

-bash-3.2# evtest /dev/input/event0
Input driver verevdev.c(EVIOCGBIT): Suspicious buffer size 511, limiting output
to 64 bytes. See http://userweb.kernel.org/~dtor/eviocgbit-bug.html
sion is 1.0.0
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "TPS6507x Touchscreen"
Supported events:
? Event type 0 (Sync)
? Event type 1 (Key)
??? Event code 330 (Touch)
? Event type 3 (Absolute)
??? Event code 0 (X)
??? Value??? 556
??? Min??? 0
??? Max??? 1023
??? Event code 1 (Y)
??? Value??? 515
??? Min??? 0
??? Max??? 1023
??? Event code 24 (Pressure)
??? Value??? 0
??? Min??? 0
??? Max??? 1023
Testing … (interrupt to exit)
Event: time 946686139.299316, type 1 (Key), code 330 (Touch), value 1
Event: time 946686139.302886, type 3 (Absolute), code 0 (X), value 513
Event: time 946686139.302901, type 3 (Absolute), code 1 (Y), value 517
Event: time 946686139.302912, type 3 (Absolute), code 24 (Pressure), value 229
Event: time 946686139.302922, -------------- Report Sync ------------
Event: time 946686139.329326, type 1 (Key), code 330 (Touch), value 0
Event: time 946686139.329392, type 3 (Absolute), code 24 (Pressure), value 0
Event: time 946686139.329400, -------------- Report Sync ------------
?
?
?

My SDL-app takes the following events from SDL_WaitEvent, processed by the code:
[…]
?? int tmpx,tmpy;
? if(evt->type==SDL_MOUSEMOTION)
??? {
??? SDL_GetMouseState(&tmpx,&tmpy);
??? printf(“evt MM x: %i y: %i \n”,tmpx,tmpy);
??? }
? if(evt->type==SDL_MOUSEBUTTONDOWN)
??? {
??? SDL_GetMouseState(&tmpx,&tmpy);
??? printf(“evt MBD x: %i y: %i \n”,tmpx,tmpy);
??? }
? if(evt->type==SDL_MOUSEBUTTONUP)
??? {???
??? SDL_GetMouseState(&tmpx,&tmpy);
??? printf(“evt MBU: %i y: %i \n”,tmpx,tmpy);
??? }
[…]

evt MM x: 57 y: 68
evt MM x: 57 y: 68
evt MBD x: 57 y: 68
evt MM x: 57 y: 68
evt MBU: 57 y: 68
evt MM x: 68 y: 0
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MM x: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64
evt MM x: 5 y: 64
evt MBU: 5 y: 64
evt MM x: 5 y: 64
evt MBD x: 5 y: 64

There are a lot of wrong MOUSEBUTTONDOWN and MOUSEBUTTONUP events.

Does anybody know whats going on?
Can anybody point me to the source-code of SDL whith is responsible for
misinterpreting the events?

Thank you,
regards Bastian.

P.S.

some exports:

export TSLIB_TSEVENTTYPE=INPUT
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE=/usr/local/etc/pointercal
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts

export SDL_MOUSEDRV=TSLIB
export SDL_MOUSEDEV=/dev/input/event0
export SDL_NOMOUSE=1