aboutsummaryrefslogtreecommitdiffstats
path: root/init.espresso.variant.sh
blob: a9b81def215eea5fe13cb9393ffb4d2e7262b75d (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
#!/system/bin/sh
# Copyright (c) 2016 OMAP4-AOSP
# Copyright (c) Ketut P. Kumajaya, Sept 2013

export PATH=/system/bin

DEVICE=/sys/board/type

if [ -f "$DEVICE" ]
then
  variant=`cat $DEVICE`
  case "$variant" in
      "espresso" | "espressowifi")
            # set p31xx to portrait mode
            setprop ro.sf.hwrotation 270

            # set mms136 touchcreen driver orientation
            echo 1 > /sys/devices/virtual/sec/tsp/pivot

            # set accelerometer position
            position=$(find /sys/devices/virtual/input/ -type f -name name | xargs grep '^accelerometer$' | sed 's@name:accelerometer@position@')
            echo -n 6 > $position

            # set geomagnetic position
            position=$(find /sys/devices/platform/omap/omap_i2c.4/i2c-4/4-002e/input/ -type f -name name | xargs grep '^geomagnetic$' | sed 's@name:geomagnetic@position@')
            echo -n 6 > $position
            ;;
  esac
fi