xserver-kdrive-common: add Ts_Calibrat script for Xorg
authorMartin Jansa <Martin.Jansa@gmail.com>
Wed, 18 Nov 2009 13:10:49 +0000 (14:10 +0100)
committerMartin Jansa <Martin.Jansa@gmail.com>
Tue, 22 Dec 2009 12:42:27 +0000 (13:42 +0100)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
recipes/xserver-kdrive-common/xserver-kdrive-common/Xserver
recipes/xserver-kdrive-common/xserver-kdrive-common/shr/89xTs_Calibrate [new file with mode: 0644]

index 584cb0a..2e0db5b 100644 (file)
@@ -49,10 +49,13 @@ if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ]; then
   ARGS="$ARGS -mouse /dev/touchscreen/ucb1x00"
 fi
 
-# use usb mouse if present
-# Xorg doesn't support "-mouse" option, and uses /dev/input/mice automatically
-if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/input/mice ] && [ "$XSERVER" != "Xorg" ]; then
-  ARGS="$ARGS -mouse /dev/input/mice"
+# Xorg doesn't support "-mouse" option, and uses /dev/input/mouse0 automatically
+# On neo we have touchscreen as /dev/input/mice, usb connected mouse would be probably mouse0
+if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/input/mouse0 ]; then
+  if [ "$XSERVER" != "/usr/bin/Xorg" ]; then
+    ARGS="$ARGS -mouse /dev/input/mouse0"
+  fi
+  USB_MOUSE="1"
 fi
 
 # start off server in conventional location.
@@ -128,8 +131,21 @@ case `module_id` in
                      fi
                      DPI=142
                 fi 
-                ARGS="$ARGS -dpi ${DPI} -screen ${SCREEN_SIZE} -mouse tslib -hide-cursor ${PPM} vt1" 
-               XSERVER=/usr/bin/Xglamo 
+
+                if [ "$XSERVER" = "/usr/bin/Xorg" ]; then
+                     if [ "$DPI" = "285" ]; then
+                         # Fix for only 3 columns of icons in illume desktop
+                         DPI=280
+                     fi
+                     if [ -z "${USB_MOUSE}" ]; then
+                         # Fix for segfault while typing on illume keyboard
+                         ARGS="$ARGS -nocursor"
+                     fi
+                     ARGS="$ARGS -dpi ${DPI} vt1"
+                else
+                     ARGS="$ARGS -dpi ${DPI} -screen ${SCREEN_SIZE} -mouse tslib -hide-cursor ${PPM} vt1" 
+                     XSERVER=/usr/bin/Xglamo 
+                fi
                ;;
        "Nokia N770")
                 ARGS="$ARGS -dpi 225 -screen ${SCREEN_SIZE} -mouse tslib" 
diff --git a/recipes/xserver-kdrive-common/xserver-kdrive-common/shr/89xTs_Calibrate b/recipes/xserver-kdrive-common/xserver-kdrive-common/shr/89xTs_Calibrate
new file mode 100644 (file)
index 0000000..b852c0c
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+while [ ! -z $TSLIB_TSDEVICE ] && [ ! -f /etc/pointercal ]
+do
+   /usr/bin/xtscal
+done
+
+SYSFS_CALIBRATION_DIR=/sys/bus/i2c/devices/0-0073/s3c2440-ts/calibration
+
+if [ ! -d $SYSFS_CALIBRATION_DIR ]; then
+  # moved in 2.6.31
+  SYSFS_CALIBRATION_DIR=/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/s3c2410-ts/calibration
+fi
+
+if [ -d $SYSFS_CALIBRATION_DIR ]; then
+  echo 0 > $SYSFS_CALIBRATION_DIR/0
+  echo 80000 > $SYSFS_CALIBRATION_DIR/1
+  echo -8000000 > $SYSFS_CALIBRATION_DIR/2
+  echo -81000 > $SYSFS_CALIBRATION_DIR/3
+  echo 0 > $SYSFS_CALIBRATION_DIR/4
+  echo 75000000 > $SYSFS_CALIBRATION_DIR/5
+  echo 65536 > $SYSFS_CALIBRATION_DIR/6
+fi