Check first whether this file exists on your system: /data/misc/tscal/pointercal
If it doesn't, execute the following commands in "adb shell":
mkdir -p /data/misc/tscal
touch /data/misc/tscal/pointercal
chown 1000.1000 /data/misc/tscal /data/misc/tscal/*
chmod 775 /data/misc/tscal
chmod 664 /data/misc/tscal/pointercal
Finally execute:
adb shell am start -n org.zeroxlab.util.tscal/.TSCalibration
I have a device with eGalax touchscreen, and although it's properly calibrated, I can miscalibrate it using the calibration app, in particular I can flip axis. So hopefully this will allow you to get your touchscreen properly calibrated.
Note that the file /data/misc/tscal/pointercal is expected to be created at boot, but it only occurs on specific hardware (product or touchscreen). The logic is located in this file around line 308:
Michael.