From 08ecaf2f53faed26790453783f8a72da15216753 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Tue, 9 Oct 2012 23:24:38 +0300 Subject: [PATCH] pandora-scripts: add gamma control script --- recipes/pandora-system/pandora-scripts.bb | 4 ++- .../pandora-scripts/op_gamma.sh | 29 +++++++++++++++++++ .../pandora-scripts/op_paths.sh | 2 ++ recipes/pandora-system/pandora-sudoers.bb | 2 +- .../pandora-sudoers/50_openpandora | 1 + 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100755 recipes/pandora-system/pandora-scripts/op_gamma.sh diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 1928aae..42c5f68 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -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 index 0000000..14440b2 --- /dev/null +++ b/recipes/pandora-system/pandora-scripts/op_gamma.sh @@ -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 diff --git a/recipes/pandora-system/pandora-scripts/op_paths.sh b/recipes/pandora-system/pandora-scripts/op_paths.sh index 418788f..ecc2b6e 100644 --- a/recipes/pandora-system/pandora-scripts/op_paths.sh +++ b/recipes/pandora-system/pandora-scripts/op_paths.sh @@ -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 diff --git a/recipes/pandora-system/pandora-sudoers.bb b/recipes/pandora-system/pandora-sudoers.bb index 61a5c05..ec2bce4 100644 --- a/recipes/pandora-system/pandora-sudoers.bb +++ b/recipes/pandora-system/pandora-sudoers.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" RDEPENDS = "sudo" -PR = "r18" +PR = "r19" SRC_URI = " \ file://50_openpandora \ diff --git a/recipes/pandora-system/pandora-sudoers/50_openpandora b/recipes/pandora-system/pandora-sudoers/50_openpandora index 1e572b5..a0489d2 100755 --- a/recipes/pandora-system/pandora-sudoers/50_openpandora +++ b/recipes/pandora-system/pandora-sudoers/50_openpandora @@ -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 -- 2.39.2