14440b2482c5d075146641f9be654f6d4d30cfd4
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_gamma.sh
1 #!/bin/sh
2
3 . /usr/pandora/scripts/op_paths.sh
4
5 if [ ! -e "$SYSFS_DSS_GAMMA" ]; then
6   echo "Control file is missing, might be incompatible kernel"
7   exit 1
8 fi
9
10 if [ "$1" = "0" ]; then
11   # set default gamma
12   # TODO: we could set some user global setting here instead
13   echo 0 > $SYSFS_DSS_GAMMA
14   exit 0
15 fi
16
17 if [ "$1" = "1" ]; then
18   # no gamma adjustment
19   echo 0 > $SYSFS_DSS_GAMMA
20   exit 0
21 fi
22
23 if [ "`which op_gammatable`" = "" ]; then
24   echo "op_gammatable tool required"
25   exit 1
26 fi
27
28 # just forward args to op_gammatable
29 op_gammatable "$@" > /sys/devices/platform/omapdss/display0/dss_gamma