summaryrefslogtreecommitdiffabout
path: root/recipes/xserver-kdrive-common/xserver-kdrive-common/shr/89xTs_Calibrate
blob: a39ece5e5719952a800894d563753e7fae22403a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/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
  # moved in 2.6.32
  SYSFS_CALIBRATION_DIR=/sys/devices/platform/s3c2440-i2c/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

if [ -e /usr/bin/xinput_calibrator_once.sh ] ; then
  if [ -e /etc/pointercal.xinput ] ; then
    if [ -e /usr/bin/fsoraw ] ; then
      # because ts tap to unblank will be used as first calibration click and then store invalid calibration
      fsoraw -fr CPU,Display -- /usr/bin/xinput_calibrator_once.sh
    else
      /usr/bin/xinput_calibrator_once.sh
    fi
    exit
  fi
fi