pandora-scripts: add gamma control script
authorGrazvydas Ignotas <notasas@gmail.com>
Tue, 9 Oct 2012 20:24:38 +0000 (23:24 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Tue, 9 Oct 2012 20:24:38 +0000 (23:24 +0300)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/op_gamma.sh [new file with mode: 0755]
recipes/pandora-system/pandora-scripts/op_paths.sh
recipes/pandora-system/pandora-sudoers.bb
recipes/pandora-system/pandora-sudoers/50_openpandora

index 1928aae..42c5f68 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r114"
+PR = "r115"
 
 SRC_URI = " \
           file://op_paths.sh \
@@ -85,6 +85,7 @@ SRC_URI = " \
          file://op_menu.sh \ 
          file://op_xfcemenu.sh \
          file://op_hugetlb.sh \
+         file://op_gamma.sh \
 "
 
 do_install() {
@@ -119,6 +120,7 @@ do_install() {
          install -m 0755 ${WORKDIR}/op_menu.sh ${D}${prefix}/pandora/scripts/ 
          install -m 0755 ${WORKDIR}/op_xfcemenu.sh ${D}${prefix}/pandora/scripts/ 
          install -m 0755 ${WORKDIR}/op_hugetlb.sh ${D}${prefix}/pandora/scripts/
+         install -m 0755 ${WORKDIR}/op_gamma.sh ${D}${prefix}/pandora/scripts/
          install -m 0755 ${WORKDIR}/reset_nubs.sh ${D}${prefix}/pandora/scripts/ 
          install -m 0644 ${WORKDIR}/pndlogo.png ${D}${prefix}/pandora/scripts/ 
          install -m 0755 ${WORKDIR}/ConfigModel.py ${D}${prefix}/pandora/scripts/
diff --git a/recipes/pandora-system/pandora-scripts/op_gamma.sh b/recipes/pandora-system/pandora-scripts/op_gamma.sh
new file mode 100755 (executable)
index 0000000..14440b2
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+. /usr/pandora/scripts/op_paths.sh
+
+if [ ! -e "$SYSFS_DSS_GAMMA" ]; then
+  echo "Control file is missing, might be incompatible kernel"
+  exit 1
+fi
+
+if [ "$1" = "0" ]; then
+  # set default gamma
+  # TODO: we could set some user global setting here instead
+  echo 0 > $SYSFS_DSS_GAMMA
+  exit 0
+fi
+
+if [ "$1" = "1" ]; then
+  # no gamma adjustment
+  echo 0 > $SYSFS_DSS_GAMMA
+  exit 0
+fi
+
+if [ "`which op_gammatable`" = "" ]; then
+  echo "op_gammatable tool required"
+  exit 1
+fi
+
+# just forward args to op_gammatable
+op_gammatable "$@" > /sys/devices/platform/omapdss/display0/dss_gamma
index 418788f..ecc2b6e 100644 (file)
@@ -19,3 +19,5 @@ else
        echo "ERROR: gamma control not found" >&2
        SYSFS_GAMMA=/dev/null
 fi
+
+SYSFS_DSS_GAMMA=/sys/devices/platform/omapdss/display0/dss_gamma
index 61a5c05..ec2bce4 100644 (file)
@@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 
 RDEPENDS = "sudo"
 
-PR = "r18"
+PR = "r19"
 
 SRC_URI = " \
           file://50_openpandora \
index 1e572b5..a0489d2 100755 (executable)
@@ -31,3 +31,4 @@
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/pnd_run.sh
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_touchinit.sh
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_hugetlb.sh
+%wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_gamma.sh